:root {
    color-scheme:dark;
    --party-night:#020d0a;
    --party-panel:rgba(4,38,29,.91);
    --party-panel-strong:#062d22;
    --party-emerald:#0a674d;
    --party-mint:#a8f5c6;
    --party-ivory:#fff4d3;
    --party-gold:#f5c451;
    --party-gold-dark:#a86e13;
    --party-coral:#ff765f;
    --party-blue:#51b8ff;
    --party-shadow:0 22px 60px rgba(0,0,0,.48);
    --party-radius-lg:30px;
    --party-radius-md:20px;
    --party-border:rgba(245,196,81,.56);
    --wheel-frame-one:#f7dc83;
    --wheel-frame-two:#a76b13;
    --wheel-centre-one:#0c7255;
    --wheel-centre-two:#032b20;
    --wheel-pointer-one:#ffe477;
    --wheel-pointer-two:#bd7613;
    --wheel-segment-stroke:rgba(255,244,211,.62);
    --party-page-overlay-one:rgba(1,15,11,.78);
    --party-page-overlay-two:rgba(1,9,7,.94);
    --player-panel-one:rgba(4,38,29,.94);
    --player-panel-two:rgba(2,24,18,.97);
    --result-panel-one:rgba(5,44,33,.96);
    --result-panel-two:rgba(2,22,17,.98);
    --spin-button-one:#fff087;
    --spin-button-two:#efb32e;
    --spin-button-text:#17351e;
    --guess-red-one:#db493d;
    --guess-red-two:#791a19;
    --guess-black-one:#34434a;
    --guess-black-two:#0d1417;
    --guess-correct:#7df1ad;
    --guess-wrong:#ff8177;
    --result-accent:#f5c451;
}

* { box-sizing:border-box; }
html { min-width:320px; background:var(--party-night); }
body {
    min-width:320px;
    min-height:100vh;
    margin:0;
    overflow-x:hidden;
    color:var(--party-ivory);
    background:
        radial-gradient(circle at 18% 4%,rgba(56,213,163,.14),transparent 27rem),
        linear-gradient(var(--party-page-overlay-one),var(--party-page-overlay-two)),
        url('/assets/lobby/lobby-background-2560x1440.webp') center top/cover fixed;
    font-family:'Nunito Sans','Segoe UI',Arial,sans-serif;
}
body[data-theme="moonlit-mischief"] {
    --party-panel:rgba(17,28,57,.92);
    --party-panel-strong:#17284f;
    --party-emerald:#4951a8;
    --party-mint:#bed6ff;
    --party-border:rgba(170,193,255,.56);
    --wheel-frame-one:#ffe6a0;
    --wheel-frame-two:#7661c8;
    --wheel-centre-one:#5965c8;
    --wheel-centre-two:#171c47;
    --wheel-pointer-one:#f6e5ff;
    --wheel-pointer-two:#7764cf;
    --wheel-segment-stroke:rgba(221,230,255,.68);
    --party-page-overlay-one:rgba(7,12,34,.8);
    --party-page-overlay-two:rgba(3,7,25,.95);
    --player-panel-one:rgba(22,34,70,.95);
    --player-panel-two:rgba(9,14,41,.98);
    --result-panel-one:rgba(29,39,83,.96);
    --result-panel-two:rgba(10,15,43,.98);
    --spin-button-one:#f7e8ff;
    --spin-button-two:#9b8ae5;
    --spin-button-text:#18183f;
    --guess-red-one:#ce5361;
    --guess-red-two:#5a1b37;
    --guess-black-one:#3a4162;
    --guess-black-two:#11152c;
    --guess-correct:#8be9d1;
    --guess-wrong:#ff91ae;
    --result-accent:#d8c9ff;
}
body[data-theme="berry-squish"] {
    --party-panel:rgba(59,19,52,.92);
    --party-panel-strong:#55204e;
    --party-emerald:#a34079;
    --party-mint:#ffd1e6;
    --party-border:rgba(255,180,213,.58);
    --wheel-frame-one:#ffd875;
    --wheel-frame-two:#9b3a6e;
    --wheel-centre-one:#b74d84;
    --wheel-centre-two:#49173f;
    --wheel-pointer-one:#ffe28b;
    --wheel-pointer-two:#a43f77;
    --wheel-segment-stroke:rgba(255,224,239,.68);
    --party-page-overlay-one:rgba(39,8,35,.78);
    --party-page-overlay-two:rgba(20,4,18,.95);
    --player-panel-one:rgba(80,25,70,.95);
    --player-panel-two:rgba(40,10,35,.98);
    --result-panel-one:rgba(91,28,77,.96);
    --result-panel-two:rgba(42,10,36,.98);
    --spin-button-one:#ffe68b;
    --spin-button-two:#ef8dbc;
    --spin-button-text:#43152f;
    --guess-red-one:#e55c69;
    --guess-red-two:#741c42;
    --guess-black-one:#4c364c;
    --guess-black-two:#1e101d;
    --guess-correct:#8ff0b5;
    --guess-wrong:#ff8f9d;
    --result-accent:#ffbedb;
}

