/* ══════════════════════════════════════════════════════════════════════════
   style.css — Matchle  (index · lobby · game)
   Design system identical to ShufflGames hub — gold/orange accent palette
══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
    --bg-base:    #0d0a1a;
    --bg-deep:    #080612;
    --bg-surface: rgba(22, 16, 42, 0.7);
    --bg-card:    rgba(18, 13, 35, 0.85);

    --border:        rgba(255, 255, 255, 0.07);
    --border-bright: rgba(160, 100, 255, 0.35);
    --border-gold:   rgba(245, 200, 66, 0.35);

    --text-main: #f0ecff;
    --text-muted:#7a6e9a;
    --text-dim:  #3d3558;

    --purple:       #9b59f5;
    --purple-light: #b87bff;
    --pink:         #e040fb;
    --pink-glow:    rgba(224, 64, 251, 0.3);
    --blue:         #4d6bfe;
    --gold:         #f5c842;
    --gold-glow:    rgba(245, 200, 66, 0.35);
    --orange:       #ff8c42;
    --green:        #00e5a0;
    --green-glow:   rgba(0, 229, 160, 0.2);

    --glow-purple: rgba(155, 89, 245, 0.5);

    --radius-card:  20px;
    --radius-inner: 14px;
    --radius-pill:  100px;

    --font-display: 'Syne',    sans-serif;
    --font-body:    'DM Sans', sans-serif;

    --scale-gradient: linear-gradient(90deg,
    #4d6bfe 0%, #9b59f5 28%, #e040fb 50%, #f5a442 72%, #f5c842 100%);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-base);
    color:            var(--text-main);
    font-family:      var(--font-body);
    min-height:       100vh;
    overflow-x:       hidden;
}

/* ── Background ─────────────────────────────────────────────────────────── */
.bg-layer {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
#particles-canvas {
    position: absolute; inset: 0; opacity: .6;
}
.scanlines {
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg,
    transparent, transparent 3px,
    rgba(0,0,0,.04) 3px, rgba(0,0,0,.04) 4px);
}
.orb {
    position: absolute; border-radius: 50%;
    filter: blur(100px); pointer-events: none;
}
.orb-1 {
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, #4a1090 0%, transparent 70%);
    top: -20vh; left: -15vw; opacity: .6;
    animation: drift1 18s ease-in-out infinite alternate;
}
.orb-2 {
    width: 45vw; height: 45vw;
    background: radial-gradient(circle, #1a0a60 0%, transparent 70%);
    top: 40vh; right: -10vw; opacity: .5;
    animation: drift2 22s ease-in-out infinite alternate;
}
.orb-3 {
    width: 35vw; height: 35vw;
    background: radial-gradient(circle, #5c2a00 0%, transparent 70%);
    bottom: -5vh; left: 30vw; opacity: .3;
    animation: drift3 16s ease-in-out infinite alternate;
}
@keyframes drift1 { from{transform:translate(0,0)} to{transform:translate(40px,60px)} }
@keyframes drift2 { from{transform:translate(0,0)} to{transform:translate(-60px,-40px)} }
@keyframes drift3 { from{transform:translate(0,0)} to{transform:translate(30px,-50px)} }

/* ── Navigation ──────────────────────────────────────────────────────────── */
.nav {
    position: relative; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.6rem 5%; border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    background: rgba(13,10,26,.4);
}
.logo {
    font-family: var(--font-display); font-size: 1.4rem;
    font-weight: 800; letter-spacing: -.03em; text-decoration: none;
}
.logo-shuffl { color: var(--text-main); }
.logo-games  {
    background: linear-gradient(135deg, var(--purple-light), var(--pink));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-badge {
    font-family: var(--font-display); font-size: .7rem; font-weight: 700;
    letter-spacing: .15em; text-transform: uppercase; color: var(--text-muted);
    border: 1px solid var(--border); padding: .35rem .9rem;
    border-radius: var(--radius-pill); background: rgba(255,255,255,.03);
}

/* ── Shared tagline row ──────────────────────────────────────────────────── */
.tagline-row {
    display: flex; align-items: center; gap: 1rem;
    justify-content: center; margin-bottom: 1.5rem;
}
.tagline-line {
    display: block; height: 1px; width: 45px;
    background: linear-gradient(90deg, transparent, var(--gold));
}
.tagline-line:last-child { background: linear-gradient(90deg, var(--gold), transparent); }
.tagline-text {
    font-size: .72rem; font-weight: 500; letter-spacing: .18em;
    text-transform: uppercase; color: var(--gold);
}

/* ── Decorative rings ────────────────────────────────────────────────────── */
.hero-deco {
    position: fixed; right: 5%; bottom: 7%;
    width: 180px; height: 180px; z-index: 1; opacity: .12; pointer-events: none;
}
.deco-ring {
    position: absolute; border-radius: 50%;
    top: 50%; left: 50%; transform: translate(-50%,-50%);
    animation: spin linear infinite;
}
.ring-1 { width:100%; height:100%; border:1px solid var(--gold);   animation-duration:25s; }
.ring-2 { width:72%;  height:72%;  border:1px solid var(--orange); animation-duration:18s; animation-direction:reverse; opacity:.7; }
.ring-3 { width:45%;  height:45%;  border:1px solid var(--pink);   animation-duration:12s; opacity:.5; }
.deco-dot {
    position: absolute; width: 8px; height: 8px;
    background: var(--gold); border-radius: 50%;
    top: 50%; left: 50%; transform: translate(-50%,-50%);
    box-shadow: 0 0 16px var(--gold-glow), 0 0 40px var(--gold-glow);
}
@keyframes spin {
    from { transform: translate(-50%,-50%) rotate(0deg); }
    to   { transform: translate(-50%,-50%) rotate(360deg); }
}

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.input-group  { display: flex; flex-direction: column; gap: .45rem; }
.input-label  {
    font-size: .75rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-muted);
}
.hint-constraint { color: var(--text-dim); font-weight: 400; }
.input-field {
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: 12px; padding: .8rem 1rem; color: var(--text-main);
    font-family: var(--font-body); font-size: .95rem; font-weight: 400;
    outline: none; transition: border-color .25s, box-shadow .25s; width: 100%;
}
.input-field::placeholder { color: var(--text-dim); }
.input-field:focus {
    border-color: rgba(245,200,66,.4);
    box-shadow: 0 0 0 3px rgba(245,200,66,.1);
}
.code-input {
    text-transform: uppercase; letter-spacing: .2em; font-size: 1.05rem;
    font-family: var(--font-display); font-weight: 700; text-align: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary, .btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    font-family: var(--font-display); font-size: .88rem; font-weight: 700;
    letter-spacing: .02em; padding: .75rem 1.6rem;
    border-radius: var(--radius-pill); border: none; cursor: pointer; outline: none;
    transition: all .35s cubic-bezier(.16,1,.3,1); text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--orange));
    color: #0d0a1a; box-shadow: 0 4px 20px rgba(245,200,66,.25);
}
.btn-primary:hover:not(:disabled):not(.btn-disabled) {
    box-shadow: 0 8px 35px rgba(245,200,66,.5); transform: translateY(-2px);
}
.btn-secondary {
    background: rgba(155,89,245,.12); color: var(--purple-light);
    border: 1px solid rgba(155,89,245,.25);
}
.btn-secondary:hover {
    background: rgba(155,89,245,.22); border-color: var(--purple-light);
    transform: translateY(-2px);
}
.btn-full { width: 100%; }
.btn-disabled {
    opacity: .4; pointer-events: none;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
#status-toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(20px);
    z-index: 9999; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-pill);
    padding: .6rem 1.4rem; font-size: .85rem; color: var(--text-main);
    backdrop-filter: blur(24px); opacity: 0;
    transition: opacity .3s, transform .3s;
    box-shadow: 0 8px 30px rgba(0,0,0,.5); pointer-events: none;
}
#status-toast.show {
    opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ── Avatar picker (index + lobby creation) ──────────────────────────────── */
