:root {
    --bg-dark: #090b15;
    --card-bg: rgba(17, 22, 44, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    
    /* Neon Palette */
    --neon-blue: #00d2ff;
    --neon-pink: #ff007f;
    --neon-amber: #ffaa00;
    --neon-emerald: #00e676;
    
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --success: #00e676;
    --danger: #ff007f;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
}

/* Ambient Radial Glows */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.18) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(255, 0, 127, 0.12) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Container Glass */
.container {
    background: var(--card-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 32px;
    padding: 40px;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 50px rgba(139, 92, 246, 0.15);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 42px;
    font-weight: 900;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 40%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    letter-spacing: -1.5px;
    text-shadow: 0 0 30px rgba(192, 132, 252, 0.2);
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 35px;
}

/* Category Grid Selector */
.category-selector-title {
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.category-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.category-card .cat-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.3));
}

.category-card .cat-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.category-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.category-card.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.category-card.active .cat-name {
    color: #ffffff;
}

/* Mode Selection Cards */
.modes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 35px;
}

.mode-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mode-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.mode-card:hover::before {
    opacity: 1;
}

.mode-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mode-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
}

.mode-desc {
    font-size: 14px;
    color: var(--text-muted);
}

.mode-icon {
    font-size: 32px;
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    transition: all 0.25s ease;
}

.mode-card:hover .mode-icon {
    background: var(--primary);
    color: #ffffff;
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

/* Gamified Options Grid (Kahoot/Quizizz Style) */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 25px;
}

@media (max-width: 600px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

.option-btn {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    font-family: inherit;
    color: white;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-width: 2px;
    border-style: solid;
}

/* Color Coding for Options */
.option-btn:nth-child(1) { border-color: rgba(0, 210, 255, 0.2); }
.option-btn:nth-child(2) { border-color: rgba(255, 0, 127, 0.2); }
.option-btn:nth-child(3) { border-color: rgba(255, 170, 0, 0.2); }
.option-btn:nth-child(4) { border-color: rgba(0, 230, 118, 0.2); }

.option-letter {
    font-size: 18px;
    font-weight: 900;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: white;
}

.option-btn:nth-child(1) .option-letter { background: var(--neon-blue); }
.option-btn:nth-child(2) .option-letter { background: var(--neon-pink); }
.option-btn:nth-child(3) .option-letter { background: var(--neon-amber); }
.option-btn:nth-child(4) .option-letter { background: var(--neon-emerald); }

.option-text {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.option-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.option-btn:nth-child(1):hover:not(:disabled) { border-color: var(--neon-blue); box-shadow: 0 0 20px rgba(0, 210, 255, 0.3); }
.option-btn:nth-child(2):hover:not(:disabled) { border-color: var(--neon-pink); box-shadow: 0 0 20px rgba(255, 0, 127, 0.3); }
.option-btn:nth-child(3):hover:not(:disabled) { border-color: var(--neon-amber); box-shadow: 0 0 20px rgba(255, 170, 0, 0.3); }
.option-btn:nth-child(4):hover:not(:disabled) { border-color: var(--neon-emerald); box-shadow: 0 0 20px rgba(0, 230, 118, 0.3); }

/* Feedback States */
.option-btn.correct {
    background: rgba(0, 230, 118, 0.15) !important;
    border-color: var(--neon-emerald) !important;
    box-shadow: 0 0 30px rgba(0, 230, 118, 0.4) !important;
    transform: scale(1.03);
}

.option-btn.wrong {
    background: rgba(255, 0, 127, 0.15) !important;
    border-color: var(--neon-pink) !important;
    box-shadow: 0 0 30px rgba(255, 0, 127, 0.4) !important;
    transform: scale(0.97);
    animation: shake 0.4s ease;
}

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

/* Profile Card Dashboard look */
.profile-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 20px 24px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.profile-username {
    font-weight: 800;
    font-size: 18px;
}

.profile-streak {
    background: rgba(255, 170, 0, 0.1);
    color: var(--neon-amber);
    border: 1px solid rgba(255, 170, 0, 0.2);
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.1);
}

/* General Layout helpers */
.btn {
    font-family: inherit;
    font-weight: 800;
    padding: 16px 28px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    text-decoration: none;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #ffffff;
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.5);
    filter: brightness(1.15);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

/* User Form */
.username-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-family: inherit;
    font-size: 15px;
    transition: all 0.3s ease;
}

.username-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
    background: rgba(0, 0, 0, 0.45);
}

.category-badge {
    align-self: center;
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.25);
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-block;
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(192, 132, 252, 0.2);
}

.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 35px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.4s ease;
}

.question-text {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.45;
    text-align: center;
    margin-bottom: 35px;
}

/* Explanation Panel */
.explanation-card {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--primary);
    border-radius: 0 16px 16px 0;
    padding: 20px 24px;
    margin-top: 15px;
    margin-bottom: 25px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.explanation-title {
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #c084fc;
    margin-bottom: 8px;
}

.explanation-text {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Timer or Life Bar */
.game-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 15px;
    font-weight: 800;
}

.lives-container {
    display: flex;
    gap: 6px;
}

.heart-icon {
    font-size: 20px;
    color: var(--danger);
    transition: transform 0.2s ease;
    filter: drop-shadow(0 2px 5px rgba(255,0,0,0.3));
}

.heart-icon.lost {
    color: rgba(255, 255, 255, 0.15);
    filter: none;
}

.timer-badge {
    background: rgba(255, 0, 127, 0.12);
    color: #ff007f;
    border: 1px solid rgba(255, 0, 127, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
}
