/* The wheel itself always stays centered in the full viewport — the roster
   drawer is a fixed-position overlay sliding in from the left, so it never
   participates in the flex layout that centers #stage (see app.js for the
   open/close logic). */

html, body { height: 100%; }
body { overflow: hidden; }

#topbar { transition: opacity 0.35s ease, transform 0.35s ease; }
body:fullscreen #topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 40;
}
body.topbar-hidden:fullscreen #topbar { opacity: 0; pointer-events: none; transform: translateY(-8px); }

#stage {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px;
    min-height: 0;
}

#roster-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.roster-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--surface-2);
}
.roster-row.inactive { opacity: 0.5; }
.roster-row .r-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-row .r-picks { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.roster-row button { border: none; background: transparent; cursor: pointer; color: var(--muted); font-size: 13px; }
.roster-row button:hover { color: var(--danger); }

#history-list { display: flex; flex-direction: column-reverse; gap: 4px; max-height: 200px; overflow-y: auto; font-size: 12.5px; }
.history-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--border); color: var(--muted); }
.history-row .h-name { color: var(--text); font-weight: 500; }

/* Sized to always fit: capped by viewport width AND height so it can never
   overflow, whatever the drawer/topbar state. */
#wheel-stage {
    position: relative;
    width: min(560px, 82vw, 54vh);
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
}
#wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    /* Rotation is driven frame-by-frame from app.js (not a CSS transition) so
       the deceleration curve and the tick sound can stay in sync with what's
       actually under the pointer at every instant. */
}
#wheel-pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 34px;
    color: var(--primary);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25));
    z-index: 2;
}
#confetti-layer {
    position: absolute;
    inset: -40px;
    pointer-events: none;
    overflow: visible;
    z-index: 3;
}
.confetti-piece {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    opacity: 0;
}

#spin-btn.charging { animation: chargePulse 0.5s ease-out; }
@keyframes chargePulse { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }

#winner-display {
    min-height: 40px;
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
}
#winner-display .winner-name { display: inline-block; margin: 0 6px; padding: 4px 14px; border-radius: 10px; background: var(--surface-2); }

/* Roster drawer: slides in from the left, overlays the (always centered) stage. */
#drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 25, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 45;
}
#drawer-backdrop.open { opacity: 1; pointer-events: auto; }
#roster-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 400px;
    max-width: 92vw;
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 50;
    padding: 18px 18px 40px 18px;
}
#roster-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.drawer-header h2 { font-size: 17px; margin: 0; }
#roster-drawer .databanner { border-radius: var(--r); margin-bottom: 16px; }

body:fullscreen #wheel-stage { width: min(640px, 78vw, 66vh); }