.avatar-block {
    display: flex; align-items: center; justify-content: center;
    gap: 1rem; margin: 1rem 0;
}
.avatar-preview {
    position: relative; width: 110px; height: 110px;
    border-radius: 50%; overflow: hidden;
    border: 2px solid var(--border-gold);
    box-shadow: 0 0 0 0 transparent;
    transition: box-shadow .35s;
    --glow-color: rgba(245,200,66,.5);
}
.avatar-preview:hover {
    box-shadow: 0 0 30px var(--glow-color);
}
.avatar-preview img {
    width: 100%; height: 100%; object-fit: cover;
    display: block;
}
.avatar-hint-labels {
    display: none; /* decorative only on mobile */
}
.arrow-col {
    display: flex; flex-direction: column; gap: .55rem;
}
.arrow-btn {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(245,200,66,.1); border: 1px solid rgba(245,200,66,.25);
    color: var(--gold); cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: all .2s; flex-shrink: 0;
}
.arrow-btn svg { width: 18px; height: 18px; fill: currentColor; }
.arrow-btn:hover {
    background: rgba(245,200,66,.25); transform: scale(1.12);
    box-shadow: 0 0 10px rgba(245,200,66,.3);
}

/* ══════════════════════════════════════════════════════════════════════════
   INDEX PAGE
══════════════════════════════════════════════════════════════════════════ */
.index-layout {
    position: relative; z-index: 10;
    display: flex; flex-direction: column; align-items: center;
    gap: 1.25rem;
    max-width: 1280px; margin: 0 auto;
    padding: 0 4% 4rem;
    min-height: calc(100vh - 73px);
    justify-content: center;
}

