/* ============================================
   WHISPER - Design Inspirado no Gartic Phone
   Colorido, Ilustrado e Moderno
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paleta Vibrante Gartic Phone */
    --purple-primary: #8B5CF6;
    --purple-dark: #6D28D9;
    --purple-light: #A78BFA;
    --blue-primary: #3B82F6;
    --blue-light: #60A5FA;
    --green-primary: #10B981;
    --green-light: #34D399;
    --orange-primary: #F59E0B;
    --orange-light: #FBBF24;
    --pink-primary: #EC4899;
    --pink-light: #F472B6;
    --red-primary: #EF4444;
    --yellow-primary: #EAB308;
    
    /* Backgrounds */
    --bg-main: #F3F4F6;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-hover: #F9FAFB;
    
    /* Borders */
    --border-light: #E5E7EB;
    --border-medium: #D1D5DB;
    --border-dark: #9CA3AF;
    
    /* Text */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --text-white: #FFFFFF;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Design do test4e.html */
    --bg0: #14162a;
    --bg1: #1b1f3c;
    --glass: rgba(255,255,255,.07);
    --stroke: rgba(255,255,255,.12);
    --shadow-dark: 0 18px 45px rgba(0,0,0,.35);
    --text: #F2F1FF;
    --text-light: #F2F1FF;
    --dim: #AAB1D6;
    --accent: #7C5CFF;
    --warm: #FFC857;
    --good: #2EE59D;
    --ok: #4DFFA7;
    --bad: #FF4D6D;
    --radius: 18px;
    --radius-lg: 28px;
    --focus: rgba(124,92,255,.35);
    --nav-h: 72px;
    --scrollbar: rgba(255,255,255,.14);
    --scrollbar-hover: rgba(255,255,255,.22);
}

/* ============================================
   BASE
   ============================================ */

body {
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--text-light);
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* body::before removido - cada tela tem seu próprio fundo */

/* ============================================
   LAYOUT
   ============================================ */

.screen {
    display: none !important;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

.screen.active {
    display: block !important;
    z-index: 10;
}

/* Telas específicas com padding e flex */
#homeScreen.active {
    display: block !important;
    min-height: 100vh;
    overflow-y: auto;
}

#lobbyScreen.active {
    display: block !important;
    min-height: 100vh;
    overflow-y: auto;
}

#roundCompleteScreen.active,
#votingScreen.active,
#resultsScreen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    min-height: 100vh;
}

/* Garantir que o container permita scroll quando necessário */
#lobbyScreen.active .container,
#roundCompleteScreen.active .container,
#votingScreen.active .container,
#resultsScreen.active .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ============================================
   TIPOGRAFIA
   ============================================ */

.title:not(#lobbyScreen .title):not(#homeScreen .title) {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--blue-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    text-align: center;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.logo {
    text-align: center;
    margin-bottom: 64px;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--yellow-primary);
    border-radius: 2px;
}

/* ============================================
   BOTÕES
   ============================================ */

.btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--blue-primary) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

/* ============================================
   INPUTS E FORMULÁRIOS
   ============================================ */

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* ============================================
   GAME SCREEN
   ============================================ */

#gameScreen {
    background:
        radial-gradient(900px 540px at 15% 10%, rgba(124,92,255,.22), transparent 60%),
        radial-gradient(820px 520px at 90% 25%, rgba(255,200,87,.10), transparent 60%),
        linear-gradient(180deg, var(--bg0), var(--bg1));
    padding: 0;
    display: none !important;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#gameScreen.active {
    display: flex !important;
    z-index: 10;
}

#finalVictoryScreen {
    background:
        radial-gradient(900px 540px at 15% 10%, rgba(124,92,255,.22), transparent 60%),
        radial-gradient(820px 520px at 90% 25%, rgba(255,200,87,.10), transparent 60%),
        linear-gradient(180deg, var(--bg0), var(--bg1));
    padding: 0;
    display: none !important;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    color: var(--text);
    min-height: 100vh;
}

#finalVictoryScreen.active {
    display: flex !important;
    z-index: 10;
}

