@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

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

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #0c0c0c, #1a1a2e, #16213e);
    color: #00d4d4;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;

    /* Override progress bar theme for neon aesthetic */
    --progress-bar-bg: rgba(0, 0, 0, 0.5);
    --progress-bar-border: #00ffff;
    --progress-fill-bg: linear-gradient(90deg, #00ffff, #00ff7f);
    --progress-text-color: #fff;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 255, 127, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.game-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

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

.header > div:first-child {
    flex: 0 0 auto;
    align-self: flex-start;
}

.game-title {
    flex: 1;
    text-align: center;
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(45deg, #00ffff, #ff00ff, #00ff7f);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: colorShift 3s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    margin-bottom: 15px;
}

@keyframes colorShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.score-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2rem;
    font-weight: 700;
}

.score, .accuracy {
    background: rgba(0, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.screen {
    display: block;
    animation: slideIn 0.5s ease-out;
}

.screen.hidden {
    display: none;
}

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

.setup-panel, .results-panel {
    background: rgba(26, 26, 46, 0.9);
    border: 2px solid #00ffff;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.setup-panel h2, .results-panel h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #00ff7f;
}

.input-group {
    margin: 30px 0;
}

.input-group label {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #00d4d4;
}

.input-group input {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 1.5rem;
    color: #00d4d4;
    text-align: center;
    width: 120px;
    font-family: 'Orbitron', monospace;
}

.input-group input:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

.neon-btn {
    background: linear-gradient(45deg, #00ffff, #00ff7f);
    border: none;
    border-radius: 15px;
    padding: 15px 30px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    margin: 10px;
}

.neon-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 5px 30px rgba(0, 255, 255, 0.6);
}

.neon-btn.secondary {
    background: linear-gradient(45deg, #ff00ff, #ff6b6b);
}

.progress-bar {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00ffff;
    border-radius: 25px;
    height: 50px;
    position: relative;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #00ffff, #00ff7f);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 25px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.question-panel {
    text-align: center;
    margin: 40px 0;
}

.question {
    font-size: 4rem;
    font-weight: 900;
    color: #00ff7f;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(0, 255, 127, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

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

.feedback {
    font-size: 1.5rem;
    font-weight: 700;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    border-radius: 15px;
    padding: 10px;
    transition: all 0.3s ease;
}

.feedback.correct {
    color: #00ff7f;
    background: rgba(0, 255, 127, 0.1);
    border: 2px solid #00ff7f;
    animation: correctFlash 0.5s ease;
}

.feedback.incorrect {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border: 2px solid #ff6b6b;
    animation: incorrectShake 0.5s ease;
}

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

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

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.answers-grid.hidden {
    display: none;
}

.answer-btn {
    background: rgba(26, 26, 46, 0.8);
    border: 2px solid #00ffff;
    border-radius: 15px;
    padding: 25px;
    font-size: 2rem;
    font-weight: 700;
    color: #00d4d4;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
    backdrop-filter: blur(5px);
}

.answer-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 255, 255, 0.3);
}

.answer-btn.correct {
    background: rgba(0, 255, 127, 0.3);
    border-color: #00ff7f;
    color: #00ff7f;
}

.answer-btn.incorrect {
    background: rgba(255, 107, 107, 0.3);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.final-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.stat {
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid #00ffff;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 1rem;
    margin-bottom: 10px;
    color: #00d4d4;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: #00ff7f;
}

.missed-section {
    margin: 30px 0;
    text-align: left;
}

.missed-section h3 {
    color: #ff00ff;
    margin-bottom: 15px;
    text-align: center;
}

.missed-list {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #ff00ff;
    border-radius: 15px;
    padding: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.missed-problem {
    color: #ff6b6b;
    font-size: 1.1rem;
    margin: 8px 0;
    padding: 8px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

/* Footer positioning */
.game-footer {
    margin-top: auto;
}

/* Mode Toggle Buttons */
.mode-toggle {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.mode-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 1rem;
    color: #00d4d4;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
}

.mode-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    transform: scale(1.05);
}

.mode-btn.active {
    background: rgba(0, 255, 127, 0.3);
    border-color: #00ff7f;
    color: #00ff7f;
    box-shadow: 0 0 15px rgba(0, 255, 127, 0.4);
}

/* Input Answer Container */
.input-answer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.input-answer-container.hidden {
    display: none;
}

.answer-input {
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid #00ffff;
    border-radius: 15px;
    padding: 20px;
    font-size: 3rem;
    color: #00d4d4;
    text-align: center;
    width: 200px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    transition: all 0.3s ease;
}

.answer-input:focus {
    outline: none;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
    transform: scale(1.05);
    border-color: #00ff7f;
}

.answer-input.correct-shake {
    animation: correctPulse 0.5s ease;
}

.answer-input.incorrect-shake {
    animation: incorrectShake 0.5s ease;
    border-color: #ff6b6b;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); border-color: #00ffff; }
    50% { transform: scale(1.1); border-color: #00ff7f; box-shadow: 0 0 40px rgba(0, 255, 127, 0.8); }
}

/* Methods Button */
.methods-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff00ff, #ff6b6b);
    border: 3px solid #ff00ff;
    color: #fff;
    font-size: 2rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 0, 255, 0.4);
    z-index: 100;
    font-family: 'Orbitron', monospace;
}

.methods-btn:hover {
    transform: scale(1.15) rotate(15deg);
    box-shadow: 0 8px 30px rgba(255, 0, 255, 0.7);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 3px solid #00ffff;
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.4);
    animation: slideUp 0.4s ease;
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #ff6b6b;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
    font-family: Arial, sans-serif;
}

.modal-close:hover {
    color: #ff0000;
    transform: rotate(90deg) scale(1.2);
}

.modal-content h2 {
    color: #00ff7f;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5rem;
}

.method-section {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #00ffff;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.method-section h3 {
    color: #00d4d4;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.method-section p {
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.6;
}

.example {
    background: rgba(0, 255, 127, 0.1);
    border: 2px solid #00ff7f;
    border-radius: 10px;
    padding: 15px;
    color: #00ff7f;
    font-size: 1.1rem;
    line-height: 1.8;
}

.example strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.3rem;
}

/* Box Method Grid */
.box-method {
    margin-top: 15px;
}

.box-grid {
    display: inline-block;
    margin: 10px 0;
}

.box-header, .box-row {
    display: grid;
    grid-template-columns: 50px 80px 80px;
    gap: 5px;
}

.box-header > div, .box-row > div {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    font-weight: 700;
}

.box-cell {
    background: rgba(255, 0, 255, 0.2);
    border: 2px solid #ff00ff;
    border-radius: 8px;
    min-height: 50px;
}

.box-method p {
    margin-top: 10px;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .game-title {
        font-size: 2rem;
        flex: 1 1 100%;
    }

    .score-display {
        flex-direction: column;
        gap: 10px;
        flex: 1 1 100%;
    }

    .question {
        font-size: 3rem;
    }

    .answers-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .final-stats {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 20px;
        padding: 25px;
        max-height: 90vh;
    }

    .modal-content h2 {
        font-size: 1.8rem;
    }

    .method-section h3 {
        font-size: 1.2rem;
    }

    .methods-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .answer-input {
        font-size: 2rem;
        width: 150px;
    }

    .mode-toggle {
        flex-direction: column;
    }
}