/* ── ① Hero ── */
.index-hero {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; width: 100%;
    max-width: 700px;
}
.game-wordmark {
    font-family: var(--font-display); font-size: clamp(4rem, 10vw, 7rem);
    font-weight: 800; letter-spacing: -.05em; line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, var(--gold) 45%, var(--orange) 75%, var(--pink) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 40px var(--gold-glow));
    padding: 0 .05em;
    margin-bottom: .3rem;
}
.game-provided-by { display: none; }
.game-wordmark-wrap { display: contents; }
.game-wordmark-badge { display: none; }
.game-sub {
    color: var(--text-muted); font-size: .85rem; font-weight: 300;
    margin-top: .9rem; margin-bottom: 0;
}
.hero-scale-wrap { width: min(860px, 100%); margin-top: .6rem; }
.hero-scale-labels {
    display: flex; justify-content: space-between;
    font-size: .62rem; color: var(--text-dim);
    letter-spacing: .1em; text-transform: uppercase;
    margin-bottom: .4rem;
}
.hero-scale-track {
    position: relative; height: 7px; border-radius: var(--radius-pill);
    background: var(--scale-gradient);
    box-shadow: 0 0 14px rgba(155,89,245,.5), 0 0 36px rgba(245,200,66,.15);
    overflow: visible;
}
.hero-scale-fill {
    position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.28) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: scaleSweep 2.8s ease-in-out infinite;
}
@keyframes scaleSweep {
    0%   { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}
.hero-scale-dot {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 15px; height: 15px; border-radius: 50%; margin-left: -7px;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,.2), 0 0 14px rgba(255,255,255,.9), 0 0 28px var(--gold-glow);
    animation: dotBounce 3.6s cubic-bezier(.45,0,.55,1) infinite alternate;
}
@keyframes dotBounce {
    0%   { left: 4%; }
    100% { left: 96%; }
}

/* ── ② Two equal cards ── */
.index-cards {
    width: 100%;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 1rem; align-items: stretch;
}
.index-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 1.75rem 2rem;
    backdrop-filter: blur(24px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    display: flex; flex-direction: column; gap: 1.25rem;
}
.index-card-room { justify-content: center; }
.index-card-label {
    font-family: var(--font-display); font-size: .65rem; font-weight: 700;
    letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted);
    text-align: center;
}
.room-actions { display: flex; flex-direction: column; gap: .85rem; width: 100%; }
.or-row {
    display: flex; align-items: center; gap: 1rem;
    color: var(--text-dim); font-size: .75rem;
}
.or-row::before, .or-row::after { content:''; flex:1; height:1px; background:var(--border); }
.join-box {
    display: flex; flex-direction: column; gap: .6rem;
    background: rgba(255,255,255,.025); border: 1px solid var(--border);
    border-radius: var(--radius-inner); padding: .9rem;
}

/* ── ③ Tutorial slider ── */
.index-tutorial {
    width: 100%;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 1.75rem 2rem;
    backdrop-filter: blur(24px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.slides-wrapper {
    position: relative; height: 96px; overflow: hidden;
    margin-bottom: 1.1rem;
}
.slide {
    position: absolute; inset: 0;
    display: flex; flex-direction: row; align-items: center;
    gap: 1.4rem; padding: 0 .25rem;
    opacity: 0; transform: translateX(18px);
    transition: opacity .38s ease, transform .38s ease;
    pointer-events: none;
}
.slide.active { opacity: 1; transform: translateX(0); pointer-events: auto; }
.slide-icon {
    font-size: 2.4rem; flex-shrink: 0; width: 52px; text-align: center;
    filter: drop-shadow(0 0 8px rgba(245,200,66,.3));
}
.slide-text h3 {
    font-family: var(--font-display); font-size: 1.05rem; font-weight: 800;
    margin-bottom: .3rem;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--gold) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.slide-text p { font-size: .85rem; color: var(--text-muted); line-height: 1.6; font-weight: 300; }
.slider-controls {
    display: flex; align-items: center; justify-content: center; gap: 1rem;
}
.nav-arrow {
    width: 34px; height: 34px; border-radius: 10px;
    background: rgba(255,255,255,.05); border: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
}
.nav-arrow:hover {
    background: rgba(245,200,66,.1); border-color: rgba(245,200,66,.3);
    color: var(--gold); transform: scale(1.08);
}
.nav-arrow svg { width: 18px; height: 18px; }
.dots-row { display: flex; gap: .5rem; align-items: center; }
.dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--text-dim); border: none; cursor: pointer;
    transition: all .3s;
}
.dot.active {
    background: var(--gold); width: 20px; border-radius: var(--radius-pill);
    box-shadow: 0 0 8px rgba(245,200,66,.5);
}

/* ══════════════════════════════════════════════════════════════════════════
   LOBBY PAGE
══════════════════════════════════════════════════════════════════════════ */