/* Top Nav */
.top-nav {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(10,12,26,.25);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.top-nav .logo {
    font-weight: 900;
    font-size: 1.25rem;
    text-align: left;
    margin-bottom: 0;
    position: static;
}

.top-nav .logo::after {
    display: none;
}

.top-nav .meta {
    display: flex;
    gap: 10px;
    font-weight: 800;
    font-size: .85rem;
}

.top-nav .pill {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
}

/* Game Container */
.game-container {
    display: grid;
    grid-template-columns: 300px 1fr 320px;
    gap: 16px;
    padding: 16px;
    height: calc(100vh - 70px);
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.glass {
    background: var(--glass);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    box-shadow: var(--shadow-dark);
    backdrop-filter: blur(14px);
}

.action-card.glass::before {
    content: "";
    position: absolute;
    inset: -2px;
    background:
        radial-gradient(900px 240px at 50% 0%, rgba(124,92,255,.14), transparent 55%),
        radial-gradient(700px 240px at 15% 30%, rgba(255,200,87,.10), transparent 60%);
    pointer-events: none;
    opacity: .95;
    z-index: 0;
    border-radius: var(--radius-lg);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

.info-box {
    padding: 16px;
}

.info-box h3 {
    font-size: .9rem;
    text-transform: uppercase;
    color: var(--warm);
    margin-bottom: 8px;
    font-weight: 900;
}

.info-box .subtext {
    font-size: .85rem;
    color: var(--dim);
}

.players {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 6px;
}

.players::-webkit-scrollbar {
    width: 8px;
}

.players::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.12);
    border-radius: 999px;
}

.player-row {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    align-items: center;
}

.player-row.active {
    background: rgba(124,92,255,.12);
    border-color: rgba(124,92,255,.55);
}

.player-row.voted {
    border-color: rgba(46,229,157,.40);
}

.player-row.my-vote {
    background: rgba(255,77,109,.15);
    border-color: rgba(255,77,109,.35);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(124,92,255,.85);
    flex: 0 0 auto;
    font-weight: 900;
}

.player-name {
    font-weight: 900;
    flex: 1;
    min-width: 0;
}

.player-name .you-label {
    color: var(--warm);
    font-weight: 900;
    font-size: 0.9em;
    text-shadow: 0 0 8px rgba(255, 200, 87, 0.5);
    margin-left: 4px;
}

.player-state {
    font-size: .8rem;
    color: var(--dim);
}

.player-state.turn {
    color: var(--warm);
    font-weight: 900;
}

.player-voted {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(46,229,157,.20);
    border: 1px solid rgba(46,229,157,.40);
    display: grid;
    place-items: center;
    color: var(--good);
    font-weight: 900;
    font-size: .9rem;
    flex: 0 0 auto;
}

/* Play Zone */
.play-zone {
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-card {
    width: min(760px, 100%);
    padding: 38px 32px 28px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.action-card:has(.vote-wrap:not(.hidden)) {
    padding: 28px 26px 22px;
    max-height: calc(100vh - 70px - 32px);
    overflow-y: auto;
    overflow-x: hidden;
}

.action-card:has(.vote-wrap:not(.hidden)) .word-wrap,
.action-card:has(.vote-wrap:not(.hidden)) .hint-input,
.action-card:has(.vote-wrap:not(.hidden)) .timer-wrap {
    display: none;
}

.word-wrap {
    text-align: center;
    margin-bottom: 18px;
}

.topic-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    font-weight: 900;
    font-size: .82rem;
    margin-bottom: 14px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warm);
    flex-shrink: 0;
}

.word-display {
    font-size: 3.4rem;
    font-weight: 900;
}

.word-sub {
    color: var(--dim);
}

.impostor-warning {
    margin-top: 16px;
    padding: 20px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,77,109,.25), rgba(255,77,109,.15));
    border: 2px solid rgba(255,77,109,.60);
    box-shadow: 0 8px 24px rgba(255,77,109,.20), inset 0 1px 0 rgba(255,255,255,.08);
    position: relative;
    overflow: hidden;
}

.impostor-warning::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,77,109,.8), rgba(255,77,109,.4));
    border-radius: 18px 18px 0 0;
}

.impostor-warning p {
    margin: 6px 0;
    font-weight: 900;
    color: var(--text-light);
    text-shadow: 0 2px 8px rgba(255,77,109,.4);
    position: relative;
    z-index: 1;
}

.impostor-warning p:first-child {
    font-size: 1.1rem;
    color: rgba(255,200,200,1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.impostor-warning.hidden {
    display: none;
}

.hint-input {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(10,12,26,.18);
    color: var(--text);
    text-align: center;
    outline: none;
}

.hint-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hint-input::placeholder {
    color: rgba(170,177,214,.65);
    font-weight: 700;
}

.timer-wrap {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    align-items: center;
}

.timer-pill {
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    font-weight: 900;
}

.timer-track {
    flex: 1;
    height: 10px;
    background: rgba(255,255,255,.07);
    border-radius: 999px;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--warm), var(--accent));
    transition: width 0.3s ease;
}

