/* --- Body and Background --- */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #e0e0e0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    cursor: crosshair;
    background: linear-gradient(-45deg, #111111, #222222, #1c1c1c, #282828);
    background-size: 400% 400%;
    animation: animated-gradient 20s ease infinite;
    -webkit-user-select: none; 
    -moz-user-select: none;    
    -ms-user-select: none;     
    user-select: none;         
    -webkit-touch-callout: none;
}

@keyframes animated-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#grid-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
}

/* --- Popups --- */
#welcome-popup, #fullscreen-popup { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); display: flex; justify-content: center; align-items: center; z-index: 5000; /* CHANGED from 1000 to 5000 to stay above Game UI */ }
.popup-content { background-color: #1e1e1e; padding: 30px 40px; border-radius: 10px; text-align: center; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5); width: 90%; max-width: 400px; }
.popup-buttons { display: flex; justify-content: center; gap: 15px; margin-top: 25px; }
#fullscreen-yes-btn, #fullscreen-no-btn { padding: 10px 20px; font-size: 16px; cursor: pointer; border-radius: 20px; border: none; transition: background-color 0.2s, transform 0.2s; }
#fullscreen-yes-btn { background-color: #28a745; color: white; }
#fullscreen-yes-btn:hover { background-color: #218838; }
#fullscreen-no-btn { background-color: #6c757d; color: white; }
#fullscreen-no-btn:hover { background-color: #5a6268; }
#name-input { display: block; width: 80%; margin: 20px auto; padding: 10px; border-radius: 5px; border: 1px solid #444; background: #222; color: #eee; font-size: 16px; }
#enter-button { padding: 10px 25px; font-size: 16px; cursor: pointer; border-radius: 20px; border: none; background-color: #0d6efd; color: white; transition: background-color 0.2s; }
#enter-button:hover { background-color: #0b5ed7; }

/* Eye Selection */
.eye-choices { display: flex; justify-content: center; gap: 30px; margin-top: 20px; flex-wrap: wrap; }
.eye-choice { cursor: pointer; padding: 15px; border-radius: 10px; border: 2px solid transparent; transition: background-color 0.2s, border-color 0.2s; flex: 0 1 auto; }
.eye-choice:hover { background-color: rgba(255, 255, 255, 0.1); border-color: #ff914d; }
.eye-choice p { margin: 10px 0 0 0; font-size: 14px; color: #ccc; text-align: center; }
.eye-choice .eye-container { transform: scale(0.5); gap: 10px; }

/* --- User Wrapper --- */
.user-wrapper { 
    position: absolute; 
    transform: translate(-50%, -50%); 
    transition: left 0.3s ease-out, top 0.3s ease-out, opacity 0.5s, transform 0.5s; 
    animation: breathing 5s ease-in-out infinite;
    z-index: 1600; /* CHANGED from 600 to 1600 (Above Uno Container) */
    pointer-events: none; /* Let clicks pass through wrapper mostly, specific elements will catch them */
}

/* Ensure interactive parts capture clicks */
.user-wrapper .eye-container, 
.user-wrapper .name-plate {
    pointer-events: auto;
    cursor: pointer;
}

.user-wrapper.disconnected { filter: grayscale(100%); opacity: 0.6; animation: none; }
@keyframes breathing { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.03); } }
.user-wrapper.joining { animation: user-join 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); }
@keyframes user-join { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.user-wrapper.leaving { animation: user-leave 0.5s cubic-bezier(0.55, 0.055, 0.675, 0.19); opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
@keyframes user-leave { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); } }
.ripple { position: fixed; border-radius: 50%; background-color: rgba(255, 145, 77, 0.7); transform: translate(-50%, -50%) scale(0); animation: ripple-effect 0.7s ease-out; pointer-events: none; z-index: 999; }
@keyframes ripple-effect { to { transform: translate(-50%, -50%) scale(2); opacity: 0; } }

/* Hats */
.user-hat {
    position: absolute;
    bottom: 85%; /* Sits above eyes */
    left: 50%;
    transform: translateX(-50%);
    max-width: 100px;
    max-height: 80px;
    z-index: 10;
    pointer-events: none;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.5));
}

/* Floating Emoji Reactions */
.floating-emoji {
    position: absolute;
    font-size: 2rem;
    pointer-events: none;
    z-index: 2000;
    animation: floatUp 2s ease-out forwards;
}
@keyframes floatUp {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
    50% { transform: translate(-50%, -100%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -200%) scale(1); }
}