/* Back button */
.back-btn {
    position: fixed; top: 5rem; left: 1.5rem; z-index: 200;
    display: inline-flex; align-items: center; gap: .5rem;
    background: rgba(18,13,35,.85); border: 1px solid var(--border);
    border-radius: var(--radius-pill); padding: .5rem 1rem;
    color: var(--text-muted); font-size: .8rem; font-weight: 600;
    cursor: pointer; backdrop-filter: blur(16px);
    transition: all .25s;
}
.back-btn:hover { border-color: var(--border-gold); color: var(--gold); }

/* Creation overlay */
.lobby-creation-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(8,6,18,.92); backdrop-filter: blur(16px);
    display: flex; align-items: center; justify-content: center;
    padding: 2rem;
}
.lobby-creation-overlay.hidden { display: none; }
.creation-card {
    background: var(--bg-card); border: 1px solid var(--border-gold);
    border-radius: var(--radius-card); padding: 2.5rem 2rem;
    max-width: 460px; width: 100%;
    display: flex; flex-direction: column; gap: 1.5rem; align-items: center;
    box-shadow: 0 30px 80px rgba(0,0,0,.8), 0 0 50px rgba(245,200,66,.08);
}
.creation-title {
    font-family: var(--font-display); font-size: 1.6rem; font-weight: 800;
    background: linear-gradient(135deg, var(--text-main), var(--gold));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.creation-sub { color: var(--text-muted); font-size: .88rem; text-align: center; margin-top: -.75rem; }

/* Lobby wrap */
.lobby-wrap {
    position: relative; z-index: 10;
    max-width: 1100px; margin: 0 auto;
    padding: 0 5% 5rem;
    min-height: calc(100vh - 73px);
    display: flex; flex-direction: column;
    justify-content: center;
}

/* Top bar */
.lobby-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 0 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}
.topbar-code-block {
    display: flex; align-items: center; gap: .65rem;
}
.topbar-code-label {
    font-size: .62rem; font-weight: 700; letter-spacing: .18em;
    color: var(--text-dim); text-transform: uppercase;
}
.topbar-code-value {
    font-family: var(--font-display); font-size: 2rem; font-weight: 800;
    letter-spacing: .22em; color: var(--gold); line-height: 1;
    text-shadow: 0 0 30px rgba(245,200,66,.5);
}
.topbar-copy-btn {
    display: inline-flex; align-items: center; gap: .35rem;
    background: rgba(245,200,66,.08); border: 1px solid rgba(245,200,66,.2);
    border-radius: 8px; padding: .35rem .65rem;
    color: var(--gold); font-size: .72rem; font-weight: 600;
    cursor: pointer; transition: all .2s;
}
.topbar-copy-btn:hover { background: rgba(245,200,66,.18); }
.topbar-game-brand {
    font-family: var(--font-display); font-size: 1.4rem; font-weight: 800;
    letter-spacing: -.04em;
    background: linear-gradient(135deg, #fff 0%, var(--gold) 55%, var(--orange) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    opacity: .4;
}
.topbar-action { display: flex; align-items: center; }
.btn-launch {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--font-display); font-size: .88rem; font-weight: 700;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    color: #0d0a1a; border: none; border-radius: var(--radius-pill);
    padding: .7rem 1.6rem; cursor: pointer;
    box-shadow: 0 4px 24px rgba(245,200,66,.35);
    transition: all .3s;
}
.btn-launch:hover:not(:disabled) {
    box-shadow: 0 6px 36px rgba(245,200,66,.55); transform: translateY(-2px);
}
.btn-launch:disabled { opacity: .4; cursor: not-allowed; }
.topbar-waiting { font-size: .82rem; color: var(--text-dim); }

/* Content grid */
.lobby-content {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.75rem;
    padding-top: 1.75rem;
    align-items: start;
    flex: 1;
}

/* Sidebar */
.lobby-sidebar {
    display: flex; flex-direction: column; gap: 1rem;
    position: sticky; top: 1.5rem;
}
.sidebar-section-title {
    display: flex; align-items: center; gap: .4rem;
    font-family: var(--font-display); font-size: .68rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted);
}

.sidebar-host-card {
    background: var(--bg-card); border: 1px solid rgba(245,200,66,.2);
    border-radius: var(--radius-card); padding: 1.25rem 1.1rem;
    backdrop-filter: blur(24px);
    box-shadow: 0 0 30px rgba(245,200,66,.06), inset 0 1px 0 rgba(255,255,255,.04);
    display: flex; flex-direction: column; gap: 1rem;
}
.sidebar-host-header {
    display: flex; align-items: center; justify-content: space-between;
}
.sidebar-host-crown { font-size: 1.1rem; }
.sidebar-host-body {
    display: flex; align-items: center; gap: .85rem;
}
.sidebar-host-avatar {
    width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
    border: 2px solid rgba(245,200,66,.4);
    box-shadow: 0 0 16px rgba(245,200,66,.25);
    flex-shrink: 0;
}
.sidebar-host-name {
    font-family: var(--font-display); font-size: .95rem; font-weight: 800;
    color: var(--text-main);
}