/* Removido - sempre usar gradiente padrão */

/* Controls */
.controls {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.history-panel {
    height: 100%;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel-title {
    font-weight: 900;
    margin-bottom: 12px;
    font-size: 1rem;
}

.history {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 6px;
}

.history::-webkit-scrollbar {
    width: 8px;
}

.history::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.12);
    border-radius: 999px;
}

.history-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
}

.history-left {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(124,92,255,.18);
    flex: 0 0 auto;
    font-weight: 900;
}

.history-meta {
    flex: 1;
    min-width: 0;
}

.history-name {
    font-weight: 900;
    font-size: .92rem;
    margin-bottom: 2px;
}

.history-hint {
    font-size: .92rem;
    color: var(--dim);
}

.history-time {
    margin-left: auto;
    font-size: .78rem;
    color: var(--dim);
    font-weight: 800;
    white-space: nowrap;
}

/* Vote Result Container */
.vote-result-container.hidden,
.vote-wrap.hidden {
    display: none;
}

.vote-wrap {
    padding: 0;
    position: relative;
    z-index: 1;
}

.vote-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.vote-title {
    flex: 1;
}

.badge {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    font-weight: 900;
    font-size: .82rem;
    margin-bottom: 16px;
}

.headline {
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 10px;
    line-height: 1.3;
}

.accused-name {
    color: var(--warm);
    font-weight: 900;
}

.subtitle {
    color: var(--dim);
    font-size: .92rem;
    line-height: 1.5;
    margin-top: 4px;
}

.status-pill {
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 900;
    font-size: .85rem;
    white-space: nowrap;
}

.status-pill.good {
    background: rgba(46,229,157,.15);
    border: 1px solid rgba(46,229,157,.30);
    color: var(--good);
}

.status-pill.bad {
    background: rgba(255,77,109,.15);
    border: 1px solid rgba(255,77,109,.30);
    color: var(--bad);
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.result-box {
    padding: 20px 18px;
    border-radius: 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
}

.result-box h4 {
    font-size: .95rem;
    font-weight: 900;
    margin-bottom: 16px;
    color: var(--text-light);
}

.callout {
    display: flex;
    gap: 14px;
    padding: 16px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    margin-top: 14px;
}

.callout .icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(124,92,255,.18);
    border: 1px solid rgba(124,92,255,.22);
    flex: 0 0 auto;
    font-size: 1.2rem;
}

.callout.warn .icon {
    background: rgba(255,200,87,.18);
    border-color: rgba(255,200,87,.22);
}

.bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bar-row {
    padding: 16px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
}

.bar-row.win {
    background: rgba(46,229,157,.10);
    border-color: rgba(46,229,157,.25);
}

.bar-left {
    flex: 1;
}

.bar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bar-name {
    font-weight: 900;
    font-size: .9rem;
}

.bar-count {
    font-weight: 800;
    font-size: .85rem;
    color: var(--dim);
}

.track {
    height: 8px;
    background: rgba(255,255,255,.07);
    border-radius: 999px;
    overflow: hidden;
}

.track .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--warm), var(--accent));
    transition: width 0.3s ease;
}

.vote-tag {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    font-weight: 900;
    font-size: .78rem;
    white-space: nowrap;
}

.vote-tag.win {
    border-color: rgba(255, 200, 87, 0.28);
    background: rgba(255, 200, 87, 0.10);
    color: rgba(242, 241, 255, 0.95);
}

.next-round-countdown {
    margin-top: 14px;
    text-align: center;
    padding: 12px;
    border-radius: 16px;
    background: rgba(124,92,255,.10);
    border: 1px solid rgba(124,92,255,.22);
}

/* ============================================
   HOME SCREEN - Design do home.html
   ============================================ */

#homeScreen {
    background:
        radial-gradient(900px 540px at 12% 8%, rgba(124,92,255,.26), transparent 60%),
        radial-gradient(820px 520px at 92% 22%, rgba(255,200,87,.12), transparent 60%),
        radial-gradient(720px 420px at 75% 92%, rgba(46,229,157,.09), transparent 60%),
        linear-gradient(180deg, var(--bg0), var(--bg1));
    min-height: 100vh;
}