.name-plate { display: flex; align-items: center; background-color: rgba(0,0,0,0.5); padding: 3px 10px; border-radius: 12px; margin-bottom: 8px; font-size: clamp(12px, 2.5vmin, 16px); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.ping { width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.eye-container { display: flex; cursor: pointer; }
.eye { width: 10vmin; height: 10vmin; min-width: 60px; min-height: 60px; max-width: 100px; max-height: 100px; background-color: white; border-radius: 50%; margin: 0 1.5vmin; position: relative; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); overflow: hidden; }
.pupil { width: 40%; height: 40%; background-color: #333; border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; }
#user-counter { position: fixed; top: 10px; left: 10px; background-color: rgba(0, 0, 0, 0.5); padding: 5px 15px; border-radius: 15px; font-size: 14px; }

/* --- Eye Styles & Animations --- */
.eye-style-anime .eye { height: 11vmin; min-height: 66px; max-height: 110px; border-radius: 45% / 50%; }
.eye-style-anime .pupil { width: 50%; height: 50%; background-color: #4a4a68; }
.eye-style-anime .pupil::before, .eye-style-anime .pupil::after { content: ''; position: absolute; background-color: white; border-radius: 50%; z-index: 2; }
.eye-style-anime .pupil::before { width: 40%; height: 40%; top: 15%; left: 15%; }
.eye-style-anime .pupil::after { width: 20%; height: 20%; bottom: 20%; right: 20%; }
.eye-style-cat .eye { border-radius: 50% 50% 10% 10% / 50% 50% 30% 30%; }
.eye-style-cat .pupil { width: 15%; height: 70%; border-radius: 5px; }
.eye::before, .eye::after { content: ""; position: absolute; left: 0; width: 100%; height: 100%; background: #121212; border-radius: 50%; z-index: 5; transition: transform 0.2s ease-out; }
.eye::before { top: 0; transform-origin: top; transform: scaleY(0); }
.eye::after { bottom: 0; transform-origin: bottom; transform: scaleY(0); }

/* Animation Keyframes */
.blinking .eye::before { animation: blink 0.3s; } @keyframes blink { 0%, 100% { transform: scaleY(0); } 50% { transform: scaleY(1); } }
.looking-around .pupil { animation: look-around 2s ease-in-out infinite; } @keyframes look-around { 0%, 100% { transform: translate(-50%, -50%); } 25% { transform: translate(-70%, -50%); } 50% { transform: translate(-50%, -70%); } 75% { transform: translate(-30%, -50%); } 100% { transform: translate(-50%, -50%); } }
.shake { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; } @keyframes shake { 10%, 90% { transform: translate3d(-1px, 0, 0); } 20%, 80% { transform: translate3d(2px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-4px, 0, 0); } 40%, 60% { transform: translate3d(4px, 0, 0); } }
.surprise .eye { animation: surprise-eye 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); } @keyframes surprise-eye { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }
.spin .eye { animation: spin-eye 1s ease-in-out; } @keyframes spin-eye { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.bounce { animation: bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55); } @keyframes bounce { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-20px); } 50% { transform: translateY(0); } 75% { transform: translateY(-10px); } }
.squeeze .eye { animation: squeeze 0.6s ease-in-out; } @keyframes squeeze { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.6); } }
.dizzy .eye { animation: dizzy 1s ease-in-out; } @keyframes dizzy { 0% { transform: rotate(0deg) scale(1); } 25% { transform: rotate(10deg) scale(1.1); } 50% { transform: rotate(-10deg) scale(0.9); } 75% { transform: rotate(5deg) scale(1.1); } 100% { transform: rotate(0deg) scale(1); } }
.cross-eyed .pupil { animation: cross-eyes 0.8s; } @keyframes cross-eyes { 0%, 100% { transform: translate(-50%,-50%); } 50% { transform: translate(-30%, -50%); } }
.glow .eye { animation: glowing-eye 1.5s ease-in-out; } @keyframes glowing-eye { 0%, 100% { box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); } 50% { box-shadow: 0 0 25px rgba(0, 255, 255, 0.9), 0 5px 15px rgba(0, 0, 0, 0.3); } }
.roll .pupil { animation: roll-pupil 1.2s ease-in-out; } @keyframes roll-pupil { 0% { transform: translate(-50%, -50%); } 20% { transform: translate(-50%, -80%); } 40% { transform: translate(-20%, -50%); } 60% { transform: translate(-50%, -20%); } 80% { transform: translate(-80%, -50%); } 100% { transform: translate(-50%, -50%); } }
.suspicious .pupil { animation: suspicious-dart 1.5s ease-in-out; } @keyframes suspicious-dart { 0%, 100% { transform: translate(-50%, -50%); } 20% { transform: translate(-80%, -50%); } 40% { transform: translate(-50%, -50%); } 60% { transform: translate(-20%, -50%); } 80%, 90% { transform: translate(-50%, -50%); } }
.heart-eyes .pupil { background-color: transparent !important; animation: heart-beat 1s ease-in-out; }
.heart-eyes .pupil::before, .heart-eyes .pupil::after { content: ""; position: absolute; top: 0; width: 50%; height: 80%; background: #e53935; border-radius: 50% 50% 0 0; }
.heart-eyes .pupil::before { left: 50%; transform: rotate(-45deg); transform-origin: 0 100%; }
.heart-eyes .pupil::after { left: 0; transform: rotate(45deg); transform-origin: 100% 100%; }
@keyframes heart-beat { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.2); } }
.wink .eye:first-child::before { animation: wink-left 0.5s; }
@keyframes wink-left { 0%, 100% { transform: scaleY(0); } 50% { transform: scaleY(1); } }
.sleepy .eye::before { animation: sleepy-lid 2s ease-in-out; }
@keyframes sleepy-lid { 0%, 100% { transform: scaleY(0); } 50% { transform: scaleY(0.7); } }
.squint .eye::before { animation: squint-top 1.2s ease-in-out; }
.squint .eye::after { animation: squint-bottom 1.2s ease-in-out; }
@keyframes squint-top { 0%, 100% { transform: scaleY(0); } 50% { transform: scaleY(0.5); } }
@keyframes squint-bottom { 0%, 100% { transform: scaleY(0); } 50% { transform: scaleY(0.3); } }