.sidebar-me-card {
    background: rgba(155,89,245,.06); border: 1px solid rgba(155,89,245,.18);
    border-radius: var(--radius-inner); padding: .9rem 1.1rem;
    display: flex; align-items: center; gap: .75rem;
    backdrop-filter: blur(16px);
}
.sidebar-me-avatar {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
    border: 2px solid rgba(155,89,245,.35);
}
.sidebar-me-name { font-size: .88rem; font-weight: 500; color: var(--text-main); }
.sidebar-me-badge {
    font-size: .62rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--purple-light);
    background: rgba(155,89,245,.15); border: 1px solid rgba(155,89,245,.25);
    border-radius: var(--radius-pill); padding: .1rem .5rem;
    margin-left: auto;
}

.sidebar-settings-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 1.25rem 1.1rem;
    backdrop-filter: blur(24px);
    display: flex; flex-direction: column; gap: .6rem;
}
.setting-row {
    display: flex; align-items: center; gap: .7rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; padding-bottom: 0; }
.setting-row:first-of-type { padding-top: 0; }
.setting-icon { font-size: .95rem; flex-shrink: 0; width: 1.4rem; text-align: center; }
.setting-text { display: flex; flex-direction: column; gap: .05rem; flex: 1; }
.setting-key  { font-size: .68rem; color: var(--text-muted); letter-spacing: .05em; }
.setting-val  { font-size: .85rem; font-weight: 500; color: var(--text-main); }
.setting-stepper {
    display: flex; align-items: center; gap: .35rem; flex-shrink: 0;
}
.step-btn {
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(245,200,66,.1); border: 1px solid rgba(245,200,66,.25);
    color: var(--gold); font-size: .85rem; cursor: pointer; transition: all .2s;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}
.step-btn:hover { background: rgba(245,200,66,.25); }
.step-label {
    font-family: var(--font-display); font-size: .85rem; font-weight: 700;
    color: var(--gold); min-width: 1.6rem; text-align: center;
}

/* Players section */
.lobby-players-section { display: flex; flex-direction: column; gap: 1rem; }
.players-section-header {
    display: flex; align-items: baseline; gap: 1rem;
}
.players-section-label {
    font-family: var(--font-display); font-size: .72rem; font-weight: 700;
    letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted);
}
.players-section-hint { font-size: .72rem; color: var(--text-dim); }

/* Player grid */
.players-grid-new, .players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: .85rem;
}
.player-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-inner); padding: 1.25rem .85rem;
    display: flex; flex-direction: column; align-items: center; gap: .6rem;
    transition: border-color .25s, box-shadow .25s;
    backdrop-filter: blur(16px);
    animation: fadeUp .35s ease both;
}
.player-card.is-host  {
    border-color: rgba(245,200,66,.3);
    box-shadow: 0 0 20px rgba(245,200,66,.06);
}
.player-card.is-me {
    border-color: rgba(155,89,245,.3);
    box-shadow: inset 0 0 0 1px rgba(155,89,245,.15);
}
.player-card-avatar {
    width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--border);
    transition: border-color .25s;
}
.player-card.is-host .player-card-avatar { border-color: rgba(245,200,66,.5); }
.player-card.is-me   .player-card-avatar { border-color: rgba(155,89,245,.45); }
.player-card-name {
    font-size: .82rem; font-weight: 500; text-align: center;
    color: var(--text-main); word-break: break-word; line-height: 1.3;
}
.player-host-badge { font-size: .9rem; line-height: 1; }

/* Waiting dots (game page) */
.waiting-dots { display: flex; gap: .45rem; }
.waiting-dots span {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--purple-light); opacity: .3;
    animation: dot-pulse 1.4s ease-in-out infinite;
}
.waiting-dots span:nth-child(2) { animation-delay: .2s; }
.waiting-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dot-pulse {
    0%,80%,100% { opacity:.3; transform:scale(.8); }
    40%         { opacity:1;  transform:scale(1.15); }
}

/* ══════════════════════════════════════════════════════════════════════════
   GAME PAGE
══════════════════════════════════════════════════════════════════════════ */