#homeScreen::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
    opacity: .25;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 0;
}

#homeScreen .app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

#homeScreen .top-nav {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: rgba(10,12,26,.28);
    border-bottom: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(14px);
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 50;
}

#homeScreen .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
    min-width: 0;
}

#homeScreen .sigil {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(124,92,255,.9), rgba(255,200,87,.28));
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 14px 35px rgba(0,0,0,.35);
    font-weight: 900;
    letter-spacing: .02em;
    flex: 0 0 auto;
}

#homeScreen .brand-title {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    min-width: 0;
}

#homeScreen .brand-title b {
    font-size: 1.05rem;
    letter-spacing: .12em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#homeScreen .brand-title span {
    font-size: .82rem;
    color: var(--dim);
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#homeScreen .content-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    position: relative;
    padding: 18px;
    scrollbar-gutter: stable both-edges;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#homeScreen .content-scroll::-webkit-scrollbar {
    width: 10px;
}

#homeScreen .content-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.14);
    border-radius: 999px;
    border: 2px solid rgba(0,0,0,0);
    background-clip: padding-box;
}

#homeScreen .content-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.22);
    background-clip: padding-box;
}

#homeScreen .content-scroll::-webkit-scrollbar-track {
    background: rgba(255,255,255,.06);
    border-radius: 999px;
}

#homeScreen .scroll-fade {
    pointer-events: none;
    position: sticky;
    left: 0;
    right: 0;
    height: 18px;
    z-index: 40;
}

#homeScreen .scroll-fade.top {
    top: 0;
    background: none;
}


#homeScreen .hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 18px;
    min-height: calc(100vh - 72px - 36px);
    padding: 6px 0;
}

#homeScreen .left {
    position: relative;
    padding: 28px;
    overflow: hidden;
    min-height: 0;
}

#homeScreen .left::after {
    content: "";
    position: absolute;
    inset: -2px;
    background:
        radial-gradient(520px 260px at 20% 20%, rgba(124,92,255,.18), transparent 60%),
        radial-gradient(520px 260px at 80% 60%, rgba(255,200,87,.12), transparent 62%);
    pointer-events: none;
}

#homeScreen .shine {
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    right: -220px;
    top: -220px;
    background: radial-gradient(circle at 30% 30%, rgba(124,92,255,.22), transparent 60%);
    filter: blur(2px);
    pointer-events: none;
}

#homeScreen .kicker {
    position: relative;
    display: inline-flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(10,12,26,.18);
    font-weight: 900;
    font-size: .84rem;
    color: var(--dim);
    margin-bottom: 16px;
    user-select: none;
}

#homeScreen .kicker i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(124,92,255,.12);
    display: inline-block;
}

#homeScreen .headline {
    position: relative;
    font-size: clamp(2rem, 3.2vw, 3.1rem);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -.02em;
    margin-bottom: 12px;
    text-align: left;
}

#homeScreen .headline .warm {
    color: var(--warm);
}

#homeScreen .sub {
    position: relative;
    max-width: 62ch;
    font-size: 1.02rem;
    color: var(--dim);
    line-height: 1.55;
    margin-bottom: 20px;
    text-align: left;
}

#homeScreen .sub b {
    font-weight: 900;
}

#homeScreen .feature-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
    margin-top: 12px;
}

#homeScreen .feature {
    padding: 14px 14px 12px;
    border-radius: 18px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 108px;
}

#homeScreen .feature .ic {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(124,92,255,.14);
    border: 1px solid rgba(124,92,255,.22);
    font-size: 1.1rem;
}

#homeScreen .feature b {
    font-weight: 900;
}

#homeScreen .feature p {
    color: var(--dim);
    font-size: .88rem;
    line-height: 1.35;
}

#homeScreen .preview {
    position: relative;
    margin-top: 16px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(10,12,26,.16);
    border: 1px solid rgba(255,255,255,.08);
    overflow: hidden;
}

#homeScreen .preview-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

#homeScreen .mini-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

#homeScreen .mini {
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    font-weight: 900;
    font-size: .78rem;
    color: var(--text);
    user-select: none;
}

#homeScreen .mini strong {
    color: var(--warm);
}

#homeScreen .mock {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

#homeScreen .bubble {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.05);
}

#homeScreen .bubble .a {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(124,92,255,.18);
    border: 1px solid rgba(124,92,255,.22);
    flex: 0 0 auto;
    font-weight: 900;
}

#homeScreen .bubble .t {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

