/* ===== SKETCHVERSE — CyberDiplomat Dark + Light (Green) Theme ===== */
/* Dark: #141414→#1A1A1A→#0F1F0F | Light: #E8F0E0→#DDEBD2 | Mid: #C8D4B4→#B8C8A4 */
/* Accent: #A8C89A sage | Deep: #2E7D32 | Card-dark: #FFFFFF0D / #FFFFFF18 border */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(180deg, #D4E0C8 0%, #C8D4B4 30%, #B8C8A4 70%, #C2D0B0 100%);
    color: #1A1A1A;
    min-height: 100vh;
    overflow-x: hidden;
}
h1,h2,h3,h4 { font-family: 'Space Grotesk', sans-serif; color: #1A1A1A; }
a { color: #2E7D32; text-decoration: none; }
a:hover { text-decoration: underline; }
input, select {
    font-family: 'Inter', sans-serif;
    background: #FFFFFF;
    border: 1px solid #B8C8A4;
    border-radius: 8px;
    color: #1A1A1A;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
}
input:focus, select:focus { border-color: #2E7D32; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #B8C8A4; border-radius: 3px; }

/* ===== DARK / LIGHT SECTION HELPERS ===== */
.dark-section {
    background: linear-gradient(180deg, #141414 0%, #1A1A1A 50%, #0F1F0F 100%);
    color: #FFFFFF;
}
.dark-section h2, .dark-section h3, .dark-section h4 { color: #FFFFFF; }
.dark-section .section-title { color: #FFFFFF; }
.dark-section .section-sub { color: #AAAAAA; }
.dark-section p { color: #999999; }

.light-section {
    background: linear-gradient(160deg, #E8F0E0 0%, #DDEBD2 50%, #E0ECDA 100%);
    color: #1A1A1A;
}

/* ===== BUTTONS ===== */
.btn {
    font-family: 'Space Grotesk', sans-serif;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: #1A1A1A; color: #fff; }
.btn-primary:hover { background: #2A2A2A; box-shadow: 0 4px 20px rgba(26,26,26,0.3); }
.btn-outline { background: transparent; border: 2px solid #1A1A1A; color: #1A1A1A; }
.btn-outline:hover { background: rgba(26,26,26,0.08); }
.dark-section .btn-outline { border-color: #A8C89A; color: #A8C89A; }
.dark-section .btn-outline:hover { background: rgba(168,200,154,0.1); }
.dark-section .btn-primary { background: #A8C89A; color: #1A1A1A; }
.dark-section .btn-primary:hover { background: #B8D4AA; box-shadow: 0 4px 20px rgba(168,200,154,0.3); }
.btn-danger { background: #C62828; color: #fff; }
.btn-danger:hover { background: #B71C1C; }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn.full { width: 100%; }

/* ===== SCREENS ===== */
.screen { display: none; }
.screen.active { display: block; }

/* ===== HOME NAV ===== */
.home-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    background: rgba(255,255,255,0.30);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(184,200,164,0.5);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.nav-left { display: flex; align-items: center; gap: 10px; }
.logo-icon {
    width: 40px; height: 40px;
    background: #1A1A1A;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700; font-size: 16px; color: #A8C89A;
}
.logo-icon.sm { width: 30px; height: 30px; font-size: 12px; border-radius: 7px; }
.logo-text { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 22px; color: #1A1A1A; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.online-badge {
    display: flex; align-items: center; gap: 6px;
    background: rgba(46,125,50,0.12);
    border: 1px solid rgba(46,125,50,0.3);
    padding: 5px 12px; border-radius: 20px;
    font-size: 13px; color: #2E7D32;
}
.online-dot { width: 8px; height: 8px; background: #2E7D32; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ===== HERO ===== */
.hero {
    position: relative;
    padding: 80px 40px;
    text-align: center;
    overflow: hidden;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-bg-pattern {
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(46,125,50,0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(184,200,164,0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(200,220,178,0.15) 0%, transparent 50%);
    z-index: 0;
}
.hero-content { position: relative; z-index: 1; max-width: 700px; }
.hero-badge {
    display: inline-block;
    background: #2A2A2A;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 13px;
    color: #A8C89A;
    margin-bottom: 16px;
    font-weight: 500;
}
.hero-title {
    font-size: 56px;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1.1;
    margin-bottom: 16px;
}
.hero-subtitle { font-size: 18px; color: #555; line-height: 1.6; margin-bottom: 30px; max-width: 550px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 16px; justify-content: center; }

/* ===== STATS BAR (DARK) ===== */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 60px;
    padding: 30px 40px;
}
.stats-bar.dark-section {
    background: linear-gradient(180deg, #141414 0%, #1A1A1A 50%, #0F1F0F 100%);
}
.stat-item { text-align: center; }
.stat-num { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 700; color: #A8C89A; }
.stat-label { font-size: 13px; color: #AAAAAA; }

/* ===== SECTIONS ===== */
.section { padding: 60px 40px; }
.section > h2, .section > .section-title { max-width: 1100px; margin-left: auto; margin-right: auto; }
.section-title { font-size: 32px; text-align: center; margin-bottom: 8px; }
.section-sub { text-align: center; color: #666; margin-bottom: 40px; }

/* ===== CATEGORIES (LIGHT SECTION) ===== */
.light-section .categories-grid,
.light-section .steps-row,
.light-section .features-grid { max-width: 1100px; margin-left: auto; margin-right: auto; }

.categories-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px; max-width: 900px; margin: 0 auto;
}
.cat-card {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(184,200,164,0.5);
    border-radius: 14px;
    padding: 20px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    backdrop-filter: blur(10px);
}
.cat-card:hover { border-color: #2E7D32; transform: translateY(-4px); box-shadow: 0 8px 30px rgba(46,125,50,0.12); }
.cat-card.selected { border-color: #2E7D32; background: rgba(46,125,50,0.08); }
.cat-icon { font-size: 36px; }
.cat-emoji { font-size: 32px; line-height: 1; }
.cat-name { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 14px; color: #1A1A1A; }
.cat-count { font-size: 12px; color: #777; }
.light-section .cat-name { color: #1A1A1A; }

/* ===== STEPS (DARK SECTION) ===== */
.dark-section .steps-row,
.dark-section .features-grid,
.dark-section .categories-grid { max-width: 1100px; margin-left: auto; margin-right: auto; }

.steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step-card {
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(184,200,164,0.5);
    border-radius: 24px;
    padding: 30px 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}
/* Dark-section step cards */
.dark-section .step-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.dark-section .step-card h3 { color: #FFFFFF; }
.dark-section .step-card p { color: #999999; }
.step-num {
    width: 48px; height: 48px;
    background: #1A1A1A;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700; font-size: 20px; color: #A8C89A;
    margin-bottom: 16px;
}
.dark-section .step-num {
    background: rgba(168,200,154,0.15);
    color: #A8C89A;
}
.step-card h3 { margin-bottom: 8px; color: #1A1A1A; font-size: 18px; }
.step-card p { color: #666; font-size: 14px; line-height: 1.5; }

/* ===== FEATURES (LIGHT SECTION) ===== */
.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.feature-card {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(184,200,164,0.5);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(10px);
}
.dark-section .feature-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.dark-section .feature-card h3 { color: #FFFFFF; }
.dark-section .feature-card p { color: #999999; }
.feature-icon { font-size: 32px; display: block; margin-bottom: 12px; }
.feature-emoji { font-size: 28px; display: block; margin-bottom: 10px; }
.feature-card h3 { color: #1A1A1A; font-size: 16px; margin-bottom: 6px; }
.feature-card p { color: #666; font-size: 14px; line-height: 1.5; }

/* ===== CTA (DARK) ===== */
.cta-section {
    position: relative;
    text-align: center;
    padding: 80px 40px;
    overflow: hidden;
}
.cta-pattern {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(168,200,154,0.08) 0%, transparent 60%);
}
.cta-section.dark-section h2 { font-size: 36px; color: #fff; margin-bottom: 12px; position: relative; z-index: 1; }
.cta-section.dark-section p { color: #AAAAAA; margin-bottom: 24px; position: relative; z-index: 1; }
.cta-section .btn { position: relative; z-index: 1; }

/* ===== FOOTER (DARK) ===== */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    font-size: 13px;
}
.footer.dark-section {
    background: linear-gradient(180deg, #141414, #1A1A1A, #0D1A0D);
    border-top: 1px solid rgba(255,255,255,0.08);
    color: #888;
}
.footer-left { display: flex; align-items: center; gap: 8px; }
.footer.dark-section .logo-icon { background: #A8C89A; color: #1A1A1A; }
.footer.dark-section span { color: #888; }
.footer-right { color: #888; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(6px);
}
.modal-overlay.hidden { display: none; }
.modal {
    background: linear-gradient(180deg, #1A1A1A, #141414);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 24px;
    padding: 36px;
    width: 450px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.modal h2 { font-size: 24px; margin-bottom: 20px; color: #FFFFFF; }
.modal-content.hidden { display: none; }
.modal-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none; border: none;
    color: #666; font-size: 28px;
    cursor: pointer;
}
.modal-close:hover { color: #fff; }
.modal input, .modal select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #FFFFFF;
}
.modal input:focus, .modal select:focus { border-color: #A8C89A; }
.modal input::placeholder { color: #666; }
.modal option { background: #1A1A1A; color: #fff; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #999; margin-bottom: 6px; font-weight: 500; }
.modal .form-group label { color: #999; }
.modal .btn-primary { background: #A8C89A; color: #1A1A1A; }
.modal .btn-primary:hover { background: #B8D4AA; box-shadow: 0 4px 20px rgba(168,200,154,0.3); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-switch { text-align: center; margin-top: 16px; font-size: 13px; color: #888; }
.modal-switch a { color: #A8C89A; }

/* ===== LOBBY (DARK) ===== */
.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 30px;
    background: linear-gradient(90deg, #141414, #1A1A1A);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.lobby-left { display: flex; align-items: center; gap: 8px; }
.lobby-header .logo-icon { background: #A8C89A; color: #1A1A1A; }
.lobby-header .logo-text { color: #A8C89A; }
.lobby-center { display: flex; align-items: center; gap: 10px; }
.room-code-label { font-size: 12px; color: #888; }
.room-code {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #A8C89A;
    letter-spacing: 2px;
    background: rgba(168,200,154,0.1);
    padding: 4px 12px;
    border-radius: 8px;
}
.lobby-header .btn-outline { border-color: rgba(255,255,255,0.2); color: #ccc; }
.lobby-header .btn-outline:hover { background: rgba(255,255,255,0.08); }
.lobby-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px 30px;
    max-width: 1000px;
    margin: 0 auto;
    background: linear-gradient(180deg, #111111, #151515, #0F1A0F);
    min-height: calc(100vh - 60px);
}
.lobby-settings {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(16px);
}
.lobby-settings h3 { margin-bottom: 20px; color: #fff; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.lobby-settings input, .lobby-settings select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
}
.lobby-settings input:focus, .lobby-settings select:focus { border-color: #A8C89A; }
.lobby-settings option { background: #1A1A1A; color: #fff; }
.lobby-settings .form-group label { color: #999; }
.owner-badge {
    font-size: 11px;
    background: #A8C89A;
    color: #1A1A1A;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 600;
}
.settings-form { display: grid; gap: 14px; margin-bottom: 20px; }
.waiting-text { text-align: center; color: #888; font-size: 13px; margin-top: 12px; animation: pulse 2s infinite; }
.lobby-settings .btn-primary { background: #A8C89A; color: #1A1A1A; }
.lobby-settings .btn-primary:hover { background: #B8D4AA; }
.lobby-settings .btn-outline { border-color: rgba(255,255,255,0.2); color: #ccc; }

.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #999;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
.cat-chip:hover { border-color: #A8C89A; color: #A8C89A; }
.cat-chip.selected { background: rgba(168,200,154,0.15); border-color: #A8C89A; color: #A8C89A; }

.lobby-players {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(16px);
}
.lobby-players h3 { margin-bottom: 16px; color: #fff; font-size: 18px; }

/* ===== PLAYER LIST ===== */
.player-list { display: flex; flex-direction: column; gap: 8px; }
.player-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.player-item.drawing { border-color: #A8C89A; background: rgba(168,200,154,0.08); }
.player-item.guessed { border-color: #2E7D32; background: rgba(46,125,50,0.08); }
.player-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.player-info { flex: 1; min-width: 0; overflow: hidden; }
.player-name {
    font-weight: 600; font-size: 14px; color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.player-name .badge {
    font-size: 10px; padding: 1px 6px; border-radius: 6px;
    margin-left: 6px; font-weight: 600;
    white-space: nowrap;
}
.badge-owner { background: #A8C89A; color: #1A1A1A; }
.badge-drawing { background: #2E7D32; color: #fff; }
.badge-you { background: #558B2F; color: #fff; }
.player-score {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #A8C89A;
}
.player-status { font-size: 11px; color: #888; }
.player-streak { font-size: 12px; color: #A8C89A; }

/* ===== GAME HEADER (DARK) ===== */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 24px;
    background: linear-gradient(90deg, #141414, #1A1A1A);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.round-info {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    color: #888;
    font-size: 14px;
}
.turn-info {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    color: #A8C89A;
    font-size: 12px;
    display: block;
}
.game-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.game-header-center { display: flex; align-items: center; gap: 16px; flex-wrap: nowrap; }
.timer-circle {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 3px solid #A8C89A;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700; font-size: 18px; color: #fff;
    transition: border-color 0.3s;
    background: rgba(168,200,154,0.08);
}
.timer-circle.warning { border-color: #F57F17; }
.timer-circle.danger { border-color: #C62828; animation: pulse 0.5s infinite; }
.word-hint {
    font-family: 'Space Grotesk', sans-serif;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow-x: auto;
    max-width: 55vw;
    scrollbar-width: none;
}
.word-hint::-webkit-scrollbar { display: none; }
.word-hint .hb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 34px;
    border-radius: 6px;
    font-size: 18px; font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}
.word-hint .hb.empty {
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.2);
}
.word-hint .hb.filled {
    background: rgba(168,200,154,0.15);
    border: 1.5px solid rgba(168,200,154,0.4);
    color: #A8C89A;
}
.word-hint .hb.space {
    width: 14px; border: none; background: none;
}
.word-hint.plain-hint {
    display: inline;
    font-size: 16px;
    font-weight: 600;
    color: #ccc;
    letter-spacing: 0;
}

/* ===== GAME BODY (DARK) ===== */
.game-body {
    display: grid;
    grid-template-columns: 200px 1fr 280px;
    height: calc(100vh - 68px);
    overflow: hidden;
    background: #111111;
}
.game-players {
    background: linear-gradient(180deg, #141414, #1A1A1A);
    padding: 12px;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.06);
}

/* ===== CANVAS ===== */
.canvas-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0F150F;
    padding: 12px;
    overflow-y: auto;
    min-height: 0;
}
#draw-canvas {
    background: #FFFFFF;
    border-radius: 12px;
    cursor: crosshair;
    max-width: 100%;
    max-height: calc(100vh - 180px);
    box-shadow: 0 0 40px rgba(168,200,154,0.1);
    flex-shrink: 0;
    touch-action: none;
}

/* Word Select Overlay */
.word-select-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20,20,20,0.95);
    backdrop-filter: blur(10px);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 10;
    border-radius: 12px;
}
.word-select-overlay.hidden { display: none; }
.word-select-overlay h3 { color: #fff; margin-bottom: 24px; font-size: 20px; }
.word-options { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.word-option {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 16px 28px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Space Grotesk', sans-serif;
    text-transform: capitalize;
}
.word-option:hover { border-color: #A8C89A; background: rgba(168,200,154,0.08); transform: scale(1.05); }
.word-timer { color: #888; font-size: 13px; margin-top: 16px; }

/* Your Word */
.your-word {
    position: absolute;
    top: 16px;
    background: rgba(168,200,154,0.15);
    border: 1px solid #A8C89A;
    padding: 8px 20px;
    border-radius: 10px;
    color: #A8C89A;
    font-size: 14px;
    z-index: 5;
}
.your-word.hidden { display: none; }
.your-word strong { color: #fff; text-transform: uppercase; font-size: 16px; margin-left: 4px; }

/* ===== TOOLBAR (DARK) ===== */
.toolbar {
    display: flex;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(26,26,26,0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    margin-top: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}
.toolbar.hidden { display: none; }
.tool-group { display: flex; gap: 4px; align-items: center; }
.tool-group + .tool-group { padding-left: 12px; border-left: 1px solid rgba(255,255,255,0.08); }
.tool-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
    color: #ccc;
}
.tool-btn:hover { background: rgba(255,255,255,0.08); }
.tool-btn.active { background: rgba(168,200,154,0.2); }

.size-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.size-btn:hover { background: rgba(255,255,255,0.08); }
.size-btn.active { background: rgba(168,200,154,0.2); }
.size-dot { display: block; border-radius: 50%; background: #fff; }
.size-dot.s { width: 6px; height: 6px; }
.size-dot.m { width: 10px; height: 10px; }
.size-dot.l { width: 16px; height: 16px; }

.color-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}
.color-btn:hover { transform: scale(1.2); }
.color-btn.active { border-color: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.3); }

/* ===== CHAT (DARK) ===== */
.game-chat {
    background: linear-gradient(180deg, #141414, #1A1A1A);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255,255,255,0.06);
    min-height: 0;
    overflow: hidden;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.chat-msg {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}
.chat-msg .chat-name { font-weight: 600; margin-right: 6px; }
.chat-msg.normal { color: #ccc; }
.chat-msg.normal .chat-name { color: #A8C89A; }
.chat-msg.system { color: #888; font-style: italic; text-align: center; font-size: 12px; }
.chat-msg.join { color: #4CAF50; text-align: center; font-size: 12px; }
.chat-msg.hint { color: #FFD54F; text-align: center; font-size: 12px; }
.chat-msg.close-guess { color: #EF9A9A; background: rgba(198,40,40,0.08); }
.chat-msg.correct { color: #A8C89A; background: rgba(168,200,154,0.1); text-align: center; font-weight: 600; }
.chat-msg.drawer { color: #80CBC4; }
.chat-msg.drawer .chat-name { color: #80CBC4; }
.chat-msg.guessed-chat { color: #AED581; font-style: italic; }
.chat-msg.guessed-chat .chat-name { color: #AED581; }
.chat-msg.reaction { text-align: center; font-size: 20px; padding: 2px 0; }

.chat-input-row {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.chat-input-row input {
    flex: 1; padding: 8px 12px; font-size: 13px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}
.chat-input-row input:focus { border-color: #A8C89A; }
.chat-input-row input::placeholder { color: #666; }
.chat-input-row .btn { background: #A8C89A; color: #1A1A1A; }
.reaction-bar {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.reaction-bar button {
    background: none; border: none;
    font-size: 18px; cursor: pointer;
    padding: 4px 6px; border-radius: 6px;
    transition: all 0.2s;
}
.reaction-bar button:hover { background: rgba(255,255,255,0.08); transform: scale(1.2); }

/* ===== ROUND OVER (DARK CARD) ===== */
.overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 500;
    backdrop-filter: blur(8px);
}
.overlay.hidden { display: none; }
.round-over-card {
    background: linear-gradient(180deg, #1A1A1A, #141414);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.times-up {
    font-size: 36px;
    color: #EF5350;
    margin-bottom: 20px;
}
.reveal-word { margin-bottom: 24px; }
.reveal-text { display: block; font-size: 14px; color: #888; margin-bottom: 4px; }
.reveal-word-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #A8C89A;
    text-transform: uppercase;
    letter-spacing: 4px;
}
.reveal-content.hidden { display: none; }

/* Countdown Animation */
.countdown-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}
.countdown-container.hidden { display: none; }
.countdown-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 120px;
    font-weight: 900;
    color: #A8C89A;
    animation: countdownPop 0.8s ease-out;
    text-shadow: 0 0 40px rgba(168,200,154,0.3);
}
@keyframes countdownPop {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes countdownFade {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}
.round-scores { margin-top: 16px; }
.round-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 14px;
}
.round-score-item.guessed { background: rgba(168,200,154,0.1); color: #A8C89A; }
.round-score-item.missed { color: #888; }
.round-score-item .rs-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}
.round-score-item .rs-pts { font-family: 'Space Grotesk', sans-serif; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.next-round-text { color: #888; font-size: 13px; margin-top: 16px; animation: pulse 1.5s infinite; }

/* ===== TURN TRANSITION (DARK CARD) ===== */
.transition-card {
    background: linear-gradient(135deg, #1A1A1A 0%, #0F1F0F 100%);
    border: 2px solid #A8C89A;
    border-radius: 24px;
    padding: 48px 60px;
    text-align: center;
    animation: countdownPop 0.5s ease-out;
    box-shadow: 0 0 60px rgba(168,200,154,0.15);
}
.transition-round {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #A8C89A;
    margin-bottom: 4px;
}
.transition-turn {
    font-size: 16px;
    color: #A8C89A;
    margin-bottom: 28px;
    font-weight: 500;
}
.transition-drawer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.transition-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #A8C89A;
    box-shadow: 0 0 20px rgba(168,200,154,0.2);
}
.transition-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #FFFFFF;
}
.transition-label {
    font-size: 16px;
    color: #888;
    font-style: italic;
}

/* ===== GAME OVER (DARK CARD) ===== */
.game-over-card {
    background: linear-gradient(180deg, #1A1A1A, #141414);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    min-width: 450px;
    max-width: 550px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.game-over-title {
    font-size: 40px;
    color: #A8C89A;
    margin-bottom: 30px;
}
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 24px;
    min-height: 200px;
}
.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.podium-place .place-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    border: 3px solid;
}
.podium-place .place-name {
    font-weight: 600; font-size: 14px; color: #fff;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.podium-place .place-score { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16px; }
.podium-place .place-label { font-size: 12px; padding: 2px 10px; border-radius: 10px; font-weight: 600; }
.podium-bar {
    width: 100px;
    border-radius: 8px 8px 0 0;
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 8px;
    font-family: 'Space Grotesk'; font-weight: 700; font-size: 24px; color: rgba(255,255,255,0.2);
}
.place-1 .place-avatar { border-color: #FFD700; }
.place-1 .place-score { color: #FFD700; }
.place-1 .place-label { background: #FFD700; color: #1A1A1A; }
.place-1 .podium-bar { background: linear-gradient(180deg, #FFD700, #E6B800); height: 120px; }
.place-2 .place-avatar { border-color: #9E9E9E; }
.place-2 .place-score { color: #BDBDBD; }
.place-2 .place-label { background: #9E9E9E; color: #1A1A1A; }
.place-2 .podium-bar { background: linear-gradient(180deg, #BDBDBD, #9E9E9E); height: 90px; }
.place-3 .place-avatar { border-color: #CD7F32; }
.place-3 .place-score { color: #CD7F32; }
.place-3 .place-label { background: #CD7F32; color: #fff; }
.place-3 .podium-bar { background: linear-gradient(180deg, #CD7F32, #B06C2A); height: 70px; }

.final-rankings { margin-bottom: 24px; }
.final-rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 4px;
}
.rank-num { font-family: 'Space Grotesk'; font-weight: 700; color: #888; width: 24px; flex-shrink: 0; }
.rank-name { flex: 1; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rank-score { font-family: 'Space Grotesk'; font-weight: 700; color: #A8C89A; white-space: nowrap; flex-shrink: 0; }

.game-over-actions { display: flex; gap: 16px; justify-content: center; }
.game-over-card .btn-primary { background: #A8C89A; color: #1A1A1A; }
.game-over-card .btn-primary:hover { background: #B8D4AA; }
.game-over-card .btn-outline { border-color: rgba(255,255,255,0.2); color: #ccc; }
.game-over-card .btn-outline:hover { background: rgba(255,255,255,0.08); }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #C62828;
    color: #fff;
    padding: 12px 28px;
    border-radius: 24px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(198,40,40,0.3);
    animation: slideUp 0.3s ease;
}
.toast.hidden { display: none; }
.toast.success { background: #2E7D32; box-shadow: 0 4px 20px rgba(46,125,50,0.3); }
@keyframes slideUp { from { transform: translateX(-50%) translateY(20px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }

/* ===== FLOATING REACTIONS ===== */
.reactions-container {
    position: fixed;
    bottom: 0;
    right: 300px;
    width: 200px;
    height: 300px;
    pointer-events: none;
    z-index: 200;
    overflow: hidden;
}
.floating-reaction {
    position: absolute;
    bottom: -40px;
    font-size: 28px;
    animation: floatUp 2s ease-out forwards;
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(0.5); opacity: 1; }
    100% { transform: translateY(-250px) scale(1.2); opacity: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .hero-title { font-size: 36px; }
    .stats-bar { gap: 24px; flex-wrap: wrap; }
    .game-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        height: calc(100vh - 60px);
        overflow-y: auto;
    }
    .game-players {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px;
        gap: 6px;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        max-height: 70px;
    }
    .game-players .player-item {
        flex-shrink: 0;
        padding: 6px 10px;
        min-width: fit-content;
    }
    .game-players .player-avatar {
        width: 28px; height: 28px; font-size: 14px;
    }
    .game-players .player-name { font-size: 12px; }
    .game-players .player-score { font-size: 13px; }
    .game-players .player-status { display: none; }
    .canvas-container { padding: 8px; min-height: 300px; }
    #draw-canvas { max-height: calc(100vh - 300px); }
    .toolbar { padding: 6px 10px; gap: 6px; margin-top: 6px; }
    .tool-btn { width: 32px; height: 32px; font-size: 16px; }
    .color-btn { width: 24px; height: 24px; }
    .game-chat {
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.06);
        max-height: 200px;
        min-height: 140px;
    }
    .chat-messages { max-height: 120px; }
    .game-header { padding: 8px 16px; }
    .game-header-center { gap: 10px; }
    .timer-circle { width: 40px; height: 40px; font-size: 16px; }
    .word-hint .hb { width: 24px; height: 28px; font-size: 15px; }
    .word-hint .hb.space { width: 10px; }
    .round-info { font-size: 12px; }
    .lobby-body { grid-template-columns: 1fr; }
    .lobby-header { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
    .features-grid { grid-template-columns: 1fr; }
    .steps-row { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: repeat(3, 1fr); }
    .hero { padding: 40px 20px; }
    .section { padding: 40px 20px; }
    .home-nav { padding: 12px 20px; }
    .round-over-card { min-width: auto; max-width: 90vw; padding: 24px; }
    .game-over-card { min-width: auto; max-width: 90vw; padding: 24px; }
    .countdown-number { font-size: 80px; }
    .reveal-word-text { font-size: 24px; letter-spacing: 2px; }
    .times-up { font-size: 28px; }
    .reactions-container { right: 20px; }
}
@media (max-width: 600px) {
    .hero-title { font-size: 28px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .settings-grid { grid-template-columns: 1fr; }
    .podium-bar { width: 70px; }
    .game-header { padding: 6px 12px; }
    .word-hint .hb { width: 20px; height: 24px; font-size: 12px; }
    .word-hint .hb.space { width: 8px; }
    .timer-circle { width: 36px; height: 36px; font-size: 14px; border-width: 2px; }
    .game-body { height: calc(100vh - 52px); }
    .canvas-container { min-height: 250px; padding: 6px; }
    #draw-canvas { max-height: calc(50vh); }
    .toolbar { flex-wrap: wrap; gap: 4px; padding: 4px 8px; }
    .tool-group + .tool-group { padding-left: 8px; }
    .game-chat { max-height: 160px; min-height: 120px; }
    .chat-input-row { padding: 6px 8px; }
    .chat-input-row input { font-size: 12px; padding: 6px 10px; }
    .reaction-bar { padding: 4px 8px; gap: 2px; }
    .reaction-bar button { font-size: 16px; padding: 2px 4px; }
    .game-players { max-height: 60px; }
    .countdown-number { font-size: 64px; }
    .countdown-container { min-height: 120px; }
    .round-over-card { padding: 20px 16px; }
    .reveal-word-text { font-size: 20px; }
    .podium { gap: 6px; min-height: 160px; }
    .podium-bar { width: 60px; }
    .game-over-card { padding: 20px 16px; }
    .game-over-title { font-size: 28px; margin-bottom: 16px; }
    .game-over-actions { flex-direction: column; gap: 10px; }
}

/* ===== CONFETTI / CRACKERS CELEBRATION ===== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}
.confetti-container.hidden { display: none; }

.confetti-piece {
    position: absolute;
    top: -20px;
    border-radius: 2px;
    animation: confettiFall linear forwards;
    transform: rotate(0deg);
}
.confetti-circle {
    position: absolute;
    top: -20px;
    border-radius: 50%;
    animation: confettiFall linear forwards;
}
.confetti-star {
    position: absolute;
    top: -20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    line-height: 1;
    background: transparent !important;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        top: -5%;
        opacity: 1;
        transform: translateX(0) rotate(0deg) scale(1);
    }
    25% {
        opacity: 1;
        transform: translateX(40px) rotate(180deg) scale(1.1);
    }
    50% {
        opacity: 0.9;
        transform: translateX(-30px) rotate(360deg) scale(0.9);
    }
    75% {
        opacity: 0.7;
        transform: translateX(20px) rotate(540deg) scale(1);
    }
    100% {
        top: 105%;
        opacity: 0;
        transform: translateX(-10px) rotate(720deg) scale(0.6);
    }
}
