/* Deliberately no width/height changes: preserve the host ball's responsive footprint. */
:root {
    --draw-cage: #d6a34a; --draw-cage-rgb: 214, 163, 74;
    --draw-balls: #e34a38; --draw-balls-rgb: 227, 74, 56;
    --draw-lighting: #42c8d6; --draw-lighting-rgb: 66, 200, 214;
    --draw-ball-highlight: #fbe0d8; --draw-ball-highlight-rgb: 251, 224, 216;
    --draw-ball-label: #ffffff;
    --draw-ball-body: #321310; --draw-ball-mid: #7a2e25; --draw-ball-deep: #090607;
}
.premium-ball {
    isolation: isolate;
    /* Keep the user-selected swatch as the actual paint beneath the lighting
       layers.  The gradients add form; they must not replace the ball colour. */
    background:
        radial-gradient(ellipse at 29% 17%, rgba(var(--draw-ball-highlight-rgb), .62) 0%, rgba(var(--draw-ball-highlight-rgb), .14) 9%, transparent 27%),
        radial-gradient(ellipse at 76% 79%, rgba(var(--draw-balls-rgb), .45), transparent 40%),
        radial-gradient(circle at 38% 30%, var(--draw-ball-highlight) 0%, var(--draw-balls) 22%, var(--draw-ball-body) 72%, var(--draw-ball-deep) 98%);
    background-color: var(--draw-balls);
    box-shadow: inset -14px -19px 25px rgba(0,0,0,.58), inset 3px 3px 10px rgba(var(--draw-ball-highlight-rgb), .48),
        inset -2px -2px 5px rgba(var(--draw-balls-rgb), .33), 0 12px 24px #000b, 0 0 55px rgba(var(--draw-balls-rgb), .21);
    border-color: rgba(var(--draw-balls-rgb), .3);
}
.premium-ball::before {
    content: "";
    position: absolute;
    width: 47%;
    height: 19%;
    top: 6%;
    left: 16%;
    transform: rotate(-29deg);
    border-radius: 50%;
    background: linear-gradient(rgba(var(--draw-ball-highlight-rgb), .46), transparent);
    filter: blur(2px);
    pointer-events: none;
}
.premium-ball::after {
    content: "";
    position: absolute;
    inset: 3%;
    border-radius: 50%;
    box-shadow: inset -5px -8px 13px #0009, inset 1px 2px 2px #fff2;
    pointer-events: none;
    z-index: 6;
}
.premium-ball .cyan-inner-ring {
    border-width: clamp(3px, .7vmin, 7px);
    border-color: var(--draw-balls);
    box-shadow: 0 0 12px rgba(var(--draw-balls-rgb), .4), inset 0 0 9px rgba(var(--draw-balls-rgb), .2), 1px 3px 5px #000b;
    width: 78%;
    height: 78%;
}
.premium-ball .text-cyan-bright,
.premium-ball .ball-letter-bright { color: var(--draw-ball-label); text-shadow: 0 2px 2px #0009, 0 0 14px rgba(var(--draw-balls-rgb), .33) !important; }
.premium-ball > .ball-letter-text {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    font-size: clamp(12px, 12cqw, 52px);
}
.premium-ball > .ball-number-text {
    position: absolute;
    top: 39%;
    left: 50%;
    transform: translateX(-50%);
    width: 68%;
    max-width: 68%;
    text-align: center;
    line-height: .92;
    white-space: nowrap;
    font-size: clamp(30px, 42cqw, 160px);
    letter-spacing: -.055em;
}
@keyframes ball-settle {
    from { transform: translateY(-12px) scale(1.06); opacity: .6; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.animate-ball-reveal { animation: ball-settle .45s ease-out both; }
#video-overlay {
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 40%, rgba(var(--draw-lighting-rgb), .14), #080a10 67%, #020305);
    transition: opacity .25s;
}
#video-overlay.draw-handoff-active {
    background: transparent;
}
#video-overlay.draw-handoff-active .draw-caption {
    opacity: 0;
    transition: opacity .2s ease;
}
#draw-scene.draw-handoff-scene canvas {
    opacity: 0;
    transition: opacity 1s ease;
}
#draw-scene { position: absolute; inset: 0; }
#draw-scene canvas { display: block; width: 100%; height: 100%; }
#draw-scene canvas { cursor: grab; outline: none; }
#draw-scene canvas:active { cursor: grabbing; }
#draw-scene canvas:focus-visible { outline: 2px solid var(--draw-ball-highlight); outline-offset: -8px; }
.draw-caption {
    position: absolute;
    top: max(24px, env(safe-area-inset-top));
    left: 20px;
    right: 20px;
    text-align: center;
    pointer-events: none;
    text-shadow: 0 2px 12px #000;
}
@media (min-width: 768px) {
    #draw-scene {
        top: clamp(104px, 14vh, 132px);
    }
}
@media (max-width: 767px) {
    .draw-caption {
        top: max(12px, env(safe-area-inset-top));
        left: 12px;
        right: 12px;
        padding: 12px 10px 11px;
        border: 1px solid rgba(255, 255, 255, .1);
        border-radius: 14px;
        background: rgba(0, 0, 0, .62);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}
.draw-kicker { font-size: 10px; text-transform: uppercase; font-weight: 900; letter-spacing: .3em; color: var(--draw-ball-highlight); }
#draw-status { color: #eae6f0; font-size: 14px; margin-top: 8px; }
#draw-instructions {
    color: #c8c5cf;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    margin-top: 7px;
    text-transform: uppercase;
}
#skip-btn { bottom: max(25px, env(safe-area-inset-bottom)); right: 25px; color: #eee; min-height: 44px; border-color: #fff3; }
#skip-btn:focus-visible { outline: 3px solid var(--draw-ball-highlight); outline-offset: 4px; }
#draw-fallback { position: relative; text-align: center; color: #cfc8dc; }
#draw-fallback[hidden] { display: none; }
.fallback-orb {
    display: grid; place-items: center; margin: 0 auto 24px;
    width: min(44vmin, 240px); aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, var(--draw-ball-mid), var(--draw-ball-body) 35%, var(--draw-ball-deep) 72%);
    border: 2px solid rgba(var(--draw-balls-rgb), .4); box-shadow: inset 3px 4px 8px #fff3, 0 0 60px rgba(var(--draw-balls-rgb), .2);
    font-size: 20px; font-weight: 900; letter-spacing: .15em;
}
.host-settings-button { flex-shrink: 0; min-width: 40px; min-height: 40px; }
.host-control-stack { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.host-audio-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #ffffff24; border-radius: 10px; color: white; background: #ffffff0d; transition: .18s ease; }
.host-audio-button:hover { background: #ffffff1a; }
.host-audio-button[aria-pressed="false"] { color: #aaa; }
.settings-panel { max-width: 380px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.settings-accordion { margin-bottom: 12px; border: 1px solid #ffffff14; border-radius: 16px; background: #ffffff05; overflow: hidden; }
.settings-accordion summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px; cursor: pointer; color: #eee; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.settings-accordion summary small { color: #888; font-size: 8px; letter-spacing: .04em; text-align: right; }
.settings-accordion-content { padding: 0 14px 14px; }
.sound-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 2px; border-bottom: 1px solid #ffffff0c; cursor: pointer; }
.sound-setting-row strong, .sound-setting-row small { display: block; }
.sound-setting-row strong { color: #eee; font-size: 12px; }
.sound-setting-row small { color: #999; font-size: 9px; margin-top: 3px; }
.sound-setting-row input { width: 36px; height: 20px; accent-color: var(--app-accent, #22d3ee); }
#sound-settings-status { color: #888; font-size: 9px; line-height: 1.5; margin-top: 12px; }
.settings-close { display: grid; place-items: center; min-width: 36px; min-height: 36px; }
.draw-appearance { margin: -2px -2px 22px; padding: 14px 14px 20px; border: 1px solid #ffffff0d; border-radius: 18px; background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); }
.appearance-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 1px 12px; }
.appearance-heading h3 { color: #ddd; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
#draw-colors-reset { color: #c8c0b5; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-decoration: underline; text-underline-offset: 3px; padding: 5px 0 5px 10px; }
#draw-colors-reset:hover { color: white; }
.accent-room-preview {
    height: 190px; position: relative; overflow: hidden; display: grid; place-items: center;
    background: radial-gradient(ellipse at 50% 105%, rgba(var(--draw-lighting-rgb), .42), transparent 67%), radial-gradient(circle at 16% 8%, rgba(255,255,255,.08), transparent 34%), linear-gradient(140deg, #05090d, #10151a);
    border: 1px solid rgba(var(--draw-lighting-rgb), .32); border-radius: 14px;
    cursor: grab; touch-action: none; user-select: none;
    box-shadow: inset 0 0 35px #000b, inset 0 1px #ffffff12, 0 12px 28px #0008;
}
.accent-room-preview.dragging { cursor: grabbing; }
.accent-room-preview canvas { width: 100%; height: 100%; display: block; }
.accent-room-preview::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
    background: linear-gradient(90deg, rgba(var(--draw-lighting-rgb), .16), transparent 18%, transparent 82%, rgba(var(--draw-lighting-rgb), .16));
    mix-blend-mode: screen;
}
.accent-preview-caption { position: absolute; z-index: 2; bottom: 8px; padding: 4px 8px; border-radius: 999px; background: #050608c9; font-size: 6px; letter-spacing: .2em; color: #e6e0d7; font-weight: 800; pointer-events: none; }
.accent-picker-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; cursor: pointer; }
.accent-picker-row strong { display: block; font-size: 12px; color: #eee; }
.accent-picker-row small { display: block; font-size: 10px; color: #aaa; margin-top: 4px; }
.draw-color-controls { margin-top: 10px; }
.draw-color-controls .accent-picker-row { padding: 11px 2px; margin: 0; border-bottom: 1px solid #ffffff0c; }
.color-input-wrap { display: flex; align-items: center; }
.color-input-wrap input { appearance: none; -webkit-appearance: none; width: 48px; height: 42px; padding: 4px; flex-shrink: 0; background: #ffffff08; border: 1px solid #ffffff30; border-radius: 11px; cursor: pointer; box-shadow: 0 3px 10px #0006, inset 0 1px #ffffff14; transition: transform .18s ease, border-color .18s ease; }
.color-input-wrap input:hover { transform: scale(1.04); border-color: rgba(var(--draw-lighting-rgb), .7); }
.color-input-wrap input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input-wrap input::-webkit-color-swatch { border: none; border-radius: 6px; }
.color-input-wrap input::-moz-color-swatch { border: none; border-radius: 6px; }
.spectrum-note { margin: 11px 0 0; color: #c2bbb1; font-size: 9px; }
#draw-color-status { margin: 5px 0 0; color: #908b86; font-size: 10px; line-height: 1.6; }
.draw-appearance :focus-visible, .settings-close:focus-visible, .host-settings-button:focus-visible { outline: 2px solid var(--draw-ball-highlight); outline-offset: 3px; }
@media (min-width: 768px) and (max-width: 1279px) {
    .host-desktop-actions { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    .animate-ball-reveal, .poster-card, .quote-card { animation: none !important; }
    .premium-ball.draw-handoff-ready,
    #draw-scene.draw-handoff-scene canvas,
    #video-overlay.draw-handoff-active .draw-caption { transition: none !important; }
    .draw-handoff-flourish,
    .draw-handoff-flourish::before,
    .draw-handoff-flourish::after,
    .draw-handoff-flourish i { animation: none !important; }
    .draw-flight-proxy { transition: none !important; }
}