#homeScreen .bubble .t b {
    font-weight: 900;
}

#homeScreen .bubble .t span {
    color: var(--dim);
    font-size: .92rem;
    line-height: 1.25;
}

#homeScreen .right {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}

#homeScreen .card {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    text-align: left;
}

#homeScreen .card h2 {
    font-size: 1.05rem;
    letter-spacing: .02em;
    font-weight: 900;
    margin-bottom: 6px;
    color: var(--text);
}

#homeScreen .card .muted {
    color: var(--dim);
    font-size: .92rem;
    line-height: 1.4;
    margin-bottom: 14px;
}

#homeScreen .btn {
    width: 100%;
    border: 0;
    cursor: pointer;
    font-weight: 900;
    letter-spacing: .02em;
    border-radius: 16px;
    padding: 14px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text);
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
    user-select: none;
}

#homeScreen .btn:hover {
    transform: translateY(-1px);
}

#homeScreen .btn:active {
    transform: translateY(0px);
}

#homeScreen .btn.primary {
    background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(124,92,255,.55));
    border-color: rgba(124,92,255,.55);
    box-shadow: 0 14px 35px rgba(124,92,255,.18);
}

#homeScreen .btn.warm {
    background: linear-gradient(135deg, rgba(255,200,87,.92), rgba(255,200,87,.40));
    border-color: rgba(255,200,87,.55);
    color: #1a1630;
    text-shadow: 0 1px 0 rgba(255,255,255,.18);
    box-shadow: 0 14px 35px rgba(255,200,87,.14);
}

#homeScreen .field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

#homeScreen label {
    font-size: .82rem;
    color: var(--dim);
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

#homeScreen input {
    width: 100%;
    padding: 14px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(10,12,26,.20);
    color: var(--text);
    outline: none;
    transition: box-shadow .12s ease, border-color .12s ease, background .12s ease;
}

#homeScreen input::placeholder {
    color: rgba(170,177,214,.65);
    font-weight: 700;
}

#homeScreen input:focus {
    border-color: rgba(124,92,255,.55);
    box-shadow: 0 0 0 4px var(--focus);
    background: rgba(10,12,26,.26);
}

#homeScreen .hint {
    color: rgba(170,177,214,.85);
    font-size: .86rem;
    line-height: 1.35;
    margin-top: 8px;
}

#homeScreen .fineprint {
    margin-top: 10px;
    color: rgba(170,177,214,.75);
    font-size: .82rem;
    line-height: 1.45;
}

#homeScreen .status {
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    position: relative;
    text-align: left;
}

#homeScreen .status::before {
    content: "";
    position: absolute;
    inset: auto -40px -90px auto;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,200,87,.18), transparent 60%);
    pointer-events: none;
    filter: blur(1px);
}

#homeScreen .status h3 {
    font-size: .95rem;
    font-weight: 900;
    letter-spacing: .02em;
    color: var(--text);
}

#homeScreen .status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
}

#homeScreen .status-row b {
    font-weight: 900;
}

#homeScreen .tag {
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    font-weight: 900;
    font-size: .78rem;
    white-space: nowrap;
}

#homeScreen .tag.good {
    border-color: rgba(46,229,157,.30);
    background: rgba(46,229,157,.10);
}

#homeScreen .tag.warm {
    border-color: rgba(255,200,87,.30);
    background: rgba(255,200,87,.10);
}

@media (max-width: 1100px) {
    #homeScreen .hero {
        grid-template-columns: 1fr;
        min-height: unset;
    }
    #homeScreen .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   LOBBY SCREEN - Design do new_room.html
   ============================================ */

#lobbyScreen {
    background:
        radial-gradient(900px 540px at 12% 8%, rgba(124,92,255,.26), transparent 60%),
        radial-gradient(820px 520px at 92% 22%, rgba(255,200,87,.12), transparent 60%),
        radial-gradient(720px 420px at 75% 92%, rgba(46,229,157,.09), transparent 60%),
        linear-gradient(180deg, var(--bg0), var(--bg1));
    min-height: 100vh;
    height: 100vh;
}

#lobbyScreen::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
    opacity: .25;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 0;
}

#lobbyScreen .app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

#lobbyScreen .top-nav {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: rgba(10,12,26,.28);
    border-bottom: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(14px);
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 50;
}

#lobbyScreen .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
    min-width: 0;
}

