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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #0f0f23;
    --surface: #1a1a3e;
    --surface-light: #2d2d5f;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: #374151;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
    --gradient-bg: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #2d2d5f 100%);
}

:root[data-theme="light"] {
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-light: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --gradient-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.game-container {
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    grid-template-rows: 80px 1fr;
    grid-template-areas: 
        "header header header"
        "sidebar main stats";
    min-height: 100vh;
    gap: 1rem;
    padding: 1rem;
}

.header {
    grid-area: header;
    background: var(--surface);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-items {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-items a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-items a:hover {
    color: var(--text-primary);
}

.theme-toggle {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
}

.sidebar {
    grid-area: sidebar;
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.main-game {
    grid-area: main;
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.stats-panel {
    grid-area: stats;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.game-title {
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

.difficulty-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--surface-light);
    padding: 0.5rem;
    border-radius: 12px;
}

.difficulty-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.difficulty-btn.active {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.input-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.guess-input {
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface-light);
    color: var(--text-primary);
    width: 150px;
    text-align: center;
    transition: all 0.3s ease;
}

.guess-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.guess-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.guess-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.guess-btn:active {
    transform: translateY(0);
}

.feedback-area {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.feedback-message {
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.feedback-hint {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
}

.progress-section {
    width: 100%;
    max-width: 400px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-secondary);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.range-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.difficulty-info {
    background: var(--surface-light);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.hint-section {
    background: var(--surface-light);
    padding: 1rem;
    border-radius: 8px;
}

.hint-btn {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.hint-btn:hover {
    background: var(--primary);
    color: white;
}

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

.stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leaderboard {
    background: var(--surface-light);
    padding: 1rem;
    border-radius: 8px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.celebration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    animation: confetti-fall 3s linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

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

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@media (max-width: 1024px) {
    .game-container {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "header"
            "main"
            "sidebar"
            "stats";
    }
    
    .nav-items {
        display: none;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .main-game {
        padding: 1rem;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .input-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .guess-input {
        width: 100%;
    }
}