/* ============================================================
   Bopster Party 3.0 — full game-show redesign
   Bold Kahoot-style energy: chunky controls, vivid phases,
   draining timer, streaks, podium ceremony.
   ============================================================ */
:root {
    color-scheme: dark;
    --party-bg: #0a0518;
    --party-panel: rgba(26, 18, 52, .82);
    --party-surface: rgba(255, 255, 255, .05);
    --party-surface-hover: rgba(255, 255, 255, .09);
    --party-border: rgba(255, 255, 255, .12);
    --party-border-strong: rgba(255, 255, 255, .22);
    --party-text: #f8f7ff;
    --party-muted: rgba(233, 228, 252, .68);
    --party-subtle: rgba(233, 228, 252, .45);
    --party-accent: #4de8ff;
    --party-accent-soft: rgba(77, 232, 255, .13);
    --party-violet: #9b5cff;
    --party-pink: #ff4fa3;
    --party-green: #55e6a5;
    --party-yellow: #ffd166;
    --party-red: #ff5d7e;
    --party-orange: #ff9a3d;
    --party-game-gradient: linear-gradient(135deg, #9b5cff 0%, #4de8ff 100%);
    --party-hot-gradient: linear-gradient(135deg, #ff4fa3 0%, #9b5cff 100%);
    --party-radius: 22px;
    --party-radius-small: 14px;
    --party-shadow: 0 24px 60px rgba(3, 0, 12, .5);
    --party-font-display: "Baloo 2", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --party-font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.party-page {
    margin: 0;
    min-height: 100vh;
    color: var(--party-text);
    font-family: var(--party-font-body);
    background:
        radial-gradient(circle at 10% -5%, rgba(155, 92, 255, .30), transparent 34rem),
        radial-gradient(circle at 95% 8%, rgba(77, 232, 255, .22), transparent 36rem),
        radial-gradient(circle at 50% 105%, rgba(255, 79, 163, .18), transparent 40rem),
        linear-gradient(160deg, #0a0518 0%, #160d33 52%, #0b071f 100%);
    overflow-x: hidden;
    transition: background 1s ease;
}
/* faint grid */
body.party-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 72%);
}
/* floating music notes */
body.party-page::after {
    content: "♪   ♫   ✦   ♪";
    position: fixed;
    inset: 14% auto auto 4%;
    z-index: -1;
    white-space: pre;
    letter-spacing: 2.4rem;
    color: rgba(155, 92, 255, .17);
    font-size: clamp(2.8rem, 8vw, 7rem);
    animation: partyNotesFloat 9s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes partyNotesFloat { to { transform: translate3d(30px, -32px, 0) rotate(5deg); color: rgba(77, 232, 255, .15); } }

/* phase-tinted ambience while a game runs */
body[data-party-phase="countdown"] { background: radial-gradient(circle at 50% 0%, rgba(255, 209, 102, .16), transparent 36rem), radial-gradient(circle at 10% -5%, rgba(155,92,255,.30), transparent 34rem), radial-gradient(circle at 95% 8%, rgba(77,232,255,.22), transparent 36rem), linear-gradient(160deg, #0a0518, #1a0e38 55%, #0b071f); }
body[data-party-phase="year_guessing"], body[data-party-phase="bonus_guessing"] { background: radial-gradient(circle at 50% -8%, rgba(77, 232, 255, .20), transparent 36rem), radial-gradient(circle at 8% 100%, rgba(155, 92, 255, .24), transparent 36rem), radial-gradient(circle at 96% 90%, rgba(255, 79, 163, .16), transparent 34rem), linear-gradient(160deg, #0c0620, #150c34 55%, #0a0620); }
body[data-party-phase="reveal"] { background: radial-gradient(circle at 50% -6%, rgba(255, 209, 102, .22), transparent 38rem), radial-gradient(circle at 10% 100%, rgba(85, 230, 165, .14), transparent 34rem), linear-gradient(160deg, #0d0722, #190f3a 55%, #0b0722); }

button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }
.party-hidden { display: none !important; }

.party-shell {
    width: min(1160px, calc(100% - 28px));
    margin: 0 auto;
    padding: 24px 0 60px;
    position: relative;
    z-index: 1;
}
.party-ambient { display: none; }
.party-glass {
    background: linear-gradient(150deg, rgba(34, 24, 66, .88), rgba(15, 10, 34, .86));
    border: 1px solid var(--party-border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07), var(--party-shadow);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
}
.party-surface {
    background: var(--party-surface);
    border: 1px solid rgba(255,255,255,.08);
}

/* ============ Buttons — chunky arcade feel ============ */
.party-primary, .party-secondary, .party-danger {
    min-height: 50px;
    border-radius: 14px;
    padding: 0 20px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-weight: 800;
    font-size: .97rem;
    letter-spacing: .01em;
    transition: transform .12s ease, box-shadow .12s ease, background .16s ease, border-color .16s ease, filter .16s ease;
}
.party-primary {
    color: #fff;
    background: var(--party-game-gradient);
    box-shadow: 0 5px 0 rgba(23, 8, 54, .85), 0 16px 34px rgba(124, 92, 255, .28);
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.party-primary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 7px 0 rgba(23, 8, 54, .85), 0 22px 42px rgba(124, 92, 255, .36); }
.party-primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 rgba(23, 8, 54, .85), 0 8px 18px rgba(124, 92, 255, .25); }
.party-secondary {
    color: var(--party-text);
    background: rgba(255,255,255,.07);
    border-color: var(--party-border);
    box-shadow: 0 4px 0 rgba(0, 0, 0, .3);
}
.party-secondary:hover:not(:disabled) { background: rgba(255,255,255,.11); border-color: var(--party-border-strong); transform: translateY(-1px); }
.party-secondary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.party-danger {
    color: #ffdce5;
    background: rgba(255, 93, 126, .13);
    border-color: rgba(255, 93, 126, .32);
    box-shadow: 0 4px 0 rgba(60, 4, 20, .5);
}
.party-danger:hover:not(:disabled) { background: rgba(255, 93, 126, .2); }
.party-danger:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(60,4,20,.5); }
.party-wide { width: 100%; }
.party-icon-button {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    border: 1px solid var(--party-border);
    background: rgba(255,255,255,.06);
    color: var(--party-muted);
    display: inline-grid;
    place-items: center;
    padding: 0;
    transition: .15s ease;
}
.party-icon-button:hover { color: #fff; background: rgba(255,255,255,.11); transform: translateY(-1px); }
.party-icon-button svg, .party-primary svg, .party-secondary svg, .party-danger svg { width: 18px; height: 18px; }

/* ============ Home ============ */
.party-home {
    max-width: 920px;
    margin: 34px auto 0;
    border-radius: 28px;
    padding: clamp(26px, 5vw, 46px);
    position: relative;
    overflow: hidden;
}
.party-home::before {
    content: "🎵";
    position: absolute;
    right: -14px;
    top: -30px;
    font-size: 9rem;
    opacity: .07;
    transform: rotate(14deg);
    pointer-events: none;
}
.party-home-main { position: relative; }
.party-home-intro { min-width: 0; display: flex; align-items: flex-start; gap: 20px; position: relative; z-index: 1; }
.party-home-icon {
    width: 62px;
    height: 62px;
    border-radius: 19px;
    display: grid;
    place-items: center;
    flex: none;
    color: #fff;
    background: var(--party-game-gradient);
    box-shadow: 0 12px 30px rgba(124, 92, 255, .4), inset 0 1px 0 rgba(255,255,255,.3);
    animation: partyIconBob 3.4s ease-in-out infinite;
}
@keyframes partyIconBob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.party-home-icon svg { width: 30px; height: 30px; }
.party-home-copy h1 {
    margin: 0;
    max-width: 640px;
    font-family: var(--party-font-display);
    font-size: clamp(2rem, 4.6vw, 3.1rem);
    line-height: 1.02;
    letter-spacing: -.02em;
    font-weight: 800;
    background: linear-gradient(100deg, #fff 20%, #c9b8ff 55%, #8fe9ff 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.party-home-copy p {
    margin: 12px 0 0;
    max-width: 640px;
    color: var(--party-muted);
    font-size: 1.02rem;
    line-height: 1.6;
}
.party-home-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 24px; position: relative; }
.party-home-action {
    width: 100%;
    min-height: 92px;
    border-radius: 18px;
    padding: 15px 18px;
    border: 1px solid var(--party-border);
    color: var(--party-text);
    background: rgba(255,255,255,.045);
    box-shadow: 0 5px 0 rgba(0,0,0,.28);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    text-align: left;
    transition: .16s ease;
}
.party-home-action:hover { background: var(--party-surface-hover); border-color: var(--party-border-strong); transform: translateY(-2px); }
.party-home-action:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.28); }
.party-home-action.is-primary {
    background: linear-gradient(120deg, rgba(155, 92, 255, .24), rgba(77, 232, 255, .16));
    border-color: rgba(155, 92, 255, .4);
}
.party-home-action-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--party-game-gradient);
    box-shadow: 0 6px 16px rgba(124, 92, 255, .35);
}
.party-home-action-icon svg { width: 22px; height: 22px; }
.party-home-action strong { display: block; font-size: 1.08rem; font-weight: 800; }
.party-home-action small { display: block; margin-top: 4px; color: var(--party-muted); font-size: .85rem; line-height: 1.35; }
.party-home-action > svg { width: 19px; color: var(--party-subtle); }
.party-home-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.party-home-notes span { display: inline-flex; align-items: center; gap: 8px; color: var(--party-muted); font-size: .83rem; font-weight: 600; }
.party-home-notes svg { width: 16px; height: 16px; color: var(--party-accent); }
.party-rules-teaser {
    width: 100%;
    min-height: 64px;
    margin-top: 14px;
    padding: 10px 13px;
    border: 1px solid rgba(77,232,255,.2);
    border-radius: 16px;
    color: var(--party-text);
    background: linear-gradient(100deg, rgba(77,232,255,.07), rgba(155,92,255,.08));
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.party-rules-teaser:hover { transform: translateY(-2px); border-color: rgba(77,232,255,.42); background: linear-gradient(100deg, rgba(77,232,255,.12), rgba(155,92,255,.13)); }
.party-rules-teaser-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #bff5ff; background: rgba(77,232,255,.12); }
.party-rules-teaser-icon svg { width: 19px; height: 19px; }
.party-rules-teaser strong, .party-rules-teaser small { display: block; }
.party-rules-teaser strong { font-size: .92rem; }
.party-rules-teaser small { margin-top: 2px; color: var(--party-muted); font-size: .75rem; line-height: 1.35; }
.party-rules-teaser-cta { display: inline-flex; align-items: center; gap: 7px; color: #9eefff; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.party-rules-teaser-cta svg { width: 15px; height: 15px; transition: transform .16s ease; }
.party-rules-teaser:hover .party-rules-teaser-cta svg { transform: translateX(3px); }

/* ============ Game rules ============ */
.party-rules-page { width: min(1060px,100%); margin: 28px auto; border-radius: 28px; overflow: hidden; }
.party-rules-hero {
    min-height: 290px;
    padding: clamp(28px, 5vw, 52px);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0,1.2fr) minmax(260px,.8fr);
    align-items: end;
    gap: clamp(26px, 5vw, 58px);
    isolation: isolate;
    background:
        radial-gradient(circle at 88% 16%, rgba(77,232,255,.18), transparent 30%),
        radial-gradient(circle at 8% 95%, rgba(155,92,255,.26), transparent 34%),
        linear-gradient(135deg, rgba(23,13,52,.98), rgba(13,8,34,.96));
    border-bottom: 1px solid var(--party-border);
}
.party-rules-hero::after { content: ""; position: absolute; z-index: -1; width: 310px; height: 310px; right: -120px; top: -145px; border: 54px solid rgba(255,255,255,.025); border-radius: 50%; }
.party-rules-back { position: absolute; top: 22px; left: 22px; z-index: 2; }
.party-rules-hero-copy { padding-top: 36px; }
.party-rules-hero-copy h1 { margin: 10px 0 0; max-width: 660px; font-family: var(--party-font-display); font-size: clamp(2.3rem, 5vw, 4.15rem); font-weight: 800; line-height: .98; letter-spacing: -.035em; background: linear-gradient(100deg, #fff 15%, #cfbfff 58%, #83e9ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.party-rules-hero-copy > p { max-width: 680px; margin: 17px 0 0; color: var(--party-muted); font-size: clamp(.94rem, 1.7vw, 1.08rem); line-height: 1.65; }
.party-rules-hero-side { min-width: 0; display: grid; align-self: stretch; align-content: end; position: relative; z-index: 0; padding-top: 138px; }
.party-rules-hero-art { width: calc(100% + 72px); height: 248px; position: absolute; right: -36px; top: -26px; z-index: 0; display: block; object-fit: cover; object-position: 61% center; border-radius: 28px; opacity: .92; box-shadow: inset 0 0 42px #0d0822; }
.party-rules-score-preview { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 10px; position: relative; z-index: 1; border: 1px solid var(--party-border); border-radius: 20px; background: rgba(5,2,18,.72); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 14px 30px rgba(3,1,15,.28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.party-rules-score-preview span { min-width: 0; min-height: 88px; padding: 12px 6px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--party-muted); background: rgba(255,255,255,.04); text-align: center; font-size: .65rem; font-weight: 800; line-height: 1.2; }
.party-rules-score-preview b { margin-bottom: 6px; font-family: var(--party-font-display); color: #fff; font-size: clamp(1.1rem, 2vw, 1.55rem); }
.party-rules-content { padding: clamp(25px, 5vw, 52px); display: flex; flex-direction: column; }
.party-rules-round { order: 1; }
.party-rules-section.party-rules-modes { order: 2; }
.party-rules-scoring { order: 3; }
.party-rules-remember { order: 4; }
.party-rules-xp { order: 5; }
.party-rules-bop { order: 6; }
.party-rules-cta { order: 7; }
.party-rules-section + .party-rules-section { margin-top: clamp(42px, 7vw, 72px); }
.party-rules-section-head { margin-bottom: 22px; display: grid; grid-template-columns: 46px minmax(0,1fr); align-items: start; gap: 14px; }
.party-rules-section-head > span { width: 42px; height: 42px; border: 1px solid rgba(77,232,255,.24); border-radius: 13px; display: grid; place-items: center; color: #9feeff; background: rgba(77,232,255,.08); font-family: var(--party-font-display); font-size: .85rem; font-weight: 800; }
.party-rules-section-head h2 { margin: 0; font-family: var(--party-font-display); font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.1; }
.party-rules-section-head p { margin: 7px 0 0; max-width: 700px; color: var(--party-muted); font-size: .9rem; line-height: 1.55; }
.party-rules-flow { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; }
.party-rules-flow article { min-height: 205px; padding: 22px 18px 18px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.09); border-radius: 18px; background: linear-gradient(150deg, rgba(255,255,255,.065), rgba(255,255,255,.025)); transition: transform .16s ease, border-color .16s ease; }
.party-rules-flow article:hover { transform: translateY(-3px); border-color: rgba(77,232,255,.3); }
.party-rules-flow article > svg { width: 27px; height: 27px; color: var(--party-accent); }
.party-rules-flow-number { position: absolute; right: 12px; top: 8px; color: rgba(255,255,255,.07); font-family: var(--party-font-display); font-size: 3.4rem; font-weight: 800; line-height: 1; }
.party-rules-flow h3 { margin: 29px 0 0; font-size: .98rem; }
.party-rules-flow p { margin: 8px 0 0; color: var(--party-muted); font-size: .78rem; line-height: 1.5; }
.party-rules-score-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.party-rules-score-card { min-width: 0; padding: clamp(18px, 3vw, 25px); border: 1px solid rgba(255,255,255,.1); border-radius: 22px; background: linear-gradient(150deg, rgba(255,255,255,.065), rgba(255,255,255,.025)); }
.party-rules-score-card.is-year { box-shadow: inset 0 3px 0 rgba(77,232,255,.55); }
.party-rules-score-card.is-bonus { box-shadow: inset 0 3px 0 rgba(255,154,61,.65); }
.party-rules-score-card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.party-rules-score-card-head > span { width: 47px; height: 47px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #c6f7ff; background: rgba(77,232,255,.12); }
.party-rules-score-card.is-bonus .party-rules-score-card-head > span { color: #ffd2ab; background: rgba(255,154,61,.13); }
.party-rules-score-card-head svg { width: 21px; height: 21px; }
.party-rules-score-card-head h3 { margin: 0; font-family: var(--party-font-display); font-size: 1.18rem; }
.party-rules-score-card-head small { display: block; margin-top: 3px; color: var(--party-muted); font-size: .72rem; }
.party-rules-score-card-head small b { color: #fff; }
.party-rules-score-card dl { margin: 0; display: grid; gap: 7px; }
.party-rules-score-card dl > div { min-height: 64px; padding: 10px 12px; border-radius: 13px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; background: rgba(2,0,12,.25); }
.party-rules-score-card dt strong, .party-rules-score-card dt small { display: block; }
.party-rules-score-card dt strong { font-size: .83rem; }
.party-rules-score-card dt small { margin-top: 3px; color: var(--party-muted); font-size: .68rem; line-height: 1.35; }
.party-rules-score-card dd { margin: 0; font-family: var(--party-font-display); color: #a8f1ff; font-size: 1.12rem; font-weight: 800; white-space: nowrap; }
.party-rules-score-card.is-bonus dd { color: #ffc493; }
.party-rules-score-card .party-rules-modes { margin-top: 12px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.party-rules-score-card .party-rules-modes > div { min-width: 0; padding: 11px; border: 1px solid rgba(255,255,255,.07); border-radius: 13px; display: flex; align-items: flex-start; gap: 9px; background: rgba(255,255,255,.03); }
.party-rules-score-card .party-rules-modes svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: #ffc493; }
.party-rules-score-card .party-rules-modes strong, .party-rules-score-card .party-rules-modes small { display: block; }
.party-rules-score-card .party-rules-modes strong { font-size: .76rem; }
.party-rules-score-card .party-rules-modes small { margin-top: 3px; color: var(--party-muted); font-size: .64rem; line-height: 1.35; }
.party-rules-notes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.party-rules-notes article { min-width: 0; padding: 17px; border: 1px solid rgba(255,255,255,.08); border-radius: 17px; display: flex; align-items: flex-start; gap: 12px; background: rgba(255,255,255,.035); }
.party-rules-notes article > svg { width: 20px; height: 20px; flex: none; color: #bfaeff; }
.party-rules-notes h3 { margin: 0; font-size: .86rem; }
.party-rules-notes p { margin: 5px 0 0; color: var(--party-muted); font-size: .72rem; line-height: 1.45; }
.party-rules-cta { margin-top: clamp(42px, 7vw, 72px); padding: clamp(20px, 4vw, 32px); border: 1px solid rgba(155,92,255,.26); border-radius: 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: linear-gradient(110deg, rgba(155,92,255,.16), rgba(77,232,255,.1)); }
.party-rules-cta h2 { margin: 0; font-family: var(--party-font-display); font-size: clamp(1.3rem, 3vw, 1.75rem); }
.party-rules-cta p { margin: 6px 0 0; color: var(--party-muted); font-size: .82rem; }
.party-rules-cta > div:last-child { flex: none; display: flex; gap: 9px; }

/* ============ Panels & form controls ============ */
.party-panel { border-radius: 24px; padding: clamp(22px, 4vw, 34px); }
.party-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.party-panel-head h2 { margin: 0; font-family: var(--party-font-display); font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.01em; line-height: 1.05; }
.party-panel-head p { margin: 8px 0 0; color: var(--party-muted); font-size: .96rem; line-height: 1.5; }
.party-join-card { max-width: 900px; margin: 32px auto; overflow: hidden; }
.party-join-layout { display: grid; grid-template-columns: minmax(240px,.72fr) minmax(0,1fr); align-items: stretch; gap: clamp(24px, 4vw, 42px); }
.party-join-visual { min-width: 0; min-height: 330px; margin: -34px 0 -34px -34px; position: relative; overflow: hidden; border-right: 1px solid rgba(255,255,255,.08); background: radial-gradient(circle at 60% 45%, rgba(155,92,255,.2), transparent 65%); }
.party-join-visual img { width: 100%; height: 100%; position: absolute; inset: 0; display: block; object-fit: cover; object-position: 50% center; }
.party-join-form { min-width: 0; align-self: center; padding: 8px 0; }
.party-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.party-field { display: block; color: var(--party-text); font-size: .95rem; font-weight: 700; }
.party-field small { display: block; margin-top: 5px; color: var(--party-muted); line-height: 1.45; font-size: .84rem; font-weight: 450; }
.party-field-wide { width: 100%; }
.party-input {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
    border: 2px solid var(--party-border);
    border-radius: 14px;
    padding: 0 15px;
    color: #fff;
    background: rgba(6, 3, 18, .55);
    outline: none;
    font-size: 1.02rem;
    font-weight: 600;
    transition: .15s ease;
    appearance: none;
}
.party-input:focus { border-color: var(--party-accent); box-shadow: 0 0 0 4px rgba(77, 232, 255, .14); }
.party-input::placeholder { color: rgba(233,228,252,.35); font-weight: 400; }
input[type="search"]::-webkit-search-cancel-button { filter: invert(1); opacity: .55; }

/* ============ Setup wizard ============ */
.party-setup { max-width: 1040px; margin: 0 auto; border-radius: 26px; overflow: hidden; }
.party-setup-header { padding: 24px 26px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.party-setup-header .party-panel-head { margin-bottom: 18px !important; }
.party-setup-progress { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.party-step-pill {
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 13px;
    padding: 0 10px;
    color: var(--party-subtle);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: .83rem;
    font-weight: 800;
    transition: .15s ease;
}
.party-step-pill svg { width: 16px; height: 16px; }
.party-step-pill.is-active { color: #fff; background: var(--party-game-gradient); box-shadow: 0 6px 18px rgba(124, 92, 255, .3); }
.party-step-pill.is-complete { color: #8ff0c6; background: rgba(85, 230, 165, .08); }
.party-step-panel { display: none; padding: clamp(24px, 4vw, 38px); min-height: 500px; }
.party-step-panel.is-active { display: block; animation: partyFadeIn .22s ease both; }
@keyframes partyFadeIn { from { opacity: 0; transform: translateY(6px); } }
.party-step-heading { max-width: 720px; margin: 0 0 24px; }
.party-step-heading .party-eyebrow { display: none; }
.party-step-heading h2 { margin: 0; font-family: var(--party-font-display); font-size: clamp(1.7rem, 3.4vw, 2.3rem); letter-spacing: -.01em; }
.party-step-heading p { margin: 9px 0 0; color: var(--party-muted); font-size: .96rem; line-height: 1.55; }
.party-eyebrow { display: inline-flex; align-items: center; gap: 6px; color: #bfeeff; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.party-eyebrow svg { width: 14px; height: 14px; }
.party-settings-stack { display: grid; gap: 16px; }
.party-control-group, .party-modal-section {
    border-radius: 18px;
    padding: 18px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
}
.party-control-group.is-plain { padding: 0; border: 0; background: transparent; }
.party-control-copy strong { display: block; font-size: 1.02rem; font-weight: 800; }
.party-control-copy span { display: block; margin-top: 5px; color: var(--party-muted); font-size: .86rem; line-height: 1.45; }
.party-value-options { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.party-value-options button {
    min-height: 50px;
    border: 2px solid var(--party-border);
    border-radius: 13px;
    color: var(--party-muted);
    background: rgba(255,255,255,.04);
    font-family: var(--party-font-display);
    font-weight: 800;
    font-size: 1.05rem;
    transition: .14s ease;
}
.party-value-options button:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateY(-1px); }
.party-value-options button.is-selected { color: #fff; background: var(--party-game-gradient); border-color: transparent; box-shadow: 0 5px 0 rgba(23,8,54,.8), 0 12px 24px rgba(124,92,255,.28); }
.party-stepper-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.party-stepper { border-radius: 14px; padding: 13px; background: rgba(5, 2, 16, .45); border: 1px solid rgba(255,255,255,.08); }
.party-stepper > span { display: block; color: var(--party-muted); font-size: .82rem; font-weight: 700; margin-bottom: 10px; }
.party-stepper > div { display: grid; grid-template-columns: 40px minmax(0,1fr) 40px; gap: 8px; align-items: center; }
.party-stepper button {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid var(--party-border);
    background: rgba(255,255,255,.07);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
    transition: .13s ease;
}
.party-stepper button:hover { background: rgba(255,255,255,.13); }
.party-stepper button:active { transform: scale(.92); }
.party-stepper output { text-align: center; font-family: var(--party-font-display); font-size: 1.25rem; font-weight: 800; }

.party-setting-card { border-radius: 18px; padding: 18px; margin-top: 16px; }
.party-setting-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.party-setting-head strong { display: block; font-size: 1.02rem; font-weight: 800; }
.party-setting-head span { display: block; color: var(--party-muted); font-size: .86rem; margin-top: 5px; line-height: 1.45; }
.party-switch { position: relative; display: inline-flex; flex: none; }
.party-switch input { position: absolute; opacity: 0; }
.party-switch-track { width: 52px; height: 30px; border-radius: 999px; background: rgba(255,255,255,.16); padding: 3px; transition: .18s ease; }
.party-switch-track::after { content: ""; display: block; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s cubic-bezier(.2,.8,.3,1.3); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.party-switch input:checked + .party-switch-track { background: var(--party-game-gradient); }
.party-switch input:checked + .party-switch-track::after { transform: translateX(22px); }
.party-segmented { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.party-radio-card { position: relative; cursor: pointer; }
.party-radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.party-radio-card > span {
    display: block;
    min-height: 96px;
    border-radius: 15px;
    border: 2px solid var(--party-border);
    padding: 15px;
    background: rgba(255,255,255,.035);
    transition: .15s ease;
}
.party-radio-card:hover > span { border-color: var(--party-border-strong); }
.party-radio-card input:checked + span { border-color: var(--party-accent); background: rgba(77, 232, 255, .1); box-shadow: 0 0 0 3px rgba(77, 232, 255, .12); }
.party-radio-card b { display: block; font-size: .97rem; }
.party-radio-card small { display: block; margin-top: 6px; color: var(--party-muted); font-size: .8rem; line-height: 1.4; }
.party-radio-card.is-locked { opacity: .5; cursor: not-allowed; }
.party-bopstarr-brand { display: flex !important; align-items: center; gap: 8px; min-height: 23px; }
.party-bopstarr-brand img:first-child { width: 24px; height: 24px; object-fit: contain; }
.party-bopstarr-brand img:last-child { height: 17px; max-width: 110px; object-fit: contain; }
.party-time-control { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-top: 16px; }
.party-range { width: 100%; height: 8px; border-radius: 999px; background: rgba(255,255,255,.15); appearance: none; outline: none; }
.party-range::-webkit-slider-thumb { appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 6px solid var(--party-violet); box-shadow: 0 3px 12px rgba(0,0,0,.4); cursor: grab; }
.party-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 6px solid var(--party-violet); cursor: grab; }
.party-output { min-width: 62px; text-align: center; padding: 9px 10px; border-radius: 11px; background: rgba(255,255,255,.07); font-family: var(--party-font-display); font-weight: 800; font-size: 1.05rem; }

/* ============ Music selector ============ */
.party-source-card {
    width: 100%;
    min-height: 76px;
    border-radius: 16px;
    border: 2px solid var(--party-border);
    padding: 12px 14px;
    color: #fff;
    text-align: left;
    background: rgba(255,255,255,.04);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: .15s ease;
}
.party-source-card:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.party-source-card.is-selected { border-color: var(--party-accent); background: rgba(77, 232, 255, .09); }
.party-source-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff; background: var(--party-game-gradient); }
.party-source-card strong { display: block; font-size: .98rem; }
.party-source-card span { display: block; color: var(--party-muted); margin-top: 3px; line-height: 1.35; font-size: .8rem; }
.party-playlist-toolbar { margin: 14px 0 10px; }
.party-search-box {
    min-height: 52px;
    border-radius: 14px;
    padding: 0 14px;
    border: 2px solid var(--party-border);
    background: rgba(6, 3, 18, .5);
    display: flex;
    align-items: center;
    gap: 10px;
}
.party-search-box:focus-within { border-color: var(--party-accent); box-shadow: 0 0 0 4px rgba(77, 232, 255, .12); }
.party-search-box svg { width: 18px; color: var(--party-subtle); }
.party-search-box input { width: 100%; height: 48px; border: 0; outline: 0; color: #fff; background: transparent; font-size: 1rem; }
.party-search-box input::placeholder { color: rgba(233,228,252,.36); }
.party-playlist-grid { display: grid; grid-template-columns: 1fr; gap: 20px; max-height: 470px; overflow: auto; padding: 2px 4px 2px 0; }
.party-playlist-grid::-webkit-scrollbar, .party-history-list::-webkit-scrollbar, .party-custom-select-menu::-webkit-scrollbar { width: 7px; }
.party-playlist-grid::-webkit-scrollbar-thumb, .party-history-list::-webkit-scrollbar-thumb, .party-custom-select-menu::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(255,255,255,.16); }
.party-playlist-group { display: grid; gap: 9px; }
.party-playlist-group-title { margin: 0; padding: 3px 2px; color: var(--party-muted); font-size: .75rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.party-playlist-group-title span { display: inline-grid; min-width: 22px; height: 22px; margin-left: 5px; padding: 0 6px; place-items: center; border-radius: 999px; color: #c8f7ff; background: rgba(77,232,255,.12); font-size: .68rem; letter-spacing: 0; }
.party-playlist-group-cards { display: grid; gap: 8px; }
.party-playlist-card {
    min-height: 78px;
    border: 2px solid rgba(255,255,255,.08);
    border-radius: 15px;
    padding: 10px;
    background: rgba(255,255,255,.03);
    color: #fff;
    text-align: left;
    display: grid;
    grid-template-columns: 58px minmax(0,1fr) auto;
    align-items: center;
    gap: 13px;
    transition: .15s ease;
}
.party-playlist-card:hover { background: rgba(255,255,255,.07); border-color: var(--party-border-strong); transform: translateY(-1px); }
.party-playlist-card.is-selected { background: rgba(77, 232, 255, .09); border-color: var(--party-accent); box-shadow: 0 0 0 3px rgba(77, 232, 255, .1); }
.party-playlist-art { width: 58px; height: 58px; border-radius: 12px; overflow: hidden; position: relative; display: grid; place-items: center; color: #baf4ff; background: var(--party-accent-soft); }
.party-playlist-art img { width: 100%; height: 100%; object-fit: cover; }
.party-playlist-art > svg { width: 22px; }
.party-playlist-check { width: 28px; height: 28px; border-radius: 50%; display: none; place-items: center; color: #07141d; background: var(--party-accent); }
.party-playlist-check svg { width: 15px; }
.party-playlist-card.is-selected .party-playlist-check { display: grid; }
.party-playlist-copy { min-width: 0; }
.party-playlist-copy strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .96rem; }
.party-playlist-copy span { display: block; margin-top: 5px; color: var(--party-muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ Designs & review ============ */
.party-design-selector { border-radius: 20px; padding: 16px; overflow: hidden; }
.party-design-selector-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.party-design-selector-head strong, .party-design-selector-head span { display: block; }
.party-design-selector-head > div > span { color: var(--party-muted); font-size: .8rem; margin-top: 3px; }
.party-selection-count { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; background: rgba(77, 232, 255, .13); color: #bdeeff; font-size: .75rem; font-weight: 800; }
.party-design-categories { display: flex !important; overflow-x: auto; gap: 8px; padding-bottom: 12px; scrollbar-width: none; }
.party-design-categories::-webkit-scrollbar { display: none; }
.party-category-pill { flex: 0 0 auto; white-space: nowrap; min-height: 40px; border: 2px solid var(--party-border); border-radius: 12px; padding: 0 14px; color: var(--party-muted); background: rgba(255,255,255,.04); font-weight: 800; font-size: .83rem; transition: .14s ease; }
.party-category-pill.is-active { color: #fff; background: var(--party-game-gradient); border-color: transparent; }
.party-design-grid { display: flex !important; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 14px; scroll-snap-type: x proximity; scrollbar-color: rgba(77, 232, 255, .35) transparent; }
.party-design-card { flex: 0 0 134px; width: 134px; height: 134px; border: 3px solid transparent; border-radius: 18px; padding: 0; scroll-snap-align: start; position: relative; overflow: hidden; transform-origin: center; background: rgba(255,255,255,.05); transition: .16s ease; }
.party-design-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.party-design-card:hover { transform: translateY(-4px) rotate(-1deg); border-color: rgba(255,255,255,.3); }
.party-design-card.is-selected { border-color: var(--party-accent) !important; box-shadow: 0 0 0 4px rgba(77, 232, 255, .2), 0 14px 32px rgba(20, 6, 50, .5); }
.party-design-check { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%; display: none; place-items: center; color: #07141d; background: var(--party-accent); }
.party-design-card.is-selected .party-design-check { display: grid; }
.party-shuffle-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(145deg, rgba(155, 92, 255, .3), rgba(77, 232, 255, .24)) !important; }
.party-shuffle-card > div { display: flex; align-items: center; gap: 6px; }
.party-design-shuffle-art { font-size: 1.6rem; display: flex; align-items: center; gap: 5px; color: #fff; }
.party-shuffle-card strong { font-size: .84rem; color: #fff; }
.party-shuffle-card svg { width: 24px; }
.party-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.party-review-item { min-height: 82px; border-radius: 15px; padding: 14px; }
.party-review-item span { display: block; color: var(--party-muted); font-size: .8rem; font-weight: 700; }
.party-review-item strong { display: block; margin-top: 7px; font-size: 1rem; }
.party-setup-footer { padding: 16px 26px max(18px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(9, 4, 24, .8); border-top: 1px solid rgba(255,255,255,.07); }
.party-setup-footer-right { display: flex; gap: 10px; margin-left: auto; }

/* ============ Room chrome ============ */
.party-room-view { animation: partyFadeIn .25s ease both; }
.party-room-topbar { min-height: 76px; border-radius: 22px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.party-room-identity { display: flex; align-items: center; gap: 12px; }
.party-mini-mark { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--party-game-gradient); box-shadow: 0 8px 20px rgba(124, 92, 255, .35); }
.party-mini-mark svg { width: 21px; }
.party-room-label { display: block; color: var(--party-subtle); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.party-room-code { margin-top: 2px; font-family: var(--party-font-display); font-size: 1.5rem; font-weight: 800; letter-spacing: .14em; }
.party-room-actions { display: flex; align-items: center; gap: 8px; }
.party-connection { min-height: 44px; border-radius: 13px; padding: 0 13px; border: 1px solid var(--party-border); background: rgba(255,255,255,.05); display: inline-flex; align-items: center; gap: 8px; color: var(--party-muted); font-size: .78rem; font-weight: 700; }
.party-connection-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--party-green); box-shadow: 0 0 10px rgba(85, 230, 165, .5); }
.party-connection.is-okay .party-connection-dot { background: var(--party-yellow); box-shadow: 0 0 10px rgba(255, 209, 102, .5); }
.party-connection.is-poor .party-connection-dot, .party-connection.is-offline .party-connection-dot { background: var(--party-red); box-shadow: none; }
.party-room-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; align-items: start; }

/* ============ Stage ============ */
.party-stage { min-height: 660px; border-radius: 24px; padding: 22px; overflow: hidden; position: relative; transition: box-shadow .3s ease; }
.party-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% -10%, rgba(155, 92, 255, .16), transparent 55%);
    opacity: 0;
    transition: opacity .6s ease;
}
body[data-party-phase="countdown"] .party-stage::before,
body[data-party-phase="year_guessing"] .party-stage::before,
body[data-party-phase="bonus_guessing"] .party-stage::before,
body[data-party-phase="reveal"] .party-stage::before { opacity: 1; }
body[data-party-phase="reveal"] .party-stage::before { background: radial-gradient(ellipse at 50% -10%, rgba(255, 209, 102, .2), transparent 55%); }
.party-stage.is-lock-pulse { animation: partyStagePulse .55s ease; }
@keyframes partyStagePulse {
    30% { box-shadow: inset 0 0 0 3px rgba(85, 230, 165, .65), 0 0 44px rgba(85, 230, 165, .3), var(--party-shadow); }
}
.party-phase-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; position: relative; z-index: 2; }
.party-phase-copy { min-width: 0; }
.party-phase-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; border-radius: 999px; padding: 0 12px; color: #bfeeff; background: var(--party-accent-soft); border: 1px solid rgba(77, 232, 255, .2); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.party-phase-pill svg { width: 14px; height: 14px; }
.party-phase-pill.is-countdown { color: #ffe9b3; background: rgba(255, 209, 102, .13); border-color: rgba(255, 209, 102, .3); }
.party-phase-pill.is-year_guessing { color: #d9c6ff; background: rgba(155, 92, 255, .15); border-color: rgba(155, 92, 255, .35); }
.party-phase-pill.is-bonus_guessing { color: #ffc7e1; background: rgba(255, 79, 163, .13); border-color: rgba(255, 79, 163, .32); }
.party-phase-pill.is-reveal { color: #b8ffd9; background: rgba(85, 230, 165, .13); border-color: rgba(85, 230, 165, .3); }
.party-phase-pill.is-finished { color: #ffe9b3; background: rgba(255, 209, 102, .13); border-color: rgba(255, 209, 102, .3); }
.party-phase-header h1 { margin: 13px 0 5px; font-family: var(--party-font-display); font-size: clamp(1.6rem, 3.2vw, 2.4rem); letter-spacing: -.01em; line-height: 1.05; }
.party-phase-header p { margin: 0; color: var(--party-muted); font-size: .92rem; line-height: 1.45; }
.party-phase-header > div:last-child { text-align: right; flex: none; }
.party-phase-header > div:last-child strong { display: block; margin-top: 3px; font-family: var(--party-font-display); font-size: 1.15rem; font-weight: 800; }
.party-progress { height: 6px; border-radius: 999px; margin-top: 16px; overflow: hidden; background: rgba(255,255,255,.09); position: relative; z-index: 2; }
.party-progress b { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--party-game-gradient); box-shadow: 0 0 12px rgba(124, 92, 255, .6); transition: width .4s ease; }
.party-stage-center { min-height: 490px; padding: 26px 0 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; z-index: 2; }
.party-host-controls { min-height: 48px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 9px; margin-top: 12px; position: relative; z-index: 2; }

/* ---- game timer bar ---- */
.party-game-timer { width: 100%; margin-top: 14px; display: flex; align-items: center; gap: 13px; position: relative; z-index: 2; animation: partyFadeIn .25s ease both; }
.party-game-timer-track { flex: 1; height: 16px; border-radius: 999px; background: rgba(4, 2, 14, .6); border: 1px solid rgba(255,255,255,.1); overflow: hidden; box-shadow: inset 0 2px 6px rgba(0,0,0,.45); }
.party-game-timer-fill { height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, #4de8ff, #9b5cff); box-shadow: 0 0 14px rgba(124, 92, 255, .55); transition: width .12s linear, background .4s ease; }
.party-game-timer.is-warn .party-game-timer-fill { background: linear-gradient(90deg, #ffd166, #ff9a3d); box-shadow: 0 0 14px rgba(255, 154, 61, .55); }
.party-game-timer.is-critical .party-game-timer-fill { background: linear-gradient(90deg, #ff5d7e, #ff4fa3); box-shadow: 0 0 18px rgba(255, 79, 130, .7); }
.party-game-timer.is-critical { animation: partyTimerShake .5s ease-in-out infinite; }
@keyframes partyTimerShake { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
.party-game-timer-time { min-width: 58px; font-family: var(--party-font-display); font-size: 1.5rem; font-weight: 800; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.party-game-timer.is-critical .party-game-timer-time { color: #ff8fab; animation: partyTimeBlink .5s ease-in-out infinite; }
@keyframes partyTimeBlink { 50% { transform: scale(1.18); } }
/* full-stage urgency glow in the final seconds */
.party-stage.is-time-critical { animation: partyStageHeartbeat 1s ease-in-out infinite; }
@keyframes partyStageHeartbeat {
    0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 93, 126, 0), inset 0 1px 0 rgba(255,255,255,.07), var(--party-shadow); }
    50% { box-shadow: inset 0 0 0 2px rgba(255, 93, 126, .55), inset 0 0 60px rgba(255, 79, 130, .12), var(--party-shadow); }
}

.party-sound-gate, .party-guess-panel, .party-waiting-card { width: min(520px, 100%); border-radius: 20px; padding: 24px; }
.party-sound-gate { position: relative; overflow: hidden; border-color: rgba(77, 232, 255, .26); background: linear-gradient(145deg, rgba(52, 30, 96, .5), rgba(77, 232, 255, .1)); }
.party-sound-gate::before { content: "🎧"; position: absolute; right: -8px; top: -22px; font-size: 7rem; opacity: .08; transform: rotate(12deg); }
.party-sound-icon { width: 58px; height: 58px; margin: 0 auto 15px; border-radius: 17px; display: grid; place-items: center; color: #fff; background: var(--party-game-gradient); box-shadow: 0 10px 26px rgba(124, 92, 255, .4); animation: partySoundBounce 2.2s ease-in-out infinite; }
@keyframes partySoundBounce { 50% { transform: translateY(-5px) rotate(-4deg); } }
.party-sound-gate h2, .party-waiting-card h2 { margin: 0; font-family: var(--party-font-display); font-size: 1.65rem; letter-spacing: -.01em; }
.party-sound-gate p, .party-waiting-card p { margin: 9px auto 18px; max-width: 440px; color: var(--party-muted); line-height: 1.5; font-size: .92rem; }
.party-waiting-card { border-color: rgba(85, 230, 165, .22); }
.party-lock-animation { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; color: #052012; background: var(--party-green); box-shadow: 0 0 0 0 rgba(85, 230, 165, .5); animation: partyLockRing 1.8s ease-out infinite; }
@keyframes partyLockRing { 70% { box-shadow: 0 0 0 16px rgba(85, 230, 165, 0); } 100% { box-shadow: 0 0 0 0 rgba(85, 230, 165, 0); } }

/* ---- countdown: floats over the card, never collides with it ---- */
.party-countdown {
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    z-index: 6;
    margin: 0;
    width: 140px;
    height: 140px;
    border-radius: 44px;
    display: grid;
    place-items: center;
    font-family: var(--party-font-display);
    font-size: 4rem;
    font-weight: 800;
    color: #fff;
    background: var(--party-game-gradient);
    box-shadow: 0 0 0 12px rgba(124, 92, 255, .1), 0 22px 55px rgba(30, 8, 70, .55), inset 0 2px 0 rgba(255,255,255,.3);
    text-shadow: 0 3px 8px rgba(0,0,0,.3);
    animation: partyPop .3s ease both;
}
.party-countdown[data-beat="1"] { background: var(--party-hot-gradient); }
.party-countdown[data-beat="0"] { background: linear-gradient(135deg, #55e6a5, #1f9d63); font-size: 2.6rem; letter-spacing: .02em; }
.party-countdown.is-beating { animation: partyCountdownBeat .45s cubic-bezier(.2,.8,.2,1); }
@keyframes partyPop { from { transform: scale(.85); opacity: 0; } }
@keyframes partyCountdownBeat { 45% { transform: scale(1.2) rotate(2.5deg); box-shadow: 0 0 0 28px rgba(155, 92, 255, .07), 0 28px 66px rgba(124, 92, 255, .45); } }

/* ---- the card ---- */
.party-card-wrap { width: min(320px, 78vw); aspect-ratio: 1; perspective: 1400px; margin: 0 auto 16px; position: relative; animation: partyCardFloat 5s ease-in-out infinite; }
@keyframes partyCardFloat { 50% { transform: translateY(-8px); } }
.party-card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.party-card.is-flipped { transform: rotateY(180deg); }
.party-card-face { position: absolute; inset: 0; border-radius: 26px; overflow: hidden; backface-visibility: hidden; background-size: cover; background-position: center; border: 1px solid rgba(255,255,255,.16); box-shadow: 0 26px 60px rgba(2, 0, 12, .5); }
.party-card-front { display: grid; place-items: center; background-image: linear-gradient(145deg, #3b2a72, #14264d); }
.party-card-back { transform: rotateY(180deg); display: grid; place-items: center; background-image: linear-gradient(145deg, #1c2c50, #41296b); }
body[data-party-phase="year_guessing"] .party-card-face, body[data-party-phase="bonus_guessing"] .party-card-face, body[data-party-phase="countdown"] .party-card-face { box-shadow: 0 0 0 2px rgba(124, 92, 255, .35), 0 0 50px rgba(124, 92, 255, .3), 0 26px 60px rgba(2,0,12,.5); }
body[data-party-phase="reveal"] .party-card-face { box-shadow: 0 0 0 2px rgba(255, 209, 102, .45), 0 0 60px rgba(255, 209, 102, .3), 0 26px 60px rgba(2,0,12,.5); }
.party-card-overlay { position: absolute; inset: 0; background: linear-gradient(160deg, rgba(0,0,0,.02), rgba(0,0,0,.16)); }
.party-card-front-content { position: relative; z-index: 2; width: 52%; aspect-ratio: 1; border-radius: 24px; display: grid; place-items: center; background: rgba(8, 4, 22, .4); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(9px); }
.party-card-front-content svg { width: 48px; height: 48px; }
.party-equalizer { display: flex; height: 34px; align-items: end; gap: 5px; margin-top: 10px; }
.party-equalizer i { display: block; width: 5px; border-radius: 99px; background: #fff; animation: partyBars .8s ease-in-out infinite alternate; }
.party-equalizer i:nth-child(1) { height: 35%; }.party-equalizer i:nth-child(2) { height: 75%; animation-delay: -.3s; }.party-equalizer i:nth-child(3) { height: 48%; animation-delay: -.55s; }.party-equalizer i:nth-child(4) { height: 90%; animation-delay: -.18s; }.party-equalizer i:nth-child(5) { height: 45%; animation-delay: -.7s; }
@keyframes partyBars { to { height: 20%; } }
.party-card-back-content { position: relative; z-index: 2; width: 84%; padding: 18px; text-shadow: 0 2px 14px rgba(0,0,0,.45); }
.party-card-year { font-family: var(--party-font-display); font-size: clamp(3.6rem, 12vw, 5.6rem); line-height: .9; letter-spacing: -.04em; font-weight: 800; }
.party-card-title { margin-top: 16px; font-size: clamp(1.2rem, 3.6vw, 1.8rem); line-height: 1.1; font-weight: 800; }
.party-card-artist { margin-top: 7px; color: rgba(255,255,255,.78); font-size: .98rem; }

/* ---- year guessing ---- */
.party-guess-panel { border-color: rgba(155, 92, 255, .3); background: linear-gradient(160deg, rgba(52, 30, 96, .45), rgba(20, 10, 45, .5)); }
.party-guess-year { margin-bottom: 24px; font-family: var(--party-font-display); font-size: clamp(4.4rem, 15vw, 6.6rem); line-height: .9; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(100deg, #fff, #c9b8ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.party-guess-limits { display: flex; justify-content: space-between; margin-top: 8px; color: var(--party-subtle); font-size: .75rem; font-weight: 700; }
.party-year-result { width: min(600px,100%); border-radius: 16px; padding: 13px 15px; display: flex; align-items: center; justify-content: center; gap: 11px; margin: 0 auto 14px; background: rgba(85, 230, 165, .1); border: 1px solid rgba(85, 230, 165, .22); }
.party-year-result svg { width: 18px; color: var(--party-green); }
.party-year-result strong { display: block; font-size: .95rem; }
.party-year-result span { display: block; color: var(--party-muted); font-size: .8rem; margin-top: 2px; }
.party-free-form { width: min(560px,100%); display: grid; gap: 11px; }
.party-free-form .party-input { margin-top: 0; }

/* ---- multiple choice: Kahoot-style shape buttons ---- */
.party-choice-grid { width: min(680px,100%); display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.party-choice-button {
    position: relative;
    min-height: 92px;
    border: 0;
    border-radius: 18px;
    color: #fff;
    text-align: left;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, .35), 0 18px 36px rgba(2, 0, 12, .4);
    text-shadow: 0 1px 3px rgba(0,0,0,.35);
    animation: partyChoiceIn .35s cubic-bezier(.2,.8,.3,1.15) both;
    transition: transform .13s ease, box-shadow .13s ease, filter .15s ease, opacity .2s ease;
}
.party-choice-button:nth-child(1) { background: linear-gradient(135deg, #ff5d7e, #d62355); }
.party-choice-button:nth-child(2) { background: linear-gradient(135deg, #38b6ff, #1368ce); animation-delay: .06s; }
.party-choice-button:nth-child(3) { background: linear-gradient(135deg, #ffd166, #e08c00); animation-delay: .12s; }
.party-choice-button:nth-child(4) { background: linear-gradient(135deg, #55e6a5, #1f9d63); animation-delay: .18s; }
.party-choice-button:hover:not(:disabled) { transform: translateY(-3px) scale(1.015); filter: brightness(1.1); }
.party-choice-button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.35), 0 8px 18px rgba(2,0,12,.4); }
.party-choice-button:disabled { opacity: .42; filter: saturate(.6); }
.party-choice-button.is-chosen { opacity: 1; filter: none; outline: 3px solid rgba(255,255,255,.85); outline-offset: 2px; animation: partyChosenPulse 1.4s ease-in-out infinite; }
@keyframes partyChosenPulse { 50% { outline-color: rgba(255,255,255,.35); } }
.party-choice-shape { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.45rem; background: rgba(0, 0, 0, .25); box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.party-choice-copy { min-width: 0; }
.party-choice-copy strong { display: block; font-size: 1rem; font-weight: 800; line-height: 1.2; }
.party-choice-copy > span { display: block; color: rgba(255,255,255,.85); margin-top: 4px; font-size: .82rem; }
@keyframes partyChoiceIn { from { opacity: 0; transform: translateY(16px) scale(.95); } }

/* ---- tension feed ---- */
.party-tension-feed { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 15px; width: 100%; }
.party-tension-player { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid transparent; color: var(--party-muted); font-size: .78rem; transition: .18s ease; }
.party-tension-player > span { display: block; min-width: 0; }
.party-tension-player b, .party-tension-player small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-tension-player b { font-size: .78rem; color: inherit; }
.party-tension-player small { margin-top: 2px; font-size: .66rem; color: var(--party-subtle); }
.party-tension-player svg { width: 16px; height: 16px; flex: none; }
.party-tension-player.is-locked { color: #d9fbff; background: linear-gradient(100deg, rgba(155, 92, 255, .2), rgba(77, 232, 255, .16)); border-color: rgba(77, 232, 255, .25); animation: partyLockPop .35s ease; }
.party-tension-player.is-locked small { color: rgba(217, 251, 255, .72); }
@keyframes partyLockPop { 50% { transform: scale(1.06); } }

/* ---- personal result: your outcome takes the spotlight ---- */
.party-my-result {
    width: min(660px, 100%);
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: 20px;
    padding: 16px 18px;
    margin: 0 auto 12px;
    text-align: left;
    border: 1px solid transparent;
    animation: partyMyResultIn .55s cubic-bezier(.2,.8,.3,1.25) both;
}
@keyframes partyMyResultIn { from { opacity: 0; transform: translateY(14px) scale(.94); } }
.party-my-result.is-correct {
    background: linear-gradient(120deg, rgba(85, 230, 165, .22), rgba(77, 232, 255, .1));
    border-color: rgba(85, 230, 165, .45);
    box-shadow: 0 0 36px rgba(85, 230, 165, .16);
}
.party-my-result.is-wrong {
    background: linear-gradient(120deg, rgba(255, 93, 126, .2), rgba(255, 79, 163, .07));
    border-color: rgba(255, 93, 126, .4);
    box-shadow: 0 0 30px rgba(255, 93, 126, .1);
}
.party-my-result-icon {
    flex: none;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    color: #052012;
    background: var(--party-green);
    box-shadow: 0 8px 22px rgba(85, 230, 165, .35), inset 0 1px 0 rgba(255,255,255,.35);
}
.party-my-result.is-wrong .party-my-result-icon { color: #38030f; background: var(--party-red); box-shadow: 0 8px 22px rgba(255, 93, 126, .3), inset 0 1px 0 rgba(255,255,255,.3); }
.party-my-result-main { min-width: 0; flex: 1; }
.party-my-result-main strong { display: block; font-family: var(--party-font-display); font-size: 1.5rem; line-height: 1.05; letter-spacing: -.01em; }
.party-my-result-main span { display: block; margin-top: 5px; color: var(--party-muted); font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-my-result-stats { flex: none; text-align: right; }
.party-my-result-stats b { display: block; font-family: var(--party-font-display); font-size: 1.6rem; line-height: 1; color: #7dffb8; }
.party-my-result.is-wrong .party-my-result-stats b { color: var(--party-subtle); }
.party-my-result-stats > span { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .82rem; font-weight: 800; color: var(--party-muted); }
.party-my-result-trend { font-size: .72rem; padding: 2px 7px; border-radius: 999px; }
.party-my-result-trend.is-up { color: #7dffb8; background: rgba(85, 230, 165, .14); }
.party-my-result-trend.is-down { color: #ff9db3; background: rgba(255, 93, 126, .14); }

/* ---- group results: secondary, smaller, quieter ---- */
.party-result-summary { width: min(660px,100%); opacity: .94; }
.party-result-summary .party-result-winner { padding: 9px 12px; border-radius: 12px; }
.party-result-summary .party-result-winner strong { font-size: .85rem; font-weight: 700; }
.party-result-summary .party-result-winner span { font-size: .74rem; }
.party-result-summary .party-result-guess { padding: 8px 9px; font-size: .8rem; }
.party-result-summary .party-result-guess small { font-size: .66rem; }
.party-year-result { padding: 9px 12px; font-size: .85rem; }
.party-year-result strong { font-size: .85rem; }
.party-year-result span { font-size: .74rem; }
.party-result-winner { margin-top: 9px; border-radius: 15px; padding: 13px 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.09); text-align: left; animation: partyFadeIn .3s ease both; }
.party-result-winner strong { display: block; font-size: .94rem; }
.party-result-winner span { display: block; margin-top: 4px; color: var(--party-muted); font-size: .8rem; line-height: 1.4; }
.party-result-winner.is-winner { border-color: rgba(255, 209, 102, .35); background: linear-gradient(110deg, rgba(255, 209, 102, .14), rgba(155, 92, 255, .13)); }
.party-answer-reveal { background: linear-gradient(110deg, rgba(52, 30, 96, .55), rgba(77, 232, 255, .12)) !important; border-color: rgba(155, 92, 255, .3) !important; }
.party-result-guess-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 9px; }
.party-result-guess { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; gap: 7px; align-items: center; padding: 11px; border-radius: 13px; background: rgba(255,255,255,.045); color: var(--party-muted); }
.party-result-guess.is-winner { background: linear-gradient(105deg, rgba(255, 209, 102, .18), rgba(85, 230, 165, .14)); color: #fff; }
.party-result-guess svg { width: 17px; }
.party-result-guess small { grid-column: 2/-1; font-size: .7rem; color: var(--party-subtle); }

/* ============ Side panel ============ */
.party-side { border-radius: 24px; padding: 15px; position: sticky; top: 16px; }
.party-invite-card { border-radius: 17px; padding: 14px; text-align: center; }
.party-qr { width: min(170px, 100%); height: auto; border-radius: 14px; background: #fff; padding: 8px; display: block; margin: 0 auto 11px; }
.party-invite-code { font-family: var(--party-font-display); font-size: 1.5rem; font-weight: 800; letter-spacing: .15em; }
/* Robot opponent card */
.party-robot-card { border-radius: 17px; padding: 14px; margin-top: 15px; text-align: left; }
.party-robot-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.party-robot-emoji { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: linear-gradient(150deg, rgba(155,92,255,.22), rgba(77,232,255,.14)); border: 1px solid rgba(255,255,255,.1); }
.party-robot-copy { min-width: 0; }
.party-robot-copy strong { display: block; font-size: .9rem; font-weight: 800; }
.party-robot-copy span { display: block; margin-top: 2px; font-size: .7rem; color: var(--party-muted); line-height: 1.35; }
.party-robot-difficulty { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; margin-bottom: 11px; }
.party-robot-diff { min-height: 38px; border: 2px solid var(--party-border); border-radius: 11px; padding: 0 8px; display: flex; align-items: center; justify-content: center; color: var(--party-muted); background: rgba(255,255,255,.04); font-size: .78rem; font-weight: 800; text-align: center; transition: .14s ease; }
.party-robot-diff:hover { border-color: rgba(77,232,255,.36); color: #fff; }
.party-robot-diff.is-selected { color: #fff; background: var(--party-game-gradient); border-color: transparent; }
.party-robot-badge { background: rgba(77, 232, 255, .18); color: #b8f3ff; }
.party-side-section { margin-top: 15px; }
.party-side-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.party-side-heading h3 { margin: 0; font-size: .95rem; font-weight: 800; }
.party-side-heading span { color: var(--party-muted); font-size: .74rem; font-weight: 600; }
.party-readiness { border-radius: 15px; padding: 12px; display: flex; align-items: center; gap: 11px; }
.party-readiness-lights { display: flex; gap: 5px; }
.party-readiness-lights i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.15); }
.party-readiness-lights i.on { background: var(--party-game-gradient); box-shadow: 0 0 12px rgba(124, 92, 255, .7); }
.party-readiness strong { display: block; font-size: .83rem; }
.party-readiness span { display: block; color: var(--party-muted); font-size: .7rem; margin-top: 2px; }

/* leaderboard */
.party-player-list { display: grid; gap: 7px; }
.party-player-row { border-radius: 14px; padding: 10px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; animation: partyPlayerIn .3s ease both; animation-delay: var(--player-delay, 0ms); transition: border-color .2s ease, background .2s ease; }
.party-player-row.is-locked { border-color: rgba(77, 232, 255, .25); }
.party-avatar { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: .82rem; font-weight: 800; color: #150826; background: var(--party-game-gradient); position: relative; }
.party-avatar-dot { position: absolute; width: 10px; height: 10px; right: -2px; bottom: -2px; border-radius: 50%; background: var(--party-green); border: 2px solid #17102f; }
.party-avatar-dot.offline { background: rgba(255,255,255,.3); }
.party-rank-badge { position: absolute; left: -5px; top: -7px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; font-size: .62rem; font-weight: 800; color: #fff; background: #2b1d52; border: 1px solid rgba(255,255,255,.2); box-shadow: 0 3px 8px rgba(0,0,0,.4); }
.party-rank-badge.is-rank-1 { background: linear-gradient(135deg, #ffd166, #e08c00); color: #3a2500; font-size: .78rem; }
.party-rank-badge.is-rank-2 { background: linear-gradient(135deg, #e8ecf5, #9aa5bd); color: #2c3345; font-size: .78rem; }
.party-rank-badge.is-rank-3 { background: linear-gradient(135deg, #f0a35e, #b06a28); color: #3a2000; font-size: .78rem; }
.party-player-main { min-width: 0; }
.party-player-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.party-player-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .86rem; font-weight: 700; }
.party-player-badge { border-radius: 999px; padding: 2px 6px; font-size: .55rem; font-weight: 800; letter-spacing: .04em; background: rgba(155, 92, 255, .2); color: #ddd0ff; }
.party-player-status { margin-top: 3px; color: var(--party-muted); font-size: .68rem; display: flex; align-items: center; gap: 4px; }
.party-player-status svg { width: 12px; height: 12px; }
.party-player-score { text-align: right; position: relative; }
.party-player-score strong { display: block; font-family: var(--party-font-display); font-size: 1.1rem; font-weight: 800; }
.party-player-score span { display: block; color: var(--party-subtle); font-size: .6rem; font-weight: 600; }
.party-player-row.score-changed .party-player-score strong { animation: partyScorePop .7s cubic-bezier(.2,.8,.3,1.3); color: #aeeaff; }
@keyframes partyScorePop { 45% { transform: scale(1.5) rotate(-4deg); } }
.party-score-delta { position: absolute; top: -8px; right: 0; font-family: var(--party-font-display); font-size: .85rem; font-weight: 800; color: #7dffb8; text-shadow: 0 2px 8px rgba(0,0,0,.5); animation: partyDeltaFloat 1.5s ease-out forwards; pointer-events: none; }
@keyframes partyDeltaFloat { 15% { opacity: 1; } 100% { transform: translateY(-26px); opacity: 0; } }
.party-streak { font-size: .68rem; font-weight: 800; padding: 3px 7px; border-radius: 999px; background: rgba(255, 154, 61, .16); color: #ffc19c; border: 1px solid rgba(255, 154, 61, .25); animation: partyStreakFlicker 1.2s ease-in-out infinite; }
@keyframes partyStreakFlicker { 50% { background: rgba(255, 154, 61, .26); } }
.party-kick { border: 0; background: transparent; color: rgba(255, 93, 126, .8); padding: 4px; margin-left: 3px; }
@keyframes partyPlayerIn { from { opacity: .4; transform: translateX(6px); } }
.party-history-list { display: grid; gap: 6px; max-height: 190px; overflow: auto; }
.party-history-row { border-radius: 13px; padding: 9px 10px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 9px; text-align: left; }
.party-history-number { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--party-game-gradient); font-size: .72rem; font-weight: 800; }
.party-history-row strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .78rem; }
.party-history-row span { display: block; margin-top: 2px; color: var(--party-muted); font-size: .65rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-empty { color: var(--party-muted); text-align: center; padding: 18px; font-size: .82rem; }
.party-public-empty { margin-top: 2px; padding: 13px 15px; border: 1px dashed rgba(255,255,255,.1); border-radius: 14px; color: var(--party-muted); background: rgba(255,255,255,.025); font-size: .82rem; text-align: left; }
.party-guess-panel.is-countdown-ready { border-style: dashed; opacity: .88; animation: partyGetReady 1.6s ease-in-out infinite; }
@keyframes partyGetReady { 50% { border-color: rgba(255, 209, 102, .55); } }

/* ============ Podium & finished ============ */
.party-podium { width: min(600px,100%); display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 22px auto 14px; }
.party-podium-place { width: 31%; min-height: 140px; border-radius: 18px 18px 8px 8px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 14px 8px; background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.12); animation: partyPodiumRise .8s cubic-bezier(.2,.85,.3,1.2) both; transform-origin: bottom; }
.party-podium-place.first { min-height: 190px; background: linear-gradient(180deg, rgba(255, 209, 102, .2), rgba(255, 209, 102, .05)); border-color: rgba(255, 209, 102, .4); box-shadow: 0 0 40px rgba(255, 209, 102, .15); }
@keyframes partyPodiumRise { from { transform: scaleY(.15); opacity: 0; } }
.party-podium-medal { font-size: 1.9rem; margin-bottom: 8px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
.party-podium-place.first .party-podium-medal { font-size: 2.4rem; animation: partyCrownBob 2s ease-in-out infinite; }
@keyframes partyCrownBob { 50% { transform: translateY(-5px) rotate(-6deg); } }
.party-podium-place .party-avatar { margin-bottom: 9px; }
.party-podium-place strong { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .86rem; }
.party-podium-place span { margin-top: 4px; color: var(--party-muted); font-size: .72rem; }
.party-finished-actions { width: min(540px,100%); display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 14px; }

/* ============ Host controls ============ */
.party-start-game { min-height: 66px !important; min-width: min(100%, 380px); padding: 0 30px !important; border-radius: 20px !important; font-family: var(--party-font-display); font-size: 1.2rem !important; position: relative; overflow: hidden; background: var(--party-game-gradient) !important; box-shadow: 0 6px 0 rgba(23, 8, 54, .85), 0 18px 44px rgba(124, 92, 255, .35) !important; }
.party-start-game::after { content: ""; position: absolute; inset: -2px; transform: translateX(-130%) skewX(-20deg); width: 45%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); }
.party-start-game.is-ready::after { animation: partyButtonShine 2.2s ease-in-out infinite; }
.party-start-game.is-ready { animation: partyStartPulse 1.8s ease-in-out infinite; }
@keyframes partyButtonShine { 60%, 100% { transform: translateX(330%) skewX(-20deg); } }
@keyframes partyStartPulse { 50% { transform: translateY(-2px) scale(1.015); box-shadow: 0 8px 0 rgba(23,8,54,.85), 0 24px 52px rgba(124, 92, 255, .45), 0 0 0 8px rgba(155, 92, 255, .1) !important; } }

/* ============ Public lobbies ============ */
.party-public-lobbies { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--party-border); position: relative; }
.party-public-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.party-public-heading h2 { margin: 5px 0 0; font-family: var(--party-font-display); font-size: 1.25rem; }
.party-public-lobby-list { display: grid; gap: 9px; }
.party-public-lobby { width: 100%; min-height: 74px; border: 2px solid rgba(255,255,255,.09); border-radius: 16px; background: rgba(255,255,255,.04); color: #fff; display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 11px 14px; text-align: left; animation: partyLobbyIn .4s ease both; animation-delay: var(--lobby-delay, 0ms); transition: .18s ease; }
.party-public-lobby:hover { transform: translateY(-3px); border-color: rgba(77, 232, 255, .4); background: linear-gradient(100deg, rgba(155, 92, 255, .16), rgba(77, 232, 255, .1)); }
.party-public-lobby-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; background: linear-gradient(145deg, rgba(155, 92, 255, .3), rgba(77, 232, 255, .22)); }
.party-public-lobby-copy { min-width: 0; }
.party-public-lobby-copy strong, .party-public-lobby-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-public-lobby-copy strong { font-size: .95rem; }
.party-public-lobby-copy small { margin-top: 4px; color: var(--party-muted); font-size: .76rem; }
.party-public-join { display: flex; align-items: center; gap: 6px; color: #9ee5ff; font-size: .82rem; font-weight: 800; }
.party-public-join svg { width: 15px; }
@keyframes partyLobbyIn { from { opacity: 0; transform: translateY(10px); } }

.party-visibility-options span { gap: 8px; }
.party-visibility-options svg { width: 16px; height: 16px; }
.party-visibility-group .party-field { margin-top: 13px; }

/* ============ Modal & custom select ============ */
.party-modal { position: fixed; inset: 0; z-index: 160; padding: 16px; background: rgba(4, 1, 14, .8); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.party-modal.is-open { opacity: 1; pointer-events: auto; }
.party-modal-panel { width: min(720px,100%); max-height: min(90vh, 820px); overflow: auto; border-radius: 24px; padding: 24px; transform: translateY(10px) scale(.98); transition: transform .2s cubic-bezier(.2,.8,.3,1.1); }
.party-modal.is-open .party-modal-panel { transform: none; }
.party-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.party-modal-head h2 { margin: 0; font-family: var(--party-font-display); font-size: 1.65rem; letter-spacing: -.01em; }
.party-modal-head p { margin: 6px 0 0; color: var(--party-muted); font-size: .88rem; }
.party-modal-sections { display: grid; gap: 12px; margin-bottom: 15px; }
.party-modal-section { padding: 16px; }
.party-custom-select { position: relative; margin-top: 12px; }
.party-custom-select-button { width: 100%; min-height: 50px; border: 2px solid var(--party-border); border-radius: 13px; padding: 0 14px; color: #fff; background: rgba(6, 3, 18, .5); display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
.party-custom-select-button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-custom-select-button svg { width: 17px; color: var(--party-muted); }
.party-custom-select-menu { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 7px); max-height: 260px; overflow: auto; padding: 7px; border-radius: 14px; background: #1d1438; border: 1px solid var(--party-border-strong); box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.party-custom-select-option { width: 100%; min-height: 46px; border: 0; border-radius: 10px; padding: 10px 11px; color: #fff; background: transparent; text-align: left; }
.party-custom-select-option:hover, .party-custom-select-option.is-selected { background: rgba(77, 232, 255, .11); }
.party-custom-select-option strong { display: block; font-size: .88rem; }
.party-custom-select-option small { display: block; margin-top: 2px; color: var(--party-muted); font-size: .72rem; }
.party-custom-select-search { min-height: 44px; margin-bottom: 7px; border-radius: 10px; padding: 0 11px; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.party-custom-select-search svg { width: 15px; color: var(--party-subtle); }
.party-custom-select-search input { width: 100%; height: 42px; border: 0; outline: 0; color: #fff; background: transparent; font-size: .88rem; }
.party-compact-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin-top: 11px; }
.party-compact-options label { position: relative; cursor: pointer; }
.party-compact-options input { position: absolute; opacity: 0; }
.party-compact-options span { min-height: 46px; border: 2px solid var(--party-border); border-radius: 12px; padding: 0 12px; display: flex; align-items: center; justify-content: center; color: var(--party-muted); background: rgba(255,255,255,.04); font-size: .85rem; font-weight: 800; text-align: center; transition: .14s ease; }
.party-compact-options input:checked + span { color: #fff; background: var(--party-game-gradient); border-color: transparent; }
.party-confirm-modal { z-index: 180; }
.party-confirm-panel { width: min(430px,100%); border-radius: 22px; padding: 26px; text-align: center; }
.party-confirm-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; color: #ffd2de; background: rgba(255, 93, 126, .14); }
.party-confirm-panel h2 { margin: 0; font-family: var(--party-font-display); font-size: 1.5rem; }
.party-confirm-panel p { margin: 9px 0 22px; color: var(--party-muted); font-size: .9rem; line-height: 1.5; }
.party-confirm-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }

/* provider badge */
.party-provider-status { display: inline-flex !important; align-items: center; gap: 6px; width: max-content; margin-top: 8px; padding: 5px 9px; border-radius: 999px; font-style: normal; font-size: .7rem !important; font-weight: 800; line-height: 1; color: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); }
.party-provider-status svg { width: 13px; height: 13px; }
.party-provider-status.is-connected { color: #aaf4d1; border-color: rgba(85, 230, 165, .35); background: rgba(85, 230, 165, .12); }
.party-provider-status.is-missing { color: #ffe0a3; border-color: rgba(255, 190, 85, .32); background: rgba(255, 190, 85, .1); }

/* ============ Toast, confetti, spinner ============ */
.party-toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 220; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 13px 18px; border-radius: 14px; background: #23184a; border: 1px solid var(--party-border-strong); box-shadow: 0 20px 50px rgba(0,0,0,.5); transition: .22s cubic-bezier(.2,.8,.3,1.15); max-width: min(90vw, 540px); text-align: center; font-size: .86rem; font-weight: 600; }
.party-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.party-toast.is-error { border-color: rgba(255, 93, 126, .4); color: #ffdce5; }
.party-confetti { position: fixed; inset: 0; z-index: 210; pointer-events: none; overflow: hidden; }
.party-confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: partyConfettiFall 2.4s linear forwards; }
.party-confetti i:nth-child(3n) { border-radius: 50%; width: 9px; height: 9px; }
.party-confetti i:nth-child(4n) { width: 12px; height: 6px; }
@keyframes partyConfettiFall { to { transform: translate3d(0, 112vh, 0) rotate(560deg); opacity: .7; } }
.party-spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.25); border-top-color: currentColor; border-radius: 50%; animation: partySpin .65s linear infinite; }
@keyframes partySpin { to { transform: rotate(360deg); } }

/* ============ Install app banner ============ */
.party-install-banner {
    position: fixed;
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 150;
    width: min(560px, calc(100% - 24px));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(150deg, rgba(34, 24, 66, .95), rgba(15, 10, 34, .95));
    border: 1px solid var(--party-border-strong);
    box-shadow: 0 18px 44px rgba(2, 0, 12, .6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: partyFadeIn .3s ease both;
}
.party-install-icon { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.party-install-copy { flex: 1; min-width: 0; }
.party-install-copy strong { display: block; font-size: .95rem; font-weight: 800; }
.party-install-copy span { display: block; margin-top: 2px; color: var(--party-muted); font-size: .78rem; line-height: 1.35; }
.party-install-banner .party-primary { min-height: 42px; flex: none; padding: 0 16px; }
.party-install-banner .party-icon-button { flex: none; }
/* never distract during an actual game */
body.party-room-active .party-install-banner { display: none; }

/* ============ Mobile tab bar (JS-injected) ============ */
.party-mobile-nav { display: none; }

/* ============ AdSense / site footer suppression on Party ============ */
body.party-page ins.adsbygoogle,
body.party-page iframe[id^="google_ads_iframe"],
body.party-page div[id^="google_vignette"],
body.party-page .adsbygoogle { display: none !important; }

/* ============ Responsive ============ */
@media (max-width: 920px) {
    .party-rules-hero { grid-template-columns: 1fr; align-items: start; }
    .party-rules-hero-side { width: min(520px,100%); min-height: 248px; padding-top: 150px; }
    .party-rules-hero-art { width: min(520px, calc(100% + 42px)); height: 240px; right: -20px; top: -28px; }
    .party-rules-score-preview { width: min(430px,100%); }
    .party-rules-flow { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .party-rules-flow article { min-height: 180px; }
    .party-room-grid { display: block; }
    .party-side { position: static; display: none; }
    .party-room-view.party-show-details .party-stage { display: none; }
    .party-room-view.party-show-details .party-side { display: block; }
    .party-shell { padding-bottom: 30px; }
    /* --- app-like room: viewport height, internal scroll, pinned tab bar --- */
    body.party-room-active { overflow: hidden; }
    body.party-room-active .party-shell { padding-top: 8px; padding-bottom: 0; display: flex; flex-direction: column; }
    body.party-room-active .party-room-view { display: flex; flex-direction: column; min-height: 0; }
    body.party-room-active .party-room-topbar { flex: none; margin-bottom: 8px; }
    body.party-room-active .party-room-grid {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 14px;
    }
    body.party-room-active .party-room-grid::-webkit-scrollbar { display: none; }
    /* --- fullscreen app feel: site chrome steps aside while in a room --- */
    body.party-room-active { overscroll-behavior: none; }
    body.party-room-active .party-topbar { display: none; }
    body.party-room-active button, body.party-room-active input { touch-action: manipulation; }
    body.party-room-active .party-room-topbar { min-height: 56px; padding: 8px 12px; border-radius: 16px; }
    body.party-room-active .party-stage { min-height: 0; overflow: visible; }
    body.party-room-active .party-stage::before { border-radius: inherit; }
    body.party-room-active .party-stage-center { min-height: 0; padding: 14px 0 4px; }
    body.party-room-active .party-progress { margin-top: 8px; }
    /* slim timer: always visible, no longer eats the screen */
    body.party-room-active .party-game-timer { margin-top: 8px; }
    body.party-room-active .party-game-timer-track { height: 9px; }
    body.party-room-active .party-game-timer-time { font-size: 1rem; min-width: 42px; }
    /* --- timed phases: compact everything so no scrolling is needed --- */
    body[data-party-phase="countdown"] .party-phase-header h1,
    body[data-party-phase="year_guessing"] .party-phase-header h1,
    body[data-party-phase="bonus_guessing"] .party-phase-header h1 { margin: 7px 0 0; font-size: 1.1rem; }
    body[data-party-phase="countdown"] .party-phase-header p,
    body[data-party-phase="year_guessing"] .party-phase-header p,
    body[data-party-phase="bonus_guessing"] .party-phase-header p { display: none; }
    body[data-party-phase="countdown"] .party-card-wrap,
    body[data-party-phase="year_guessing"] .party-card-wrap,
    body[data-party-phase="bonus_guessing"] .party-card-wrap { width: 96px; margin-bottom: 8px; animation: none; }
    body[data-party-phase="countdown"] .party-card-front-content svg,
    body[data-party-phase="year_guessing"] .party-card-front-content svg,
    body[data-party-phase="bonus_guessing"] .party-card-front-content svg { width: 26px; height: 26px; }
    body[data-party-phase="countdown"] .party-equalizer,
    body[data-party-phase="year_guessing"] .party-equalizer,
    body[data-party-phase="bonus_guessing"] .party-equalizer { display: none; }
    body[data-party-phase="countdown"] .party-card-front-content,
    body[data-party-phase="year_guessing"] .party-card-front-content,
    body[data-party-phase="bonus_guessing"] .party-card-front-content { border-radius: 14px; }
    body.party-room-active .party-guess-panel { padding: 14px 16px; }
    body.party-room-active .party-guess-year { margin-bottom: 10px; font-size: clamp(2.6rem, 11vw, 3.4rem); }
    /* thumb-friendly slider */
    body.party-room-active .party-guess-panel .party-range { height: 10px; }
    body.party-room-active .party-guess-panel .party-range::-webkit-slider-thumb { width: 32px; height: 32px; }
    body.party-room-active .party-guess-panel .party-range::-moz-range-thumb { width: 18px; height: 18px; }
    /* primary action never scrolls out of reach */
    body.party-room-active #partyLockYear, body.party-room-active #partySubmitBonus { position: sticky; bottom: 6px; z-index: 5; }
    /* --- compact floating pill tab bar: in-flow at the bottom of the
           viewport-fitted room, so it is pinned like a native app tab bar
           and nothing can ever scroll behind it --- */
    .party-mobile-nav { display: none; }
    body.party-room-active .party-mobile-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        flex: none;
        width: min(330px, calc(100% - 40px));
        margin: 4px auto max(10px, env(safe-area-inset-bottom));
        padding: 6px;
        border-radius: 999px;
        background: linear-gradient(150deg, rgba(34, 24, 66, .92), rgba(15, 10, 34, .92));
        border: 1px solid var(--party-border-strong);
        box-shadow: 0 14px 36px rgba(2, 0, 12, .55);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    .party-mobile-nav button {
        min-height: 44px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: var(--party-muted);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        font-family: var(--party-font-display);
        font-size: .8rem;
        font-weight: 800;
        letter-spacing: .02em;
        transition: .15s ease;
    }
    .party-mobile-nav button svg { width: 17px; height: 17px; }
    .party-mobile-nav button.is-active { color: #fff; background: var(--party-game-gradient); box-shadow: 0 5px 14px rgba(124, 92, 255, .45); }
    /* the site footer is not part of the game — drop it on small screens */
    body.party-page > footer { display: none !important; }
}
@media (max-width: 700px) {
    .party-shell { width: min(100% - 18px, 1160px); padding-top: 12px; }
    .party-home { margin-top: 8px; padding: 20px 16px; border-radius: 22px; }
    .party-home-main { display: block; }
    .party-home-intro { display: block; }
    .party-home-icon { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 12px; }
    .party-home-icon svg { width: 26px; height: 26px; }
    .party-home-actions { grid-template-columns: 1fr; margin-top: 16px; }
    .party-home-action { min-height: 78px; }
    .party-home-notes { gap: 12px; }
    .party-rules-teaser-cta { font-size: 0; }
    .party-rules-teaser-cta svg { width: 18px; height: 18px; }
    .party-rules-page { margin: 12px auto; border-radius: 22px; }
    .party-rules-hero { min-height: 0; padding: 72px 18px 25px; gap: 22px; }
    .party-rules-back { top: 15px; left: 15px; }
    .party-rules-hero-copy { padding-top: 0; }
    .party-rules-hero-side { min-height: 220px; padding-top: 132px; }
    .party-rules-hero-art { width: calc(100% + 36px); height: 210px; right: -18px; top: -28px; object-position: 62% center; }
    .party-rules-score-grid { grid-template-columns: 1fr; }
    .party-rules-notes { grid-template-columns: 1fr; }
    .party-rules-cta { align-items: stretch; flex-direction: column; }
    .party-rules-cta > div:last-child { width: 100%; }
    .party-rules-cta > div:last-child > * { flex: 1; }
    .party-panel, .party-setup { border-radius: 20px; }
    .party-join-card { padding: 22px; }
    .party-join-layout { grid-template-columns: 1fr; gap: 22px; }
    .party-join-visual { min-height: 190px; margin: -22px -22px 0; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
    .party-join-visual img { object-position: center 45%; }
    .party-join-form { padding: 0; }
    .party-form-grid, .party-segmented, .party-review-grid, .party-stepper-grid { grid-template-columns: 1fr; }
    .party-setup-header { padding: 18px 15px 12px; }
    .party-setup-progress { gap: 6px; }
    .party-step-pill { min-height: 42px; padding: 0; }
    .party-step-pill span { display: none; }
    .party-step-panel { min-height: 0; padding: 18px 14px; }
    /* keep the playlist picker a bounded, internally scrolling list —
       the page itself must never become a miles-long playlist scroll */
    .party-playlist-grid { max-height: min(470px, 58vh); gap: 14px; }
    .party-setup-footer { padding-left: 15px; padding-right: 15px; align-items: stretch; }
    .party-setup-footer-right { width: 100%; }
    .party-setup-footer-right > * { flex: 1; }
    .party-room-topbar { align-items: center; }
    .party-connection span { display: none; }
    .party-connection { padding: 0 12px; }
    .party-stage { min-height: 0; padding: 15px 13px 18px; border-radius: 20px; }
    .party-stage-center { min-height: 0; padding: 20px 0 4px; }
    .party-phase-header h1 { font-size: 1.45rem; }
    .party-phase-header p { font-size: .85rem; }
    .party-card-wrap { width: min(230px, 68vw); margin-bottom: 12px; }
    .party-card-front-content svg { width: 36px; height: 36px; }
    .party-guess-year { margin-bottom: 16px; }
    .party-sound-gate, .party-guess-panel, .party-waiting-card { padding: 19px; }
    .party-year-result { margin-bottom: 10px; }
    .party-tension-feed { gap: 6px; margin-top: 12px; }
    .party-my-result { gap: 11px; padding: 13px 14px; border-radius: 17px; }
    .party-my-result-icon { width: 46px; height: 46px; border-radius: 14px; font-size: 1.55rem; }
    .party-my-result-main strong { font-size: 1.25rem; }
    .party-my-result-main span { font-size: .76rem; }
    .party-my-result-stats b { font-size: 1.3rem; }
    .party-choice-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
    .party-choice-button { min-height: 64px; padding: 10px 12px; gap: 10px; border-radius: 14px; }
    .party-choice-copy strong { font-size: .88rem; }
    .party-choice-copy > span { font-size: .74rem; margin-top: 2px; }
    .party-choice-shape { width: 42px; height: 42px; font-size: 1.25rem; }
    .party-finished-actions { grid-template-columns: 1fr; }
    .party-modal-panel { padding: 19px 15px; border-radius: 20px; }
    .party-public-lobby { grid-template-columns: 40px minmax(0,1fr); }
    .party-public-join { display: none; }
    .party-design-card { flex-basis: 118px; width: 118px; height: 118px; }
    .party-tension-feed, .party-result-guess-grid { grid-template-columns: 1fr; }
    .party-start-game { width: 100%; }
    .party-countdown { width: 116px; height: 116px; border-radius: 36px; font-size: 3.3rem; }
    .party-game-timer-time { font-size: 1.3rem; min-width: 50px; }
}
@media (max-width: 460px) {
    .party-home-copy h1 { font-size: 1.9rem; }
    .party-home-notes { display: grid; gap: 9px; }
    .party-rules-teaser { grid-template-columns: auto minmax(0,1fr) auto; padding-left: 10px; }
    .party-rules-teaser small { display: none; }
    .party-rules-flow { grid-template-columns: 1fr; }
    .party-rules-flow article { min-height: 150px; }
    .party-rules-flow h3 { margin-top: 22px; }
    .party-rules-section-head { grid-template-columns: 38px minmax(0,1fr); gap: 10px; }
    .party-rules-section-head > span { width: 36px; height: 36px; border-radius: 11px; }
    .party-rules-score-preview span { min-height: 76px; padding-left: 3px; padding-right: 3px; font-size: .58rem; }
    .party-rules-score-card .party-rules-modes { grid-template-columns: 1fr; }
    .party-rules-cta > div:last-child { display: grid; grid-template-columns: 1fr; }
    .party-value-options { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .party-room-code { font-size: 1.2rem; }
    .party-mini-mark { display: none; }
    .party-room-actions { gap: 6px; }
    .party-phase-header > div:last-child strong { font-size: 1rem; }
    .party-card-face { border-radius: 20px; }
    .party-podium-place { width: 32%; padding-left: 5px; padding-right: 5px; }
    .party-compact-options, .party-confirm-actions { grid-template-columns: 1fr; }
    .party-install-banner { gap: 9px; padding: 10px 12px; }
    .party-install-copy span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.party-rules-xp-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.party-rules-xp-grid article {
    min-width: 0;
    padding: 17px 13px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 18px;
    background: radial-gradient(circle at 100% 0, rgba(255,79,163,.12), transparent 48%), rgba(255,255,255,.035);
    text-align: center;
}
.party-rules-xp-grid article > span { display: block; font-size: 28px; line-height: 1; margin-bottom: 9px; }
.party-rules-xp-grid b { display: block; color: #ffd166; font: 800 17px/1.15 'Baloo 2', cursive; }
.party-rules-xp-grid small { display: block; margin-top: 5px; color: #a9a1d2; font-size: 11.5px; line-height: 1.4; }
.party-rules-xp-note {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    margin-top: 13px; padding: 11px 14px; border-radius: 14px;
    background: rgba(77,232,255,.08); color: #baf4ff; font-size: 12px; font-weight: 700;
}
.party-rules-xp-note svg { width: 17px; height: 17px; color: #4de8ff; }

.party-progression-feed {
    position: fixed;
    z-index: 10020;
    top: max(84px, calc(env(safe-area-inset-top) + 72px));
    left: 50%;
    width: min(420px, calc(100vw - 24px));
    transform: translateX(-50%);
    pointer-events: none;
}
.party-progression-pop {
    display: grid;
    grid-template-columns: 54px minmax(0,1fr);
    gap: 13px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid rgba(77,232,255,.42);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(27,16,55,.97), rgba(10,6,25,.97));
    box-shadow: 0 20px 55px rgba(2,0,12,.6), 0 0 0 1px rgba(255,255,255,.04) inset;
    opacity: 0;
    transform: translateY(-24px) scale(.9);
    transition: opacity .3s ease, transform .38s cubic-bezier(.2,1.25,.35,1);
}
.party-progression-pop.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.party-progression-pop.is-achievement { border-color: rgba(255,209,102,.55); background: radial-gradient(circle at 90% 0, rgba(255,154,61,.22), transparent 46%), linear-gradient(145deg,rgba(52,29,73,.98),rgba(13,7,30,.98)); }
.party-progression-pop.is-level { border-color: rgba(255,79,163,.58); background: radial-gradient(circle at 85% 0, rgba(255,79,163,.27), transparent 48%), linear-gradient(145deg,rgba(58,25,83,.98),rgba(12,7,29,.98)); }
.party-progression-icon {
    width: 54px; height: 54px; display: grid; place-items: center;
    border-radius: 17px; font-size: 28px;
    background: linear-gradient(145deg,rgba(77,232,255,.16),rgba(155,92,255,.18));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.13);
}
.party-progression-copy { min-width: 0; display: grid; }
.party-progression-copy small { color: #8fe9ff; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; }
.party-progression-copy strong { color: #fff; font: 800 21px/1.12 'Baloo 2', cursive; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-progression-copy em { color: #b9b2e0; font-size: 11.5px; line-height: 1.3; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-progression-pop.is-achievement .party-progression-copy small { color: #ffd166; }
.party-progression-pop.is-level .party-progression-copy small { color: #ff9fd0; }

@media (max-width: 720px) {
    .party-rules-xp-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 460px) {
    .party-rules-xp-grid { grid-template-columns: 1fr; }
    .party-progression-feed { top: max(70px, calc(env(safe-area-inset-top) + 60px)); }
    .party-progression-pop { grid-template-columns: 45px minmax(0,1fr); padding: 12px 13px; border-radius: 17px; }
    .party-progression-icon { width: 45px; height: 45px; border-radius: 14px; font-size: 23px; }
    .party-progression-copy strong { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .party-progression-pop { transition: none; }
}

/* ============ Bop Box mystery items ============ */
.party-bop-dock {
    position: fixed;
    z-index: 145;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(22px, env(safe-area-inset-bottom));
    width: min(310px, calc(100vw - 32px));
}
.party-bop-card {
    width: 100%;
    min-height: 82px;
    display: grid;
    grid-template-columns: 58px minmax(0,1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    color: #fff;
    border: 1px solid rgba(255,209,102,.5);
    border-radius: 22px;
    background:
        radial-gradient(circle at 10% 10%, rgba(255,209,102,.28), transparent 35%),
        linear-gradient(145deg, rgba(44,26,76,.98), rgba(13,8,31,.98));
    box-shadow: 0 18px 55px rgba(2,0,12,.56), 0 0 34px rgba(255,79,163,.16);
    text-align: left;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease;
}
.party-bop-card:hover:not(:disabled) { transform: translateY(-3px) scale(1.01); border-color: #ffd166; }
.party-bop-card:disabled { cursor: default; opacity: .68; }
.party-bop-card-icon {
    width: 58px; height: 58px; display: grid; place-items: center;
    border-radius: 18px; font-size: 31px;
    background: linear-gradient(145deg, rgba(255,79,163,.27), rgba(77,232,255,.19));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.17);
}
.party-bop-card-copy { min-width: 0; display: grid; }
.party-bop-card-copy small { color: #ffd166; font-size: 9px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; }
.party-bop-card-copy strong { overflow: hidden; color: #fff; font: 800 18px/1.1 var(--party-font-display); text-overflow: ellipsis; white-space: nowrap; }
.party-bop-card-copy em { overflow: hidden; margin-top: 3px; color: #b9b2e0; font-size: 10.5px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.party-bop-use-label {
    padding: 7px 9px; border-radius: 999px;
    color: #140a2b; background: #ffd166;
    font-size: 9px; font-weight: 950; letter-spacing: .7px;
}
.party-bop-dock.is-shielded .party-bop-card { border-color: rgba(85,230,165,.8); box-shadow: 0 18px 55px rgba(2,0,12,.56), 0 0 30px rgba(85,230,165,.25); }
.party-bop-reveal {
    position: fixed; inset: 0; z-index: 10040;
    display: grid; place-items: center; padding: 18px;
    background: rgba(3,1,12,.86);
    backdrop-filter: blur(15px);
}
.party-bop-reveal-card {
    position: relative;
    width: min(420px,100%);
    min-height: 410px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 34px 28px;
    overflow: hidden;
    border: 1px solid rgba(255,209,102,.55);
    border-radius: 34px;
    color: #fff;
    background:
        radial-gradient(circle at 50% 25%, rgba(255,209,102,.25), transparent 26%),
        radial-gradient(circle at 90% 0, rgba(255,79,163,.3), transparent 42%),
        linear-gradient(150deg,#25134d,#09051d 70%);
    box-shadow: 0 34px 100px rgba(0,0,0,.7), 0 0 70px rgba(155,92,255,.25);
    text-align: center;
}
.party-bop-reveal-card > small { color: #ffd166; font-size: 12px; font-weight: 950; letter-spacing: 3px; }
.party-bop-reveal-card h2 { margin: 12px 0 5px; font: 900 31px/1.05 var(--party-font-display); }
.party-bop-reveal-card p { min-height: 42px; margin: 0 0 20px; color: #c9c2e8; font-size: 13px; line-height: 1.5; }
.party-bop-spin-icon {
    width: 132px; height: 132px; margin: 25px auto 10px;
    display: grid; place-items: center;
    border: 2px solid rgba(255,255,255,.18);
    border-radius: 38px;
    font-size: 68px;
    background: linear-gradient(145deg,rgba(255,255,255,.1),rgba(255,255,255,.035));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 0 40px rgba(77,232,255,.16);
}
.party-bop-reveal.is-spinning .party-bop-spin-icon { animation: partyBopSpin .16s ease-in-out infinite alternate; }
@keyframes partyBopSpin { to { transform: rotate(5deg) scale(1.07); filter: saturate(1.35); } }
.party-timeline-mask {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(28px,1fr));
    gap: 3px; margin: 8px 0 4px;
}
.party-timeline-mask span {
    min-width: 0; padding: 5px 2px; border-radius: 6px;
    color: #4e4867; background: rgba(255,255,255,.035);
    font-size: 8px; font-weight: 900; text-align: center;
}
.party-timeline-mask span.is-allowed { color: #c8f8ff; background: rgba(77,232,255,.16); }
.party-lyric-hint {
    margin: 12px 0 2px; padding: 12px 14px;
    border: 1px solid rgba(255,209,102,.3); border-radius: 14px;
    color: #fff0bf; background: rgba(255,209,102,.085);
    font-size: 13px; font-style: italic; line-height: 1.45; text-align: center;
}
.party-fog-canvas {
    position: fixed; inset: 0; z-index: 10030;
    width: 100vw; height: 100vh;
    touch-action: none; cursor: crosshair;
}
.party-fog-canvas.party-hidden { display: none; }
.party-stage.is-sensor-hot { box-shadow: 0 0 0 2px rgba(255,79,163,.72), 0 0 42px rgba(255,79,163,.26); }
.party-stage.is-sensor-warm { box-shadow: 0 0 0 2px rgba(255,209,102,.5), 0 0 32px rgba(255,209,102,.16); }
.party-rules-bop {
    background:
        radial-gradient(circle at 88% 10%, rgba(255,209,102,.12), transparent 30%),
        rgba(255,255,255,.02);
}
.party-bop-earn-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.party-bop-earn-grid article {
    min-width: 0; padding: 17px; border: 1px solid rgba(255,255,255,.09);
    border-radius: 18px; background: rgba(255,255,255,.035);
}
.party-bop-earn-grid article > span { display: block; margin-bottom: 9px; font-size: 27px; }
.party-bop-earn-grid strong { display: block; color: #fff; font: 800 17px/1.1 var(--party-font-display); }
.party-bop-earn-grid small { display: block; margin-top: 6px; color: var(--party-muted); font-size: 11.5px; line-height: 1.45; }
.party-bop-rules-items { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.party-bop-rules-items span {
    min-width: 0; padding: 10px 8px; border-radius: 12px;
    color: #d8d2f1; background: rgba(155,92,255,.09);
    font-size: 11px; font-weight: 800; text-align: center;
}

@media (max-width: 920px) {
    .party-bop-dock {
        right: 12px;
        bottom: calc(max(78px, env(safe-area-inset-bottom) + 70px));
        width: min(270px, calc(100vw - 24px));
    }
    .party-bop-card { min-height: 68px; grid-template-columns: 46px minmax(0,1fr) auto; border-radius: 18px; }
    .party-bop-card-icon { width: 46px; height: 46px; border-radius: 14px; font-size: 25px; }
    .party-bop-card-copy strong { font-size: 15px; }
    .party-bop-rules-items { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
    .party-bop-earn-grid { grid-template-columns: 1fr; }
}

/* ============ Game modes ============ */
.party-mode-picker-wrap { display: grid; gap: 12px; padding: 4px 0; }
.party-rules-mode-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.party-rules-mode-grid > article {
    position: relative; overflow: hidden; display: grid; align-content: start; gap: 12px; min-width: 0; padding: 18px;
    border: 1px solid rgba(255,255,255,.09); border-radius: 20px;
    background: linear-gradient(145deg,rgba(255,255,255,.055),rgba(255,255,255,.025));
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.party-rules-mode-grid > article:hover { transform: translateY(-4px); border-color: color-mix(in srgb,var(--mode-rule-glow,#9b5cff) 65%,white); box-shadow: 0 18px 40px rgba(3,1,15,.28); }
.party-rules-mode-grid > article::after {
    content: ''; position: absolute; width: 130px; height: 130px; top: -75px; right: -55px;
    border-radius: 50%; background: var(--mode-rule-glow,rgba(155,92,255,.24));
}
.party-rules-mode-grid .is-band { --mode-rule-glow: rgba(255,79,163,.3); }
.party-rules-mode-grid .is-era { --mode-rule-glow: rgba(255,209,102,.32); }
.party-rules-mode-grid header { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; }
.party-rules-mode-grid header > span { font-size: 31px; }
.party-rules-mode-grid h3 { margin: 2px 0 0; font: 900 19px/1 var(--party-font-display); }
.party-rules-mode-grid small { color: #8fe9ff; font-size: 8px; font-weight: 950; letter-spacing: 1.2px; }
.party-rules-mode-grid p { margin: 0; color: var(--party-muted); font-size: 11px; line-height: 1.55; }
.party-rules-mode-grid ol { position: relative; z-index: 1; min-height: 162px; margin: 0; padding: 0; display: grid; gap: 7px; list-style: none; }
.party-rules-mode-grid ol li { min-width: 0; display: grid; grid-template-columns: 23px minmax(0,1fr); align-items: start; gap: 8px; color: #eae5fb; font-size: 10px; line-height: 1.42; }
.party-rules-mode-grid ol li > b { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: color-mix(in srgb,var(--mode-rule-glow,#9b5cff) 55%,rgba(255,255,255,.08)); font-size: 8px; }
.party-rules-mode-grid article > div { display: flex; flex-wrap: wrap; gap: 6px; }
.party-rules-mode-grid article > div b {
    padding: 5px 7px; border-radius: 999px; color: #f8edff; background: rgba(255,255,255,.065);
    font-size: 8.5px; font-weight: 850;
}
.party-mode-picker { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.party-mode-card {
    position: relative; min-width: 0; min-height: 210px;
    display: flex; flex-direction: column; align-items: flex-start; gap: 13px;
    padding: 18px; overflow: hidden;
    border: 2px solid rgba(255,255,255,.09); border-radius: 21px;
    color: #fff; background: rgba(255,255,255,.035); text-align: left;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.party-mode-card::after {
    content: ''; position: absolute; width: 120px; height: 120px; right: -55px; top: -55px;
    border-radius: 50%; background: var(--mode-glow,rgba(155,92,255,.22)); filter: blur(4px);
}
.party-mode-card[data-game-mode="band"] { --mode-glow: rgba(255,79,163,.28); }
.party-mode-card[data-game-mode="era_rush"] { --mode-glow: rgba(255,209,102,.3); }
.party-mode-card:hover { transform: translateY(-3px); border-color: rgba(77,232,255,.36); }
.party-mode-card.is-selected {
    border-color: #4de8ff;
    background: linear-gradient(150deg,rgba(155,92,255,.17),rgba(77,232,255,.09));
    box-shadow: 0 14px 34px rgba(3,1,15,.3), 0 0 0 3px rgba(77,232,255,.08);
}
.party-mode-art { position: relative; z-index: 1; font-size: 38px; line-height: 1; }
.party-mode-card > span:last-child { min-width: 0; display: grid; gap: 5px; }
.party-mode-card small { color: #8fe9ff; font-size: 8px; font-weight: 950; letter-spacing: 1.3px; }
.party-mode-card strong { font: 900 19px/1.1 var(--party-font-display); }
.party-mode-card em { min-height: 42px; color: var(--party-muted); font-size: 11px; line-height: 1.4; font-style: normal; }
.party-mode-card b { color: #ffd166; font-size: 9.5px; font-weight: 850; }
.party-mode-explainer {
    --mode-detail: #9b5cff;
    min-width: 0; display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 14px; align-items: start;
    padding: 15px 17px; overflow: hidden; position: relative;
    border: 1px solid color-mix(in srgb,var(--mode-detail) 42%,transparent); border-radius: 18px;
    background: linear-gradient(110deg,color-mix(in srgb,var(--mode-detail) 14%,rgba(255,255,255,.025)),rgba(255,255,255,.025));
    animation: partyModeDetailIn .24s ease both;
}
.party-mode-explainer.is-band { --mode-detail: #ff4fa3; }
.party-mode-explainer.is-era_rush { --mode-detail: #ffd166; }
.party-mode-explainer-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: color-mix(in srgb,var(--mode-detail) 18%,rgba(255,255,255,.05)); font-size: 27px; }
.party-mode-explainer small,.party-mode-explainer strong { display: block; }
.party-mode-explainer small { color: color-mix(in srgb,var(--mode-detail) 72%,white); font-size: 8px; font-weight: 950; letter-spacing: 1.25px; text-transform: uppercase; }
.party-mode-explainer strong { margin-top: 3px; font: 900 17px/1.1 var(--party-font-display); }
.party-mode-explainer ol { margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; list-style: none; }
.party-mode-explainer li { min-width: 0; display: grid; grid-template-columns: 21px minmax(0,1fr); align-items: start; gap: 6px; color: var(--party-muted); font-size: 9.5px; line-height: 1.4; }
.party-mode-explainer li > b { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: #fff; background: color-mix(in srgb,var(--mode-detail) 42%,rgba(255,255,255,.08)); font-size: 8px; }
@keyframes partyModeDetailIn { from { opacity: 0; transform: translateY(5px) scale(.99); } }
.party-phase-pills { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.party-mode-badge {
    display: inline-flex; min-height: 28px; align-items: center;
    padding: 0 9px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px;
    color: #ffd166; background: rgba(255,209,102,.09);
    font-size: 8px; font-weight: 950; letter-spacing: 1px;
}
.party-mode-badge.is-band { color: #ff9dce; background: rgba(255,79,163,.1); border-color: rgba(255,79,163,.22); }
.party-mode-badge.is-era_rush { color: #ffe08a; background: rgba(255,209,102,.1); border-color: rgba(255,209,102,.25); }
.party-mode-hud { margin-top: 11px; }
.party-band-forming {
    padding: 11px 13px; border: 1px dashed rgba(255,79,163,.28); border-radius: 14px;
    color: #f0dcff; background: rgba(255,79,163,.06); font-size: 11px; font-weight: 750;
}
.party-era-hud {
    display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px;
    padding: 12px 14px; border: 1px solid rgba(255,209,102,.28); border-radius: 17px;
    background: linear-gradient(100deg,rgba(255,79,163,.11),rgba(255,209,102,.08));
}
.party-era-clock { color: #fff; font: 950 30px/1 var(--party-font-display); font-variant-numeric: tabular-nums; }
.party-era-clock.is-critical { color: #ff6d89; animation: partyEraPulse .62s ease-in-out infinite alternate; }
@keyframes partyEraPulse { to { transform: scale(1.08); text-shadow: 0 0 18px rgba(255,79,126,.65); } }
.party-era-track { min-width: 0; display: grid; gap: 6px; }
.party-era-track-head { display: flex; justify-content: space-between; gap: 10px; color: #eee9ff; font-size: 10px; font-weight: 850; }
.party-era-track-bar { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.party-era-track-bar b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#ff4fa3,#ffd166); }
.party-era-score { text-align: right; }
.party-era-score strong,.party-era-score small { display: block; }
.party-era-score strong { font: 900 19px/1 var(--party-font-display); }
.party-era-score small { margin-top: 4px; color: #ffd166; font-size: 9px; font-weight: 900; }
.party-band-hud { display: flex; gap: 9px; overflow-x: auto; padding: 2px 1px 5px; scrollbar-width: none; }
.party-band-hud::-webkit-scrollbar { display: none; }
.party-band-chip {
    flex: 0 0 auto; min-width: 230px; padding: 10px 12px;
    border: 1px solid color-mix(in srgb,var(--band-color) 42%,transparent); border-radius: 14px;
    background: color-mix(in srgb,var(--band-color) 10%,rgba(10,6,24,.72));
}
.party-band-chip.is-mine { box-shadow: 0 0 0 2px color-mix(in srgb,var(--band-color) 28%,transparent), 0 12px 28px rgba(4,2,18,.24); }
.party-band-chip header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.party-band-chip header strong { font: 850 13px/1.1 var(--party-font-display); }
.party-band-chip header > b { color: color-mix(in srgb,var(--band-color) 72%,white); font-size: 9px; white-space: nowrap; }
.party-band-chip > div { margin-top: 8px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.party-band-role { min-width: 0; padding: 6px 7px; display: grid; grid-template-columns: auto minmax(0,1fr); column-gap: 5px; align-items: center; border: 1px solid transparent; border-radius: 9px; background: rgba(255,255,255,.035); }
.party-band-role i { grid-row: 1 / span 2; font-style: normal; }
.party-band-role b,.party-band-role em,.party-band-role u { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-band-role b { color: #fff; font-size: 9px; }
.party-band-role em { color: var(--party-subtle); font-size: 7.5px; font-style: normal; }
.party-band-role u { grid-column: 1 / -1; margin-top: 4px; color: #ffd166; font-size: 7px; font-weight: 900; text-decoration: none; text-transform: uppercase; }
.party-band-role.is-active { border-color: color-mix(in srgb,var(--band-color) 42%,transparent); background: color-mix(in srgb,var(--band-color) 12%,rgba(255,255,255,.035)); animation: partyBandLive 1.5s ease-in-out infinite; }
.party-band-role.is-locked { animation: partyLockPop .35s ease both; }
.party-band-role.is-locked u { color: #8ff0c6; }
@keyframes partyBandLive { 50% { box-shadow: 0 0 0 3px color-mix(in srgb,var(--band-color) 8%,transparent); } }
.party-role-badge { color: #fff !important; font-weight: 850; }
.party-player-band { display: inline-flex; align-items: center; gap: 4px; margin-left: 5px; color: var(--band-color,#9b5cff); font-size: 9px; font-weight: 850; }
.party-portal-flash {
    position: fixed; inset: 0; z-index: 10035; display: grid; place-items: center; pointer-events: none;
    background: radial-gradient(circle,rgba(255,209,102,.3),rgba(155,92,255,.18),transparent 68%);
    animation: partyPortalOpen 1.8s ease forwards;
}
.party-portal-flash strong { color: #fff; font: 950 clamp(30px,9vw,72px)/1 var(--party-font-display); text-align: center; text-shadow: 0 0 35px rgba(255,209,102,.8); }
.party-portal-flash strong span { color: #ffd166; font-size: .42em; letter-spacing: .12em; }
@keyframes partyPortalOpen { 0%{opacity:0;transform:scale(.6)} 35%{opacity:1;transform:scale(1.05)} 100%{opacity:0;transform:scale(1.35)} }
.party-era-finish { width: min(100%,620px); margin: 0 auto; display: grid; gap: 16px; }
.party-era-final-score {
    display: grid; place-items: center; gap: 6px; padding: 24px 16px; border: 1px solid rgba(255,209,102,.3);
    border-radius: 24px; background: radial-gradient(circle at 50% 0,rgba(255,209,102,.18),rgba(155,92,255,.1));
}
.party-era-final-score small { color: #ffd166; font-size: 9px; font-weight: 950; letter-spacing: 1.4px; }
.party-era-final-score strong { font: 950 clamp(42px,12vw,76px)/1 var(--party-font-display); text-shadow: 0 0 28px rgba(255,209,102,.25); }
.party-era-final-score span { color: var(--party-muted); font-size: 11px; font-weight: 800; }
.party-era-leaderboard { padding: 15px; border-radius: 20px; background: rgba(255,255,255,.045); }
.party-era-leaderboard h3 { margin: 0 0 10px; font: 850 15px/1 var(--party-font-display); }
.party-era-leaderboard > div { display: grid; grid-template-columns: 35px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 9px 6px; border-top: 1px solid rgba(255,255,255,.07); }
.party-era-leaderboard > div b { color: #ffd166; }
.party-era-leaderboard > div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-era-leaderboard > div strong { font-variant-numeric: tabular-nums; }
.party-band-avatar { border-color: color-mix(in srgb,var(--band-color) 62%,white); background: color-mix(in srgb,var(--band-color) 20%,rgba(14,8,32,.9)); }
.party-podium-place > small { max-width: 150px; color: var(--party-muted); font-size: 9px; text-align: center; }
body[data-party-mode="era_rush"] .party-side { display: none; }
body[data-party-mode="era_rush"] .party-room-grid { grid-template-columns: minmax(0,1fr); }

@media (max-width: 760px) {
    .party-rules-mode-grid { grid-template-columns: 1fr; }
    .party-rules-mode-grid ol { min-height: 0; }
    .party-mode-picker { grid-template-columns: 1fr; }
    .party-mode-card { min-height: 0; display: grid; grid-template-columns: 48px minmax(0,1fr); padding: 14px; }
    .party-mode-art { font-size: 32px; }
    .party-mode-card em { min-height: 0; }
    .party-mode-explainer { grid-template-columns: 42px minmax(0,1fr); padding: 13px; }
    .party-mode-explainer-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 22px; }
    .party-mode-explainer ol { grid-template-columns: 1fr; }
    .party-era-hud { grid-template-columns: auto minmax(0,1fr); }
    .party-era-score { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; text-align: left; }
}