#lobbyScreen .sigil {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(124,92,255,.9), rgba(255,200,87,.28));
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 14px 35px rgba(0,0,0,.35);
    font-weight: 900;
    letter-spacing: .02em;
    flex: 0 0 auto;
}

#lobbyScreen .brand-title {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    min-width: 0;
}

#lobbyScreen .brand-title b {
    font-size: 1.05rem;
    letter-spacing: .12em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#lobbyScreen .brand-title span {
    font-size: .82rem;
    color: var(--dim);
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#lobbyScreen .nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#lobbyScreen .pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(10,12,26,.18);
    user-select: none;
    max-width: min(52vw, 520px);
}

#lobbyScreen .pill .k {
    color: var(--dim);
    font-weight: 900;
    font-size: .82rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

#lobbyScreen .pill .v {
    font-weight: 900;
    letter-spacing: .14em;
    color: var(--warm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .95rem;
}

#lobbyScreen .icon-btn {
    height: 40px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: var(--text-light);
    cursor: pointer;
    font-weight: 900;
    letter-spacing: .02em;
    user-select: none;
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

#lobbyScreen .icon-btn:hover {
    transform: translateY(-1px);
}

#lobbyScreen .icon-btn:active {
    transform: translateY(0px);
}

#lobbyScreen .icon-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--focus);
}

#lobbyScreen .icon-btn.warm {
    background: linear-gradient(135deg, rgba(255,200,87,.92), rgba(255,200,87,.40));
    border-color: rgba(255,200,87,.55);
    color: #1a1630;
    text-shadow: 0 1px 0 rgba(255,255,255,.18);
}

#lobbyScreen .content-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 18px;
    scrollbar-gutter: stable both-edges;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#lobbyScreen .content-scroll::-webkit-scrollbar {
    width: 10px;
}

#lobbyScreen .content-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.14);
    border-radius: 999px;
    border: 2px solid rgba(0,0,0,0);
    background-clip: padding-box;
}

#lobbyScreen .content-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.22);
    background-clip: padding-box;
}

#lobbyScreen .content-scroll::-webkit-scrollbar-track {
    background: rgba(255,255,255,.06);
    border-radius: 999px;
}

#lobbyScreen .scroll-fade {
    pointer-events: none;
    position: sticky;
    left: 0;
    right: 0;
    height: 18px;
    z-index: 40;
}

#lobbyScreen .scroll-fade.top {
    top: 0;
    background: none;
}


#lobbyScreen .room {
    display: grid;
    grid-template-columns: 1fr 0.95fr;
    gap: 16px;
    min-height: calc(100vh - 72px - 36px);
    padding: 6px 0;
}

#lobbyScreen .panel {
    padding: 18px;
    border-radius: 28px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 18px 45px rgba(0,0,0,.38);
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
    min-height: 0;
}

#lobbyScreen .panel::before {
    content: "";
    position: absolute;
    inset: auto -60px -120px auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(124,92,255,.16), transparent 62%);
    pointer-events: none;
    filter: blur(1px);
}

#lobbyScreen .panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
}

#lobbyScreen .title {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

#lobbyScreen .title h1 {
    font-size: 1.2rem !important;
    font-weight: 900 !important;
    letter-spacing: .02em !important;
    line-height: 1.15 !important;
    color: var(--text-light) !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: var(--text-light) !important;
    background-clip: unset !important;
    margin-bottom: 0 !important;
    text-align: left !important;
}

#lobbyScreen .title p {
    color: var(--dim) !important;
    font-size: .92rem !important;
    line-height: 1.35 !important;
    max-width: 72ch;
    margin: 0 !important;
    padding: 0 !important;
}

#lobbyScreen .title p b {
    color: var(--text-light) !important;
    font-weight: 900 !important;
}

#lobbyScreen .badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    position: relative;
}

#lobbyScreen .tag {
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    font-weight: 900;
    font-size: .78rem;
    white-space: nowrap;
    user-select: none;
}

#lobbyScreen .tag.warm {
    border-color: rgba(255,200,87,.30);
    background: rgba(255,200,87,.10);
}

#lobbyScreen .tag.good {
    border-color: rgba(46,229,157,.30);
    background: rgba(46,229,157,.10);
}

#lobbyScreen .tag.accent {
    border-color: rgba(124,92,255,.30);
    background: rgba(124,92,255,.10);
}

#lobbyScreen .players-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 10px;
    position: relative;
}

#lobbyScreen .count {
    display: flex;
    align-items: baseline;
    gap: 10px;
    user-select: none;
}

