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

:root {
    --cyan: #00FFFF;
    --magenta: #FF00FF;
    --purple: #8B00FF;
    --yellow: #FFFF00;
    --teal: #20B2AA;
    --bg-dark: #0a0a1a;
    --bg-darker: #000000;
    --glass: rgba(10, 10, 26, 0.85);
    --glass-border: rgba(0, 255, 255, 0.3);
}

body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    color: white;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

#ui-overlay > * {
    pointer-events: auto;
}

/* Menu Screen */
.menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
    text-align: center;
}

.title-container {
    margin-bottom: 40px;
}

.game-title {
    font-size: clamp(3rem, 12vw, 5rem);
    font-weight: 700;
    background: linear-gradient(90deg, var(--cyan), var(--magenta), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(0, 255, 255, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
    letter-spacing: -2px;
}

.game-subtitle {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 600;
    color: var(--magenta);
    text-shadow: 0 0 30px rgba(255, 0, 255, 0.6);
    margin-top: -10px;
}

.tagline {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 10px;
    letter-spacing: 2px;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.4)); }
    to { filter: drop-shadow(0 0 30px rgba(255, 0, 255, 0.6)); }
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    color: var(--bg-dark);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.6);
}

.btn-secondary {
    background: var(--glass);
    color: white;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-icon {
    font-size: 1.2rem;
}

.mode-toggle {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.mode-pill {
    padding: 10px 20px;
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-pill.active {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(255, 0, 255, 0.2));
    border-color: var(--cyan);
    color: white;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.menu-footer {
    display: flex;
    gap: 15px;
    margin-top: 40px;
}

.icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    transform: scale(1.1);
    border-color: var(--cyan);
}

.footer-link {
    position: absolute;
    bottom: 20px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan);
}

/* Game HUD */
.game-hud {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 15px;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--glass);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.back-btn {
    background: none;
    border: none;
    color: var(--cyan);
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    cursor: pointer;
}

.round-info {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.mode-label {
    font-weight: 600;
    color: var(--cyan);
}

.difficulty-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-badge.easy {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.difficulty-badge.medium {
    background: rgba(255, 200, 0, 0.2);
    color: #ffc800;
}

.difficulty-badge.hard {
    background: rgba(255, 50, 50, 0.2);
    color: #ff5050;
}

.timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cyan);
}

.timer.warning {
    color: #ff5050;
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.secret-word {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass);
    padding: 10px 25px;
    border-radius: 30px;
    border: 1px solid var(--magenta);
    backdrop-filter: blur(10px);
}

.word-label {
    color: rgba(255, 255, 255, 0.6);
    margin-right: 8px;
}

.word-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--magenta);
    text-shadow: 0 0 10px var(--magenta);
}

.drawing-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.brush-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 0 20px currentColor, 0 0 40px currentColor;
    animation: brushPulse 1s ease-in-out infinite;
}

@keyframes brushPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
}

.drawing-indicator span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.hud-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: var(--glass);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.drawing-label, .guessing-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cyan);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: #ff4444;
    border-radius: 50%;
    animation: recordPulse 1s ease-in-out infinite;
}

@keyframes recordPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.brush-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--cyan);
}

.color-picker {
    display: flex;
    gap: 8px;
}

.color-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-btn:hover {
    transform: scale(1.2);
}

.color-btn.active {
    border-color: white;
    box-shadow: 0 0 15px currentColor;
}

.practice-tips {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Word Selection */
.word-select-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
}

.select-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--cyan), var(--magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-hint {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
}

.word-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 350px;
}

.word-card {
    padding: 20px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.word-card:hover {
    transform: scale(1.03);
    border-color: var(--cyan);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.word-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
}

.timer-hint {
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Guessing Mode */
.guess-feed {
    position: absolute;
    top: 80px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 200px;
}

.guess-bubble {
    padding: 8px 14px;
    background: var(--glass);
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.guess-bubble.correct {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
    color: #00ff88;
}

.guess-bubble.wrong {
    opacity: 0.5;
}

.orbit-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    pointer-events: none;
}

.guess-form {
    display: flex;
    gap: 10px;
}

.guess-input {
    flex: 1;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    color: white;
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.guess-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.guess-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    border: none;
    color: var(--bg-dark);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

/* Round End */
.round-end-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
    text-align: center;
}

.result-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.round-end-container.victory .result-title {
    background: linear-gradient(90deg, var(--cyan), var(--yellow), var(--magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow 2s ease-in-out infinite;
}

@keyframes rainbow {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

.round-end-container.defeat .result-title {
    color: rgba(255, 255, 255, 0.6);
}

.reveal-word {
    margin-bottom: 30px;
}

.reveal-label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.reveal-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--magenta);
    text-shadow: 0 0 20px var(--magenta);
}

.score-panel {
    background: var(--glass);
    padding: 20px 40px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.score-item {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    padding: 10px 0;
}

.score-item.total {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 10px;
    padding-top: 15px;
}

.score-label {
    color: rgba(255, 255, 255, 0.7);
}

.score-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--cyan);
}

.round-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 250px;
}

/* Settings */
.settings-container {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
    background: var(--glass);
    overflow-y: auto;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.settings-header h2 {
    font-size: 1.5rem;
    color: var(--cyan);
}

.spacer {
    width: 60px;
}

.settings-group {
    margin-bottom: 30px;
}

.settings-group h3 {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-select {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-family: 'Quicksand', sans-serif;
    outline: none;
    cursor: pointer;
}

.toggle-btn {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .game-subtitle {
        font-size: 2rem;
    }
    
    .menu-buttons {
        max-width: 280px;
    }
    
    .btn {
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .word-card {
        padding: 16px;
    }
    
    .word-text {
        font-size: 1.1rem;
    }
}

/* Landscape mode */
@media (max-height: 500px) and (orientation: landscape) {
    .menu-container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .title-container {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .menu-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: none;
        justify-content: center;
    }
    
    .hud-bottom {
        position: fixed;
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
}