/* Game header (sticky round + mini scores) */
.game-header {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 5%; gap: 1rem;
    background: rgba(13,10,26,.7); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.round-badge {
    font-family: var(--font-display); font-size: .88rem; font-weight: 700;
    color: var(--text-muted); white-space: nowrap;
}
.round-sep { margin: 0 .2em; color: var(--text-dim); }
.scores-mini {
    display: flex; gap: .55rem; flex-wrap: wrap; justify-content: flex-end;
}
.score-mini-item {
    display: flex; align-items: center; gap: .35rem;
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: var(--radius-pill); padding: .2rem .6rem;
    font-size: .75rem;
}
.score-mini-avatar {
    width: 20px; height: 20px; border-radius: 50%; object-fit: cover;
}
.score-mini-name { color: var(--text-muted); max-width: 65px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-mini-pts  { color: var(--gold); font-weight: 700; font-family: var(--font-display); }

/* Phase container */
.phase {
    position: relative; z-index: 10;
    display: flex; flex-direction: column; align-items: center;
    gap: 1.75rem; padding: 2rem 5% 4rem;
    width: 100%; max-width: 680px; margin: 0 auto;
    animation: fadeUp .45s cubic-bezier(.16,1,.3,1) both;
}

/* Role badge */
.phase-role-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    padding: .35rem 1rem; border-radius: var(--radius-pill); border: 1px solid;
}
.role-hint {
    color: var(--gold); background: rgba(245,200,66,.1);
    border-color: rgba(245,200,66,.3); box-shadow: 0 0 20px rgba(245,200,66,.1);
}

/* Category card */
.phase-category-card {
    background: var(--bg-card); border: 1px solid var(--border-bright);
    border-radius: var(--radius-card); padding: 1.4rem 2rem; text-align: center; width: 100%;
    backdrop-filter: blur(24px);
    box-shadow: 0 0 40px rgba(155,89,245,.1), inset 0 1px 0 rgba(255,255,255,.06);
}
.phase-category-card.compact { padding: .9rem 1.5rem; }
.cat-label {
    font-size: .68rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: .4rem;
}
.cat-name {
    font-family: var(--font-display); font-size: clamp(1.8rem,5vw,2.8rem);
    font-weight: 800; letter-spacing: -.03em;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--gold) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(245,200,66,.2));
}

/* Scale shared */
.scale-edge-labels {
    display: flex; justify-content: space-between;
    font-size: .72rem; font-weight: 500; color: var(--text-muted);
    margin-bottom: .5rem; padding: 0 2px;
}
.scale-bar-container { display: flex; flex-direction: column; gap: .6rem; width: 100%; }
.scale-bar, .reveal-scale-bar {
    position: relative; height: 52px; border-radius: var(--radius-pill);
    overflow: visible; user-select: none;
}
.scale-gradient-fill {
    position: absolute; inset: 0; border-radius: inherit;
    background: var(--scale-gradient);
    border: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 0 30px rgba(155,89,245,.2);
}
.scale-numbers-row {
    position: relative; height: 20px;
    font-size: .72rem; color: var(--text-dim); pointer-events: none;
}
.scale-num { position: absolute; transform: translateX(-50%); user-select: none; transition: color .2s; }
.scale-num.active { color: var(--gold); font-weight: 700; }

/* Target marker (hint-giver view) */
.target-scale-wrap { width: 100%; }
.target-marker {
    position: absolute; top: 50%; transform: translate(-50%,-50%);
    z-index: 10; pointer-events: none;
    animation: target-appear .6s cubic-bezier(.16,1,.3,1) both;
}
@keyframes target-appear {
    from { opacity:0; transform:translate(-50%,-50%) scale(.5); }
    to   { opacity:1; transform:translate(-50%,-50%) scale(1); }
}
.target-pin {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--gold); border: 3px solid #fff;
    box-shadow: 0 0 0 6px rgba(245,200,66,.35), 0 0 30px var(--gold-glow);
}
.target-val-label {
    position: absolute; top: -38px; left: 50%; transform: translateX(-50%);
    background: var(--gold); color: #0d0a1a;
    font-family: var(--font-display); font-size: 1.1rem; font-weight: 800;
    padding: .2rem .6rem; border-radius: 8px; white-space: nowrap;
    box-shadow: 0 4px 16px rgba(245,200,66,.4);
}
.target-val-label::after {
    content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--gold);
}

/* Hint input */
.hint-input-wrap { width: 100%; display: flex; flex-direction: column; gap: .6rem; }
.hint-input-row  { display: flex; gap: .75rem; }
.hint-input-row .input-field { flex: 1; }

/* Waiting for hint giver */
.waiting-block {
    display: flex; flex-direction: column; align-items: center; gap: .65rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 2rem; width: 100%;
    backdrop-filter: blur(24px);
}
.waiting-avatar-wrap {
    width: 72px; height: 72px; border-radius: 50%;
    border: 2px solid var(--border-gold);
    overflow: hidden; box-shadow: 0 0 24px rgba(245,200,66,.3);
}
.waiting-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.waiting-name  { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; }
.waiting-sub   { color: var(--text-muted); font-size: .88rem; }
.scale-preview-wrap { width: 100%; }