#lobbyScreen .count b {
    font-weight: 900;
}

#lobbyScreen .count .big {
    font-size: 1.1rem;
    letter-spacing: .02em;
}

#lobbyScreen .count .slash {
    color: rgba(170,177,214,.75);
    font-weight: 900;
    letter-spacing: .06em;
}

#lobbyScreen .count .max {
    color: rgba(170,177,214,.85);
    font-weight: 900;
}

#lobbyScreen .list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    min-height: 0;
}

#lobbyScreen .player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
}

#lobbyScreen .p-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

#lobbyScreen .avatar {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(124,92,255,.18);
    border: 1px solid rgba(124,92,255,.22);
    flex: 0 0 auto;
    font-weight: 900;
    letter-spacing: .02em;
}

#lobbyScreen .p-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

#lobbyScreen .p-meta b {
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#lobbyScreen .p-meta span {
    color: var(--dim);
    font-size: .86rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#lobbyScreen .row-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

#lobbyScreen .row-actions .btn {
    flex: 1;
}

#lobbyScreen .field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

#lobbyScreen label {
    font-size: .82rem;
    color: var(--dim);
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

#lobbyScreen input,
#lobbyScreen select {
    width: 100%;
    padding: 14px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(10,12,26,.20);
    color: var(--text-light);
    outline: none;
    transition: box-shadow .12s ease, border-color .12s ease, background .12s ease;
    appearance: none;
}

#lobbyScreen select {
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(242,241,255,.78) 50%),
        linear-gradient(135deg, rgba(242,241,255,.78) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 40px;
}

#lobbyScreen input::placeholder {
    color: rgba(170,177,214,.65);
    font-weight: 700;
}

#lobbyScreen input:focus,
#lobbyScreen select:focus {
    border-color: rgba(124,92,255,.55);
    box-shadow: 0 0 0 4px var(--focus);
    background: rgba(10,12,26,.26);
}

#lobbyScreen .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

#lobbyScreen .hint {
    color: rgba(170,177,214,.85);
    font-size: .88rem;
    line-height: 1.35;
    margin-top: 6px;
}

#lobbyScreen .note {
    margin-top: 8px;
    padding: 12px 12px;
    border-radius: 18px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    color: rgba(170,177,214,.9);
    line-height: 1.45;
    font-size: .90rem;
    position: relative;
}

#lobbyScreen .note b {
    color: var(--text-light);
}

#lobbyScreen .note .em {
    color: var(--warm);
    font-weight: 900;
}

#lobbyScreen .btn {
    width: 100%;
    border: 0;
    cursor: pointer;
    font-weight: 900;
    letter-spacing: .02em;
    border-radius: 16px;
    padding: 14px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-light);
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
    user-select: none;
}

#lobbyScreen .btn:hover {
    transform: translateY(-1px);
}

#lobbyScreen .btn:active {
    transform: translateY(0px);
}

#lobbyScreen .btn.primary {
    background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(124,92,255,.55));
    border-color: rgba(124,92,255,.55);
    box-shadow: 0 14px 35px rgba(124,92,255,.18);
}

#lobbyScreen .btn.warm {
    background: linear-gradient(135deg, rgba(255,200,87,.92), rgba(255,200,87,.40));
    border-color: rgba(255,200,87,.55);
    color: #1a1630;
    text-shadow: 0 1px 0 rgba(255,255,255,.18);
    box-shadow: 0 14px 35px rgba(255,200,87,.14);
}

/* Final Victory Screen Styles */

#finalVictoryScreen .top-nav {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 22px;
    background: rgba(10,12,26,.25);
    border-bottom: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(12px);
}

#finalVictoryScreen .logo {
    font-weight: 900;
    font-size: 1.25rem;
}

#finalVictoryScreen .meta {
    display: flex;
    gap: 10px;
    font-weight: 800;
    font-size: .85rem;
}

#finalVictoryScreen .pill {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
}

#finalVictoryScreen .game-container {
    display: grid;
    grid-template-columns: 300px 1fr 320px;
    gap: 16px;
    padding: 16px;
    height: calc(100vh - 70px);
    min-height: 0;
}

#finalVictoryScreen .sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

#finalVictoryScreen .info-box {
    padding: 16px;
}

#finalVictoryScreen .info-box h3 {
    font-size: .9rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--warm);
}

#finalVictoryScreen .subtext {
    font-size: .85rem;
    color: var(--dim);
    line-height: 1.4;
}