/* --- Draggable Elements & Menu --- */
.draggable-element { 
    position: fixed; 
    background: rgba(59, 46, 37, 0.95); 
    color: #ff914d; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    padding: 15px 20px; 
    border-radius: 12px; 
    cursor: move; 
    user-select: none; 
    touch-action: none; 
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5); 
    min-width: 120px; 
}
#timer-element { top: 50%; left: 50%; padding-top: 20px; z-index: 600}
.text-element { 
    z-index: 600; 
    top: 50%; 
    left: 50%; 
    min-width: 200px; 
    padding: 10px 15px; 
    cursor: move; /* Show move cursor by default */
}
.close-btn { position: absolute; top: -10px; right: -10px; width: 30px; height: 30px; border-radius: 50%; background: #dc3545; color: white; border: none; cursor: pointer; font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); z-index: 602; }
.close-btn:hover { background: #c82333; }

/* Timer Specifics (FIXED SIZING) */
.timer-display { text-align: center; display: flex; flex-direction: column; gap: 15px; }
.timer-controls { display: flex; align-items: center; justify-content: center; gap: 5px; }

/* Hide Spinner Arrows */
.timer-controls input::-webkit-outer-spin-button,
.timer-controls input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.timer-controls input[type=number] {
  -moz-appearance: textfield;
}

.timer-controls input { 
    width: 50px; /* Reduced from 70px */
    height: 50px; 
    padding: 0;
    font-size: 1.5rem; 
    text-align: center; 
    background: rgba(94, 62, 47, 0.8); 
    border: 2px solid #ff914d; 
    border-radius: 8px; 
    color: #ff914d; 
    font-weight: bold; 
    box-sizing: border-box; 
    line-height: 1;
}

.timer-controls input:focus { outline: none; border-color: #ffb380; box-shadow: 0 0 10px rgba(255, 145, 77, 0.5); }
.timer-controls span { font-size: 1.5rem; font-weight: bold; margin-top: -4px; }
.timer-time { font-size: clamp(2rem, 5vw, 3rem); font-weight: bold; letter-spacing: 0.1em; }
.timer-time.warning { color: #ffc107; animation: pulse 1s infinite; }
.timer-time.danger { color: #dc3545; animation: pulse 0.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.timer-buttons { display: flex; gap: 10px; justify-content: center; }
.timer-btn { padding: 8px 16px; font-size: 1rem; background: rgba(94, 62, 47, 0.8); color: #ff914d; border: 2px solid #ff914d; border-radius: 8px; cursor: pointer; transition: all 0.3s ease; }
.timer-btn:hover { background: #ff914d; color: #3b2e25; transform: translateY(-2px); }

/* Text Element */
.text-content { 
    font-size: clamp(1rem, 3vw, 1.5rem); 
    min-height: 30px; 
    outline: none; 
    word-wrap: break-word; 
    caret-color: #ff914d;
    
    /* NEW: Prevent interaction by default so the parent receives drag events */
    pointer-events: none; 
}

.text-element { 
    z-index: 600; 
    top: 50%; 
    left: 50%; 
    min-width: 200px; 
    padding: 10px 15px; 
    cursor: move; 
    
    /* NEW: Prevent text highlighting while dragging */
    user-select: none;
    -webkit-user-select: none;
}

.text-element.typing-active { 
    border: 2px solid var(--typing-color, #ff914d); 
    box-shadow: 0 0 15px var(--typing-color, rgba(255, 145, 77, 0.7)); 
    transition: all 0.1s ease-out; 
}

.text-content[contenteditable]:empty::before { 
    content: "Type here..."; 
    color: rgba(255, 145, 77, 0.5); 
    pointer-events: none; 
    display: block; 
}

/* Edit Mode: Enable interaction and selection */
.text-element.is-editing {
    cursor: text;
    background: rgba(0, 0, 0, 0.4); 
}

.text-element.is-editing .text-content {
    /* NEW: Allow typing and selection only when editing */
    pointer-events: auto;
    user-select: text;
    -webkit-user-select: text;
}

/* --- YOUTUBE PLAYER STYLES --- */
#youtube-element {
    max-width: 50vw; 
    padding: 10px;
    background: #000;
    border: 2px solid #ff914d;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 320px; 
    height: auto; 
    min-width: 200px;
    min-height: 150px;
    position: fixed; 
    z-index: 400; 
    max-height: 70vh; 
}

.yt-controls {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    flex-wrap: wrap; 
}

#yt-url-input {
    flex: 1;
    min-width: 100px;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
}

#yt-load-btn {
    background: #ff0000;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.yt-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; 
    background: #111;
    overflow: hidden;
    flex-shrink: 0;
}

.yt-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.yt-drag-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: none;
    z-index: 10;
}
.dragging .yt-drag-overlay { display: block; }
.resizing .yt-drag-overlay { display: block; }

/* YouTube Queue */
.yt-queue-container {
    background: #1e1e1e;
    border-top: 1px solid #333;
    padding-top: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 150px;
}

.yt-queue-header {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
}

#yt-queue-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.yt-queue-item {
    background: #2a2a2a;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.yt-queue-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85%;
}
.yt-remove-btn {
    background: none;
    border: none;
    color: #ff4d4d;
    cursor: pointer;
    font-weight: bold;
}

#yt-resize-handle {
    width: 20px; 
    height: 20px;
    background: linear-gradient(135deg, transparent 50%, #ff914d 50%);
    position: absolute;
    bottom: 0;
    right: 0;
    cursor: se-resize;
    z-index: 20;
    touch-action: none;
}

/* Menu */
#long-press-indicator { position: fixed; width: 60px; height: 60px; border-radius: 50%; background: rgba(255, 145, 77, 0.2); border: 3px solid #ff914d; pointer-events: none; z-index: 999; transform: translate(-50%, -50%); }
.press-progress { width: 100%; height: 100%; border-radius: 50%; background: conic-gradient(#ff914d 0deg, transparent 0deg); transition: background 0.1s linear; }

#choice-menu, #reaction-menu { position: fixed; background: rgba(30, 30, 30, 0.98); border-radius: 15px; padding: 20px; z-index: 1000; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7); transform: translate(-50%, -50%); animation: menuAppear 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); }

/* Reaction Menu Style */
#reaction-menu { 
    display: flex; 
    gap: 10px; 
    padding: 10px; 
    flex-wrap: wrap; 
    justify-content: center; 
    max-width: 220px; 
    align-items: center;
}

.reaction-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; transition: transform 0.2s; }
.reaction-btn:hover { transform: scale(1.3); }

/* Remove Hat Button */
.reaction-action-btn {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    color: #ff6b6b;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%; /* Force it to own line */
    margin-bottom: 5px;
}
.reaction-action-btn:hover {
    background: #dc3545;
    color: white;
}

@keyframes menuAppear { 0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.menu-content { display: flex; gap: 20px; flex-direction: column; }
.menu-btn { background: rgba(59, 46, 37, 0.95); color: #ff914d; border: 2px solid #ff914d; border-radius: 12px; padding: 20px 30px; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; gap: 15px; transition: all 0.3s ease; min-width: 180px; }
.menu-btn:hover { background: #ff914d; color: #3b2e25; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255, 145, 77, 0.4); }
.menu-icon { font-size: 2rem; }

@media (max-width: 768px) {
    #user-counter { font-size: 12px; padding: 4px 10px; }
    .popup-content { padding: 20px; }
    #youtube-element { width: 280px; }
    .menu-content { gap: 15px; }
    .menu-btn { padding: 25px 30px; font-size: 1.1rem; min-width: 180px; }
}

/* --- WEB IFRAME STYLES --- */
#iframe-element {
    width: 400px;
    height: 300px;
    /* Increase top padding to create a "Title Bar" for easy dragging */
    padding: 35px 10px 10px 10px; 
    background: #1e1e1e;
    border: 2px solid #ff914d;
    display: flex; 
    flex-direction: column; 
    gap: 10px;
    position: fixed;
    z-index: 500;
    min-width: 250px;
    min-height: 200px;
    box-sizing: border-box; 
    /* Removed overflow:hidden so the close button (at -10px) is visible */
    border-radius: 8px; /* Optional: smooth outer corners */
}

/* Add styling for the wrapper to clip the iframe content cleanly */
.iframe-wrapper {
    flex: 1; 
    width: 100%;
    position: relative;
    background: #fff;
    padding-bottom: 0 !important; 
    border-radius: 4px; /* Round the iframe corners */
    overflow: hidden;   /* Clip content inside the wrapper, not the main box */
}

/* Fix the Text Input UI to stretch properly */
#iframe-url-input {
    flex: 1; /* Makes input fill available space */
    width: auto;
    min-width: 0; /* Prevents flexbox overflow issues */
}

#iframe-display {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

#iframe-resize-handle {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, transparent 50%, #ff914d 50%);
    position: absolute;
    bottom: 0;
    right: 0;
    cursor: se-resize;
    z-index: 20;
    touch-action: none;
}

/* Styling for the Iframe Input Bar */
#iframe-url-input {
    flex: 1; /* Fills the space */
    background: #2a2a2a;
    border: 1px solid #555;
    color: #ff914d;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

#iframe-url-input::placeholder {
    color: rgba(255, 145, 77, 0.5); /* Dim orange placeholder */
}

#iframe-url-input:focus {
    border-color: #ff914d;
    box-shadow: 0 0 8px rgba(255, 145, 77, 0.2);
}

#iframe-load-btn {
    background: #ff914d;
    color: #1e1e1e; /* Dark text for contrast */
    border: none;
    padding: 0 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s, transform 0.1s;
}