/* Hint reveal */
.hint-reveal-block {
    background: var(--bg-card); border: 1px solid rgba(245,200,66,.25);
    border-radius: var(--radius-card); padding: 1.5rem 2rem; text-align: center; width: 100%;
    box-shadow: 0 0 40px rgba(245,200,66,.1), inset 0 1px 0 rgba(245,200,66,.1);
}
.hint-reveal-block.compact { padding: 1rem 1.5rem; }
.hint-reveal-label {
    font-size: .68rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
    color: var(--gold); margin-bottom: .4rem;
}
.hint-reveal-word {
    font-family: var(--font-display); font-size: clamp(2rem,6vw,3.5rem);
    font-weight: 800; letter-spacing: -.04em; color: var(--text-main);
    filter: drop-shadow(0 0 30px var(--gold-glow));
    animation: hint-pop .5s cubic-bezier(.16,1,.3,1) both;
}
@keyframes hint-pop {
    from { opacity:0; transform:scale(.8); }
    to   { opacity:1; transform:scale(1); }
}

/* Guess slider */
.guess-scale-wrap { width: 100%; display: flex; flex-direction: column; gap: .6rem; }
.interactive { cursor: pointer; }
.guess-handle {
    position: absolute; top: 50%; transform: translate(-50%,-50%);
    width: 36px; height: 36px; border-radius: 50%;
    background: #fff; z-index: 10;
    box-shadow: 0 0 0 4px rgba(245,200,66,.6), 0 4px 20px rgba(0,0,0,.5);
    cursor: grab; transition: box-shadow .15s, width .15s, height .15s;
    display: flex; align-items: center; justify-content: center;
}
.guess-handle:active { cursor: grabbing; width: 42px; height: 42px; }
.handle-value {
    font-family: var(--font-display); font-size: .9rem; font-weight: 800;
    color: #0d0a1a; pointer-events: none; line-height: 1;
}
.selected-val-display {
    text-align: center; margin-top: .3rem;
    display: flex; align-items: baseline; justify-content: center; gap: .4rem;
}
.selected-val-num {
    font-family: var(--font-display); font-size: 3.5rem; font-weight: 800;
    color: var(--gold); line-height: 1;
    filter: drop-shadow(0 0 20px var(--gold-glow));
}
.selected-val-unit { font-size: 1.1rem; color: var(--text-muted); font-weight: 300; }

/* Watching / progress */
.watching-hint-block {
    background: var(--bg-card); border: 1px solid rgba(245,200,66,.25);
    border-radius: var(--radius-card); padding: 1.5rem 2rem; text-align: center; width: 100%;
}
.progress-block { width: 100%; display: flex; flex-direction: column; gap: .6rem; }
.progress-label { font-size: .82rem; color: var(--text-muted); text-align: center; }
.progress-track {
    height: 6px; border-radius: var(--radius-pill);
    background: rgba(255,255,255,.07); overflow: hidden; border: 1px solid var(--border);
}
.progress-fill {
    height: 100%; border-radius: inherit;
    background: linear-gradient(90deg, var(--purple), var(--gold));
    transition: width .4s ease; box-shadow: 0 0 12px rgba(245,200,66,.4);
}
.watching-note { font-size: .82rem; color: var(--green); font-weight: 500; }

/* Reveal scale */
.reveal-top {
    display: flex; gap: 1rem; width: 100%; flex-wrap: wrap;
}
.reveal-top > * { flex: 1; min-width: 180px; }
.reveal-scale-wrap { width: 100%; }
.reveal-scale-bar  { position: relative; height: 64px; border-radius: var(--radius-pill); overflow: visible; }

/* Score zones */
.score-zone {
    position: absolute; top: 0; bottom: 0; border-radius: inherit;
    pointer-events: none; z-index: 2;
    animation: zone-appear .4s ease both;
}
@keyframes zone-appear {
    from { opacity:0; transform:scaleX(.3); }
    to   { opacity:1; transform:scaleX(1); }
}