#finalVictoryScreen .players {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 6px;
    min-height: 0;
}

#finalVictoryScreen .players::-webkit-scrollbar {
    width: 8px;
}

#finalVictoryScreen .players::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.12);
    border-radius: 999px;
}

#finalVictoryScreen .play-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

#finalVictoryScreen .controls {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#finalVictoryScreen .history-panel {
    height: 100%;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pill-win {
    background: rgba(77,255,167,.10);
    border-color: rgba(77,255,167,.30);
    color: rgba(242,241,255,.95);
}
.pill-win b {
    color: var(--ok);
}

.result-card {
    width: min(820px, 100%);
    padding: 34px 30px 22px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    min-height: 420px;
}

.result-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    background:
        radial-gradient(900px 240px at 50% 0%, rgba(77,255,167,.14), transparent 55%),
        radial-gradient(900px 240px at 50% 0%, rgba(124,92,255,.12), transparent 60%);
    pointer-events: none;
    opacity: .95;
}

.hero {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-top: 6px;
}

.crown {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    margin: 0 auto 10px;
    background: rgba(77,255,167,.10);
    border: 1px solid rgba(77,255,167,.25);
    box-shadow: 0 18px 40px rgba(0,0,0,.35);
    position: relative;
    overflow: hidden;
    font-size: 1.8rem;
}

.crown::after {
    content: "";
    position: absolute;
    inset: -2px;
    background: radial-gradient(220px 120px at 30% 0%, rgba(77,255,167,.25), transparent 60%);
    pointer-events: none;
}

.victory-title {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -.02em;
    margin-bottom: 8px;
}

.victory-sub {
    color: var(--dim);
    font-size: 1rem;
    line-height: 1.4;
    margin: 0 auto;
    max-width: 64ch;
}

.summary-row {
    position: relative;
    z-index: 1;
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.09);
    text-align: left;
    min-height: 74px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.stat .k {
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(242,241,255,.75);
    font-weight: 900;
}

.stat .v {
    font-size: 1.35rem;
    font-weight: 900;
}

.stat .v b {
    color: var(--warm);
}

.stat.ok .v {
    color: rgba(77,255,167,.95);
}

.stat.bad .v {
    color: rgba(255,77,125,.95);
}

.divider {
    position: relative;
    z-index: 1;
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: 18px 0 14px;
}

.actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: rgba(77,255,167,.12);
    border-color: rgba(77,255,167,.35);
}

.btn-primary:hover {
    background: rgba(77,255,167,.16);
    border-color: rgba(77,255,167,.45);
}

.btn-ghost {
    background: rgba(10,12,26,.16);
    border-color: rgba(255,255,255,.10);
}

.confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.confetti i {
    position: absolute;
    top: -12%;
    width: 10px;
    height: 18px;
    border-radius: 4px;
    opacity: .85;
    animation: fall 2.9s linear infinite;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,.25));
}

.confetti i:nth-child(odd) {
    width: 8px;
    height: 14px;
    opacity: .75;
}

.confetti i:nth-child(3n) {
    width: 6px;
    height: 20px;
    opacity: .65;
}

@keyframes fall {
    0% {
        transform: translateY(-20vh) rotate(0deg);
    }
    100% {
        transform: translateY(120vh) rotate(540deg);
    }
}

.player-row.winner {
    background: rgba(77,255,167,.08);
    border-color: rgba(77,255,167,.35);
}

.player-row.winner::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: radial-gradient(800px 220px at 20% 0%, rgba(77,255,167,.14), transparent 55%);
    pointer-events: none;
}

.player-row .right {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    position: relative;
    z-index: 1;
}

.tag.win {
    border-color: rgba(77,255,167,.35);
    background: rgba(77,255,167,.10);
}

.tag.out {
    border-color: rgba(255,77,125,.35);
    background: rgba(255,77,125,.10);
}

.tag.dim {
    opacity: .9;
}

.player-state.win {
    color: rgba(77,255,167,.95);
    font-weight: 900;
}

.player-state.lose {
    color: rgba(255,77,125,.9);
    font-weight: 900;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 1100px) {
    #lobbyScreen .room {
        grid-template-columns: 1fr;
        min-height: unset;
    }
    #lobbyScreen .grid-2 {
        grid-template-columns: 1fr;
    }
    #lobbyScreen .pill {
        display: none;
    }
    .summary-row {
        grid-template-columns: 1fr;
    }
}