button,input,select { font:inherit; }
button,a,select { -webkit-tap-highlight-color:transparent; }
button { min-height:44px; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {
    outline:3px solid #fff2a8;
    outline-offset:3px;
}
[hidden] { display:none !important; }

.skip-link {
    position:fixed;
    z-index:99999;
    left:12px;
    top:8px;
    padding:10px 14px;
    border-radius:10px;
    color:#10291c;
    background:var(--party-gold);
    transform:translateY(-150%);
}
.skip-link:focus { transform:none; }
.visually-hidden {
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    padding:0 !important;
    margin:-1px !important;
    overflow:hidden !important;
    clip:rect(0,0,0,0) !important;
    white-space:nowrap !important;
    border:0 !important;
}

.party-header {
    position:sticky;
    z-index:1000;
    top:8px;
    display:grid;
    grid-template-columns:auto auto 1fr auto;
    width:min(calc(100% - 24px),1500px);
    min-height:72px;
    align-items:center;
    gap:16px;
    margin:8px auto 16px;
    padding:8px 12px;
    border:1px solid var(--party-border);
    border-radius:22px;
    background:rgba(3,35,26,.86);
    box-shadow:0 15px 40px rgba(0,0,0,.34),inset 0 1px rgba(168,245,198,.15);
    backdrop-filter:blur(18px);
}
.party-brand { display:block; width:134px; min-height:50px; }
.party-brand img { display:block; width:100%; height:50px; object-fit:contain; }
.party-title-block { display:grid; gap:1px; padding-left:14px; border-left:1px solid rgba(245,196,81,.3); }
.party-title-block span,.party-header-status span { color:var(--party-mint); font-size:10px; font-weight:900; letter-spacing:1.1px; }
.party-title-block strong { font-family:'Fredoka','Arial Rounded MT Bold',sans-serif; font-size:20px; }
.party-header-status { display:flex; justify-content:center; gap:12px; }
.party-header-status span { padding:8px 11px; border:1px solid rgba(168,245,198,.2); border-radius:999px; background:rgba(0,0,0,.16); }
.party-header-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
.party-header-actions > button,.party-menu > summary,.party-menu a,.party-menu button {
    min-height:44px;
    padding:10px 13px;
    border:1px solid var(--party-border);
    border-radius:13px;
    color:var(--party-ivory);
    background:rgba(7,72,53,.58);
    cursor:pointer;
    font-size:11px;
    font-weight:1000;
    text-decoration:none;
}
.theme-control { display:grid; gap:1px; }
.theme-control span { color:var(--party-mint); font-size:8px; font-weight:1000; letter-spacing:1px; }
.theme-control select {
    min-height:33px;
    max-width:150px;
    border:1px solid var(--party-border);
    border-radius:10px;
    color:var(--party-ivory);
    background:#082c22;
    font-size:10px;
    font-weight:900;
}
.party-menu { position:relative; }
.party-menu > summary { display:grid; place-items:center; list-style:none; }
.party-menu > summary::-webkit-details-marker { display:none; }
.party-menu > div {
    position:absolute;
    right:0;
    top:calc(100% + 9px);
    display:grid;
    width:230px;
    gap:7px;
    padding:10px;
    border:1px solid var(--party-border);
    border-radius:16px;
    background:#05271e;
    box-shadow:var(--party-shadow);
}
.party-menu a,.party-menu button { width:100%; text-align:left; }
.mobile-menu-control { display:none; gap:5px; color:var(--party-mint); font-size:9px; font-weight:1000; letter-spacing:1px; }
.mobile-menu-control select { width:100%; min-height:42px; background:#082c22; }
.danger-action { border-color:#ff8a7a !important; color:#ffd9d2 !important; background:#5d1717 !important; }

.party-shell { width:min(calc(100% - 24px),1500px); margin:0 auto; padding-bottom:calc(34px + env(safe-area-inset-bottom)); }
.setup-card,.party-stage {
    border:1px solid var(--party-border);
    border-radius:var(--party-radius-lg);
    background:linear-gradient(145deg,rgba(7,72,53,.92),rgba(3,27,21,.94));
    box-shadow:var(--party-shadow),inset 0 1px rgba(255,255,255,.08);
}
.setup-card {
    display:grid;
    grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr);
    min-height:min(680px,calc(100vh - 130px));
    overflow:hidden;
    background:
        radial-gradient(circle at 25% 30%,rgba(245,196,81,.14),transparent 32%),
        linear-gradient(100deg,rgba(4,56,42,.98),rgba(3,24,19,.94)),
        url('/assets/lobby/game-spin-the-wheel-1200x800.webp') center/cover;
}
.setup-intro { display:flex; flex-direction:column; justify-content:flex-end; padding:clamp(28px,6vw,84px); }
.eyebrow { color:var(--party-gold); font-size:11px; font-weight:1000; letter-spacing:1.7px; }
.setup-intro h1 {
    max-width:720px;
    margin:9px 0 14px;
    font-family:'Fredoka','Arial Rounded MT Bold',sans-serif;
    font-size:clamp(42px,6vw,78px);
    line-height:.95;
}
.setup-intro p { max-width:620px; margin:0; color:#d1e7da; font-size:clamp(15px,1.5vw,20px); line-height:1.5; }
.setup-form {
    align-self:center;
    display:grid;
    gap:15px;
    margin:24px;
    padding:clamp(22px,4vw,42px);
    border:1px solid rgba(245,196,81,.48);
    border-radius:26px;
    background:rgba(2,22,17,.88);
    backdrop-filter:blur(16px);
}
.setup-form label,.host-controls label { display:grid; gap:7px; color:var(--party-mint); font-size:11px; font-weight:1000; letter-spacing:.7px; }
input,select {
    min-width:0;
    min-height:46px;
    padding:10px 13px;
    border:1px solid rgba(168,245,198,.32);
    border-radius:12px;
    color:var(--party-ivory);
    background:rgba(0,0,0,.25);
}
.primary-action,.secondary-action,.room-toolbar button,.host-controls button,.result-action,.choice-button,.guess-button,.continue-button {
    border:1px solid #ffe5a1;
    border-radius:14px;
    color:#15321e;
    background:linear-gradient(150deg,#ffe070,var(--party-gold));
    box-shadow:0 10px 26px rgba(245,196,81,.18);
    cursor:pointer;
    font-weight:1000;
}
.secondary-action { color:var(--party-ivory); background:linear-gradient(145deg,var(--party-emerald),#064230); }
.join-room-box { display:grid; gap:8px; padding:14px; border:1px dashed var(--party-border); border-radius:15px; text-align:center; }
.join-room-box span { color:var(--party-mint); font-size:10px; font-weight:900; }
.join-room-box strong { color:var(--party-gold); font-size:26px; letter-spacing:3px; }

.party-stage { padding:16px; }
.room-toolbar {
    display:grid;
    grid-template-columns:auto minmax(280px,1fr) auto;
    align-items:end;
    gap:12px;
    margin-bottom:16px;
    padding:12px 14px;
    border:1px solid rgba(168,245,198,.25);
    border-radius:18px;
    background:rgba(1,22,16,.72);
}
.room-code-block,.invite-field { display:grid; gap:4px; }
.room-code-block span,.invite-field span { color:var(--party-mint); font-size:9px; font-weight:1000; letter-spacing:1.2px; }
.room-code-block strong { color:var(--party-gold); font-size:25px; letter-spacing:3px; }
.invite-field input { min-height:42px; }
.room-toolbar button { min-width:120px; }

.party-game-layout {
    display:grid;
    grid-template-columns:minmax(210px,250px) minmax(440px,1fr) minmax(260px,330px);
    align-items:start;
    gap:16px;
}
.squishy-panel {
    border:1px solid rgba(168,245,198,.3);
    border-radius:var(--party-radius-md);
    background:linear-gradient(145deg,var(--party-panel),rgba(2,24,18,.96));
    box-shadow:inset 0 1px rgba(255,255,255,.06),0 14px 34px rgba(0,0,0,.24);
}
.players-panel,.result-panel { min-height:540px; padding:16px; }
.players-panel { background:linear-gradient(145deg,var(--player-panel-one),var(--player-panel-two)); }
.result-panel { background:linear-gradient(145deg,var(--result-panel-one),var(--result-panel-two)); }
.panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.panel-heading h2,.wheel-heading h2,.result-panel h2,.recent-panel h2,.rules-dialog h2 {
    margin:3px 0 0;
    font-family:'Fredoka','Arial Rounded MT Bold',sans-serif;
}
.panel-heading h2 { font-size:25px; }
.panel-heading > strong { color:var(--party-gold); }
.player-list { display:grid; gap:8px; margin:15px 0; padding:0; list-style:none; }
.player-row {
    display:grid;
    grid-template-columns:13px minmax(0,1fr) auto;
    align-items:center;
    gap:9px;
    min-height:48px;
    padding:8px 9px;
    border:1px solid color-mix(in srgb,var(--player-color) 40%,transparent);
    border-radius:13px;
    background:linear-gradient(90deg,color-mix(in srgb,var(--player-color) 13%,transparent),rgba(0,0,0,.08));
}
.player-dot { width:12px; height:12px; border:2px solid #fff9; border-radius:50%; background:var(--player-color); box-shadow:0 0 11px var(--player-color); }
.player-copy { display:grid; min-width:0; gap:2px; }
.player-name { overflow:hidden; color:var(--player-color); font-weight:1000; text-overflow:ellipsis; white-space:nowrap; }
.player-badges { color:#b9d1c4; font-size:8px; font-weight:900; letter-spacing:.8px; }
.player-tools { display:flex; gap:4px; }
.player-tools button { min-width:44px; min-height:44px; padding:6px; border:1px solid rgba(255,255,255,.22); border-radius:9px; color:var(--party-ivory); background:#102f25; cursor:pointer; }
.player-row.disconnected { opacity:.58; }
.host-controls { display:grid; gap:10px; margin-top:15px; padding-top:14px; border-top:1px solid rgba(168,245,198,.18); }
.host-controls h3 { margin:0; color:var(--party-gold); font-size:12px; text-transform:uppercase; letter-spacing:1px; }
.host-controls form { display:grid; gap:7px; }
.host-controls form > div { display:grid; grid-template-columns:1fr auto; gap:6px; }
.host-controls form button { padding:6px 10px; }
.host-action-grid { display:grid; grid-template-columns:1fr auto; gap:7px; }
.host-action-grid button { padding:8px 11px; }
button:disabled { cursor:not-allowed !important; opacity:.42; filter:saturate(.55); box-shadow:none !important; }

.wheel-panel { min-width:0; text-align:center; }
.wheel-heading { min-height:96px; }
.wheel-heading h2 { margin:5px 0 4px; font-size:clamp(26px,3vw,42px); }
.wheel-heading p { margin:0; color:#bdd5c7; font-size:12px; }
.phase-badge { display:inline-grid; min-height:28px; place-items:center; padding:4px 12px; border:1px solid var(--party-border); border-radius:999px; color:var(--party-gold); background:rgba(0,0,0,.24); font-size:10px; font-weight:1000; letter-spacing:1px; }
.wheel-viewport { position:relative; width:min(100%,690px); margin:0 auto; padding:28px; }
.wheel-frame {
    position:relative;
    width:100%;
    aspect-ratio:1;
    padding:clamp(12px,2vw,22px);
    border:5px solid var(--wheel-frame-one);
    border-radius:50%;
    background:repeating-conic-gradient(from 0deg,var(--wheel-frame-two) 0 5deg,var(--wheel-frame-one) 5deg 9deg);
    box-shadow:inset 0 0 0 6px #3b2508,inset 0 0 26px #000c,0 24px 55px #000a,0 0 28px color-mix(in srgb,var(--party-gold) 25%,transparent);
}
.wheel-rotor { width:100%; height:100%; transform:rotate(0deg); transform-origin:50% 50%; will-change:transform; }
.wheel-rotor svg { display:block; width:100%; height:100%; overflow:visible; filter:drop-shadow(0 7px 10px rgba(0,0,0,.48)); }
.wheel-segment { stroke:var(--wheel-segment-stroke); stroke-width:1.4; }
.wheel-segment.selected { filter:brightness(1.35) drop-shadow(0 0 8px #fff1a8); stroke:#fff4c3; stroke-width:4; }
.wheel-label { fill:#fff9e9; font-family:'Nunito Sans','Segoe UI',sans-serif; font-weight:1000; paint-order:stroke; stroke:rgba(0,0,0,.72); stroke-width:2.5px; stroke-linejoin:round; text-anchor:middle; }
.wheel-centre {
    position:absolute;
    z-index:3;
    inset:38%;
    display:grid;
    place-content:center;
    border:5px solid var(--wheel-frame-one);
    border-radius:50%;
    color:var(--party-ivory);
    background:radial-gradient(circle at 35% 25%,var(--wheel-centre-one),var(--wheel-centre-two));
    box-shadow:inset 0 0 17px #0007,0 7px 24px #0008;
    pointer-events:none;
}
.wheel-centre span { color:var(--party-mint); font-size:clamp(7px,1vw,12px); font-weight:900; letter-spacing:1px; }
.wheel-centre strong { color:var(--party-gold); font-family:'Fredoka','Arial Rounded MT Bold',sans-serif; font-size:clamp(16px,3vw,38px); line-height:.8; }
.wheel-pointer {
    position:absolute;
    z-index:10;
    left:50%;
    top:7px;
    width:54px;
    height:70px;
    transform:translateX(-50%);
    filter:drop-shadow(0 7px 7px #000a);
}
.wheel-pointer::before { content:''; position:absolute; inset:0 7px 15px; border:4px solid var(--wheel-pointer-one); border-radius:50% 50% 46% 46%; background:linear-gradient(145deg,var(--wheel-pointer-one),var(--wheel-pointer-two)); }
.wheel-pointer::after { content:''; position:absolute; left:17px; bottom:0; border:10px solid transparent; border-top:25px solid #ffe27a; }
.wheel-pointer span { position:absolute; z-index:2; left:22px; top:18px; width:10px; height:10px; border-radius:50%; background:#5d3106; }
.spin-button {
    display:grid;
    grid-template-columns:auto auto;
    grid-template-rows:auto auto;
    min-width:min(320px,92%);
    min-height:68px;
    align-items:center;
    justify-content:center;
    gap:0 10px;
    margin:4px auto 0;
    padding:8px 26px;
    border:2px solid #fff0ac;
    border-radius:22px;
    color:var(--spin-button-text);
    background:linear-gradient(150deg,var(--spin-button-one),var(--spin-button-two));
    box-shadow:0 14px 32px rgba(245,196,81,.28),inset 0 2px #fff9;
    cursor:pointer;
}
.spin-button > span { grid-row:1 / 3; font-size:27px; }
.spin-button strong { align-self:end; font-family:'Fredoka','Arial Rounded MT Bold',sans-serif; font-size:26px; line-height:1; }
.spin-button small { align-self:start; font-size:8px; font-weight:1000; letter-spacing:.7px; }
.wheel-panel.is-spinning .wheel-pointer { animation:pointer-tick .18s ease-in-out infinite alternate; }
@keyframes pointer-tick { to { transform:translateX(-50%) rotate(4deg); } }

.result-panel { border-color:color-mix(in srgb,var(--result-accent) 55%,transparent); }
.result-panel-content { display:flex; min-height:506px; flex-direction:column; align-items:stretch; justify-content:center; text-align:center; }
.result-panel h2 { margin:9px 0 10px; color:var(--result-accent); font-size:clamp(27px,3vw,42px); line-height:1; }
.result-panel p { margin:0; color:#c9ded2; line-height:1.5; }
.result-kicker { color:var(--player-color,var(--party-gold)); font-size:12px; font-weight:1000; letter-spacing:1.3px; }
.result-target { margin:17px 0 5px; color:var(--player-color,var(--party-gold)); font-size:clamp(27px,3.4vw,47px); font-weight:1000; line-height:.95; }
.result-declaration { margin:6px 0 18px !important; color:var(--party-ivory) !important; font-weight:900; }
.action-options { display:grid; gap:8px; margin-top:18px; }
.choice-button,.guess-button,.continue-button { width:100%; min-height:50px; padding:10px 13px; }
.choice-button { color:var(--party-ivory); border-color:var(--player-color); background:linear-gradient(120deg,color-mix(in srgb,var(--player-color) 55%,#071c15),#071c15); }
.guess-options { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:18px; }
.guess-button[data-guess="RED"] { color:#fff; border-color:#ff9a90; background:linear-gradient(145deg,var(--guess-red-one),var(--guess-red-two)); }
.guess-button[data-guess="BLACK"] { color:#fff; border-color:#adbec5; background:linear-gradient(145deg,var(--guess-black-one),var(--guess-black-two)); }
.guess-secret {
    margin:18px 0 !important;
    padding:20px 10px;
    border:2px solid currentColor;
    border-radius:18px;
    font-size:clamp(32px,5vw,58px);
    font-weight:1000;
}
.guess-secret.red { color:#ff8075; background:#591817; }
.guess-secret.black { color:#edf5f5; background:#0a1012; }
.guess-timer { display:grid; gap:2px; margin:13px auto; color:var(--party-mint); font-size:11px; font-weight:1000; letter-spacing:1px; }
.guess-timer strong { color:var(--party-gold); font-size:42px; }
.result-panel.result-correct { --result-accent:var(--guess-correct); }
.result-panel.result-wrong { --result-accent:var(--guess-wrong); border-color:var(--guess-wrong); }
.result-panel.result-choose { --result-accent:#8bd7ff; }

.recent-panel { margin-top:16px; padding:14px 16px 16px; }
.recent-results { display:flex; gap:8px; width:100%; max-width:100%; margin:12px 0 0; padding:0 0 3px; overflow-x:auto; list-style:none; scrollbar-width:thin; }
.recent-result {
    --history-color:var(--party-gold);
    display:grid;
    flex:0 0 150px;
    min-height:70px;
    align-content:center;
    gap:4px;
    padding:10px 12px;
    border:1px solid color-mix(in srgb,var(--history-color) 48%,transparent);
    border-radius:14px;
    background:linear-gradient(145deg,color-mix(in srgb,var(--history-color) 12%,transparent),rgba(0,0,0,.18));
}
.recent-result strong { overflow:hidden; color:var(--history-color); text-overflow:ellipsis; white-space:nowrap; }
.recent-result span { color:#c7dbcf; font-size:10px; font-weight:900; }
.empty-result { color:#9fb8aa; font-size:12px; }
.status-message { min-height:22px; margin:10px 4px 0; color:var(--party-mint); text-align:center; }
.status-message.error { color:#ff9b91; }

.rules-dialog {
    width:min(680px,calc(100% - 24px));
    max-height:min(760px,calc(100vh - 24px));
    padding:0;
    overflow:auto;
    border:1px solid var(--party-border);
    border-radius:26px;
    color:var(--party-ivory);
    background:linear-gradient(145deg,#073a2c,#031d16);
    box-shadow:0 30px 100px #000d;
}
.rules-dialog::backdrop { background:rgba(0,8,6,.82); backdrop-filter:blur(5px); }
.rules-dialog form { position:relative; padding:clamp(24px,5vw,48px); }
.rules-dialog h2 { margin:7px 0 18px; color:var(--party-gold); font-size:34px; }
.rules-dialog ol { display:grid; gap:10px; padding-left:22px; color:#d1e3d8; line-height:1.5; }
.rules-dialog strong { color:var(--party-ivory); }
.dialog-close { position:absolute; right:13px; top:13px; width:44px; padding:0; border:1px solid rgba(255,255,255,.22); border-radius:13px; color:#fff; background:#102f25; cursor:pointer; font-size:26px; }
.responsible-note { padding:12px 14px; border-left:3px solid var(--party-gold); border-radius:0 12px 12px 0; color:#ffe9ad; background:#0003; }
.dialog-done { width:100%; min-height:50px; }
.toast { position:fixed; z-index:20000; right:16px; bottom:calc(16px + env(safe-area-inset-bottom)); width:min(350px,calc(100vw - 32px)); padding:13px 16px; border:1px solid var(--party-border); border-radius:15px; color:var(--party-ivory); background:#05271ef2; box-shadow:var(--party-shadow); font-weight:900; }
footer { padding:20px 16px 28px; color:#9db8aa; font-size:11px; text-align:center; }
.choose-spinner-button,.recent-results-button{width:100%;min-height:42px;margin-top:9px;border:1px solid var(--party-border);border-radius:13px;color:var(--party-gold);background:#041f18;font-weight:1000;cursor:pointer}
.recent-panel{min-width:0;max-width:100%;overflow:hidden}.recent-results-popup{display:grid;max-height:min(55vh,460px);overflow-y:auto;overflow-x:hidden}.recent-results-popup .recent-result{width:100%;min-height:58px;box-sizing:border-box}
.compact-dialog{width:min(560px,calc(100% - 24px))}
body.wheel-spinning-modal .wheel-panel{position:fixed;z-index:19000;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:clamp(12px,3vw,30px);border:0;border-radius:0;background:radial-gradient(circle,#0d513c,#01120d 72%)}
body.wheel-spinning-modal .wheel-panel .panel-heading,body.wheel-spinning-modal .wheel-panel .spin-button,body.wheel-spinning-modal .wheel-panel .choose-spinner-button{display:none}
body.wheel-spinning-modal .wheel-viewport{width:min(88vmin,720px);height:min(88vmin,720px)}

@media (max-width:1160px) {
    .party-header { grid-template-columns:auto 1fr auto; }
    .party-title-block { display:none; }
    .party-game-layout { grid-template-columns:220px minmax(390px,1fr); }
    .result-panel { grid-column:1 / -1; min-height:0; }
    .result-panel-content { min-height:260px; }
}

@media (max-width:820px) {
    body { background-attachment:scroll; }
    html,body{max-width:100%;overflow-x:hidden}
    .page-shell,.party-stage,.party-game-layout,.recent-panel{min-width:0;max-width:100%;box-sizing:border-box}
    body.wheel-action-modal .result-panel{position:fixed;z-index:18500;inset:10px;display:flex;align-items:center;justify-content:center;overflow:auto;border-radius:22px;background:linear-gradient(145deg,#073a2cf7,#02150ff7);box-shadow:0 22px 80px #000e}
    body.wheel-action-modal .result-panel-content{width:min(520px,100%);min-height:0;padding:22px 16px}
    .party-header {
        top:4px;
        grid-template-columns:minmax(105px,1fr) auto;
        gap:7px;
        min-height:62px;
        margin-top:4px;
        padding:6px 7px 6px 10px;
        border-radius:18px;
    }
    .party-brand { width:min(142px,37vw); min-height:46px; }
    .party-brand img { height:46px; }
    .party-header-status { display:none; }
    .party-header-actions { gap:5px; }
    .party-header-actions > button:not(#rulesButton),.theme-control { display:none; }
    .party-header-actions > button,.party-menu > summary { min-height:42px; padding:7px 9px; font-size:9px; }
    .party-menu > div { position:fixed; right:12px; top:72px; width:min(260px,calc(100vw - 24px)); }
    .party-menu > div::before { content:'PARTY WHEEL'; padding:6px; color:var(--party-gold); font-size:11px; font-weight:1000; }
    .mobile-menu-control { display:grid; }
    .party-menu > div #menuCopyLinkButton::after { content:''; }
    .party-shell { width:min(calc(100% - 16px),1500px); }
    .setup-card { grid-template-columns:1fr; min-height:calc(100svh - 92px); }
    .setup-intro { justify-content:flex-end; min-height:330px; padding:24px 20px; }
    .setup-intro h1 { font-size:clamp(38px,12vw,60px); }
    .setup-form { margin:0 12px 14px; padding:19px; }
    .party-stage { padding:8px; border-radius:22px; }
    .room-toolbar { grid-template-columns:auto 1fr; gap:8px; padding:9px; }
    .invite-field { grid-column:1 / -1; grid-row:2; }
    .room-toolbar button { min-width:105px; }
    .party-game-layout { display:flex; flex-direction:column; gap:12px; }
    .wheel-panel { order:1; width:100%; }
    .result-panel { order:2; width:100%; min-height:0; }
    .players-panel { order:3; width:100%; min-height:0; }
    .party-game-layout.guess-active .result-panel { order:0; }
    .party-game-layout.guess-active .wheel-panel { display:none; }
    .wheel-heading { min-height:82px; }
    .wheel-heading h2 { font-size:28px; }
    .wheel-viewport { width:min(100%,590px); padding:23px; }
    .wheel-pointer { top:4px; width:46px; height:61px; }
    .wheel-pointer::after { left:14px; }
    .spin-button { min-width:min(310px,94%); }
    .result-panel-content { min-height:245px; }
    .player-list { grid-template-columns:1fr 1fr; }
    .host-controls form > div { grid-template-columns:1fr auto; }
    .recent-panel { padding-inline:12px; }
}

@media (max-width:480px) {
    .party-header-actions #rulesButton { display:none; }
    .party-brand { width:124px; }
    .party-menu > summary { font-size:0; width:44px; padding:0; }
    .party-menu > summary::before { content:'☰'; font-size:19px; }
    .room-toolbar { grid-template-columns:minmax(0,1fr) auto; }
    .room-code-block strong { font-size:21px; }
    .room-toolbar button { min-width:88px; padding:8px; font-size:10px; }
    .wheel-heading h2 { font-size:24px; }
    .wheel-heading p { padding-inline:8px; font-size:11px; }
    .wheel-viewport { padding:21px 12px 14px; }
    .wheel-frame { border-width:4px; }
    .wheel-pointer { top:0; width:42px; height:57px; }
    .wheel-pointer::after { left:12px; }
    .spin-button { min-height:62px; border-radius:19px; }
    .spin-button strong { font-size:23px; }
    .player-list { grid-template-columns:1fr; }
    .player-row { min-height:44px; }
    .result-panel,.players-panel { padding:13px; }
    .result-panel-content { min-height:230px; }
    .guess-secret { font-size:38px; }
    .recent-result { flex-basis:132px; }
}

@media (prefers-reduced-motion:reduce) {
    *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
    .wheel-rotor { will-change:auto; }
}