/* Target arrow */
.target-arrow {
    position: absolute; bottom: calc(100% + 6px);
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
    z-index: 20; animation: target-drop .6s cubic-bezier(.16,1,.3,1) .3s both;
}
@keyframes target-drop {
    from { opacity:0; transform:translateX(-50%) translateY(-20px); }
    to   { opacity:1; transform:translateX(-50%) translateY(0); }
}
.target-arrow-label {
    background: var(--gold); color: #0d0a1a;
    font-family: var(--font-display); font-size: 1.1rem; font-weight: 800;
    padding: .2rem .65rem; border-radius: 8px;
    box-shadow: 0 0 20px var(--gold-glow);
}
.target-arrow-stem  { width: 2px; height: 12px; background: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.target-arrow-head  {
    width: 14px; height: 14px; border-radius: 50%; background: var(--gold);
    box-shadow: 0 0 16px var(--gold-glow), 0 0 30px var(--gold-glow);
}

/* Player markers on reveal scale */
.player-marker {
    position: absolute; top: calc(100% + 8px);
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    z-index: 15; animation: marker-rise .45s cubic-bezier(.16,1,.3,1) both;
}
@keyframes marker-rise {
    from { opacity:0; transform:translateX(-50%) translateY(12px); }
    to   { opacity:1; transform:translateX(-50%) translateY(0); }
}
.marker-avatar-wrap {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2px solid var(--gold); overflow: hidden;
    box-shadow: 0 0 10px var(--gold-glow);
}
.marker-avatar { width: 100%; height: 100%; object-fit: cover; }
.marker-name   { font-size: .65rem; color: var(--text-muted); white-space: nowrap; }
.marker-val    { font-family: var(--font-display); font-size: .8rem; font-weight: 700; }

/* Round score rows */
.round-scores-block {
    width: 100%; display: flex; flex-direction: column; gap: .6rem;
    margin-top: 3.5rem;
}
.score-row {
    display: flex; align-items: center; gap: .9rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-inner); padding: .75rem 1.1rem;
    animation: fadeUp .4s ease both;
}
.score-row.is-hint-giver { border-color: rgba(245,200,66,.25); }
.score-row-avatar-img {
    width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
    border: 2px solid;  flex-shrink: 0;
}
.score-row-info  { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: .1rem; }
.score-row-name  { font-size: .88rem; font-weight: 500; }
.score-row-role  { font-size: .7rem; color: var(--gold); letter-spacing: .06em; }
.score-row-guess { font-size: .72rem; color: var(--text-muted); }
.score-row-pts   { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; min-width: 2.5rem; text-align: right; }
.score-row-pts.high { color: var(--gold); filter: drop-shadow(0 0 8px var(--gold-glow)); }
.score-row-pts.mid  { color: var(--green); }
.score-row-pts.low  { color: var(--text-muted); }
.score-row-total { font-size: .78rem; color: var(--text-muted); white-space: nowrap; min-width: 52px; text-align: right; }

.reveal-actions {
    display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
    width: 100%; margin-top: .5rem;
}

/* Game over */
.gameover-layout {
    display: flex; flex-direction: column; align-items: center;
    gap: 1.5rem; max-width: 500px; width: 100%; text-align: center;
}
.gameover-crown { font-size: 4rem; filter: drop-shadow(0 0 20px rgba(245,200,66,.5)); }
.gameover-title {
    font-family: var(--font-display); font-size: clamp(2rem,5vw,3rem);
    font-weight: 800; letter-spacing: -.03em;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--gold) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.gameover-sub   { color: var(--text-muted); font-size: .9rem; }
.gameover-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

.leaderboard { width: 100%; display: flex; flex-direction: column; gap: .6rem; }
.leaderboard-row {
    display: flex; align-items: center; gap: 1rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-inner); padding: .85rem 1.25rem;
    animation: fadeUp .4s ease both;
}
.leaderboard-row.rank-1 { border-color: rgba(245,200,66,.4); box-shadow: 0 0 30px rgba(245,200,66,.08); }
.leaderboard-row.rank-2 { border-color: rgba(180,180,180,.2); }
.leaderboard-row.rank-3 { border-color: rgba(200,130,60,.2); }
.rank-number   { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; color: var(--text-dim); min-width: 1.8rem; }
.rank-1 .rank-number { color: var(--gold); }
.leaderboard-avatar-img {
    width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
    border: 2px solid rgba(255,255,255,.15); flex-shrink: 0;
}
.leaderboard-name  { flex: 1; font-size: .92rem; font-weight: 500; text-align: left; }
.leaderboard-score { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; color: var(--gold); }


/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .index-cards    { grid-template-columns: 1fr; }
    .lobby-content  { grid-template-columns: 1fr; }
    .lobby-sidebar  { position: static; flex-direction: row; flex-wrap: wrap; }
    .sidebar-host-card, .sidebar-me-card, .sidebar-settings-card { flex: 1; min-width: 200px; }
    .hint-input-row { flex-direction: column; }
    .reveal-top     { flex-direction: column; }
    .round-scores-block { margin-top: 4.5rem; }
    .back-btn       { top: auto; bottom: 1.5rem; }
    .topbar-game-brand { display: none; }
    .slides-wrapper { height: 120px; }
}
@media (max-width: 480px) {
    .game-wordmark  { font-size: 3.2rem; }
    .creation-card  { padding: 1.75rem 1.25rem; }
    .players-grid-new, .players-grid { grid-template-columns: repeat(3,1fr); }
    .scale-bar, .reveal-scale-bar { height: 44px; }
    .selected-val-num { font-size: 2.8rem; }
    .topbar-code-value { font-size: 1.5rem; }
    .index-card     { padding: 1.25rem; }
    .slides-wrapper { height: 140px; }
}