#iframe-load-btn:hover {
    background: #ffb380;
}

#iframe-load-btn:active {
    transform: scale(0.95);
}

/* --- CINEMA PLAYER STYLES --- */
#cinema-element {
    width: 480px;
    height: 320px;
    padding: 35px 10px 10px 10px;
    background: #111;
    border: 2px solid #ff914d; /* ORANGE BORDER */
    display: flex;
    flex-direction: column;
    position: fixed;
    z-index: 500;
    min-width: 300px;
    min-height: 250px;
    box-sizing: border-box;
    border-radius: 8px;
}

#cinema-setup {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    gap: 10px;
}

#cinema-setup h3 { margin: 0; color: #ff914d; } /* ORANGE TEXT */
#cinema-setup p { margin: 0; font-size: 0.8rem; color: #aaa; }

#cinema-url-input {
    width: 90%;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
}

#cinema-url-input:focus { border-color: #ff914d; outline: none; }

#cinema-broadcast-btn {
    background: #ff914d; /* ORANGE BUTTON */
    color: #1e1e1e; /* Dark Text */
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}
#cinema-broadcast-btn:hover { background: #ffb380; }

#cinema-player-view {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
    overflow: hidden;
}

#cinema-video { width: 100%; height: 100%; background: #000; }

/* Join Overlay */
#cinema-join-overlay {
    position: absolute;
    top: 35px; left: 0; width: 100%; height: calc(100% - 35px);
    background: rgba(0,0,0,0.9);
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

#cinema-join-btn {
    margin-top: 15px;
    background: #007bff; /* Keep blue for "Action" or change to #ff914d if preferred */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Kill Switch */
#cinema-kill-btn {
    position: absolute;
    top: 5px;
    left: 10px;
    /* Orange Tint Background */
    background: rgba(255, 145, 77, 0.2); 
    border: 1px solid #ff914d;
    color: #ff914d;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: none;
    z-index: 603;
}
#cinema-kill-btn:hover { background: #ff914d; color: #1e1e1e; }

#cinema-resize-handle {
    width: 20px; height: 20px;
    /* Orange Gradient Corner */
    background: linear-gradient(135deg, transparent 50%, #ff914d 50%);
    position: absolute; bottom: 0; right: 0;
    cursor: se-resize; z-index: 20;
}
