#combat-screen {
    position: relative;
}

#quiz-modal {
    position: fixed;
    inset: 0;
    z-index: 99999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    padding: 1.5rem;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#quiz-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Quiz content transition */
#quiz-modal .modal-content {
    background: #0f172a !important;
    padding: 3rem;
    border-radius: 2.5rem;
    max-width: 44rem;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    transform: translateY(20px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

#quiz-modal.active .modal-content {
    transform: translateY(0) scale(1);
}

/* Feedback Modal (Standardized) */
.neural-modal {
    position: fixed;
    inset: 0;
    z-index: 100000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    padding: 1.5rem;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.neural-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.neural-modal-content {
    background: #0f172a !important;
    padding: 3rem;
    border-radius: 2.5rem;
    max-width: 40rem;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    transform: translateY(20px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.neural-modal.active .neural-modal-content {
    transform: translateY(0) scale(1);
}

/* Feedback Themes */
.neural-modal.good .neural-modal-content {
    border-color: #34d399cc;
    box-shadow: 0 0 50px rgba(52, 211, 153, 0.3);
}

.neural-modal.bad .neural-modal-content {
    border-color: #ef4444cc;
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.3);
}

/* ==================== NEURAL THEME - KNOWLEDGE KEEPER ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #020617;
    color: #e2e8f0;
    overflow: hidden;
}

.neural-background {
    position: fixed;
    inset: 0;
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
}

/* MAIN MENU */
.neural-menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.neural-title {
    font-family: 'Orbitron', monospace;
    font-size: 6rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
    line-height: 1;
}

.neural-subtitle {
    display: block;
    font-size: 4rem;
    color: #3b82f6;
    margin-top: 0.5rem;
}

.neural-version {
    color: #64748b;
    letter-spacing: 0.8em;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 4rem;
    opacity: 0.5;
}

.neural-btn {
    position: relative;
    z-index: 10;
    padding: 1.25rem 3rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    background: #3b82f6;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.neural-btn:hover {
    background: #2563eb;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

/* SYLLABUS GRID */
.neural-syllabus-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 5rem 2rem;
    position: relative;
    z-index: 10;
}

.neural-syllabi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 90rem;
    width: 100%;
}

.syllabus-card {
    cursor: pointer;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(30, 58, 138, 0.1) 100%);
    padding: 2.5rem;
    border-radius: 2.8rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.7s ease;
}

.syllabus-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1rem);
}

/* COMBAT SCREEN */
.neural-combat-container {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.combat-hud-outer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 60vh;
    width: 100%;
    z-index: 10;
    padding-top: 4rem;
}

.combat-cards-row {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 48px;
    margin-bottom: 36px;
}

.card-container {
    background: rgba(0, 40, 80, 0.7);
    padding: 24px;
    border-radius: 18px;
    box-shadow: 0 0 24px #00eaff88;
    min-width: 320px;
    text-align: center;
}

.neural-progress-bar {
    width: 100%;
    height: 12px;
    background: #222;
    border-radius: 6px;
    margin-top: 8px;
}

.neural-progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.hp-fill {
    background: #00ff99;
}

.cap-fill {
    background: #00eaff;
}

.resolve-fill {
    background: #ffb84d;
}

/* ACTION BAR */
.combat-actions-row {
    display: flex;
    gap: 48px;
    margin-top: 2rem;
}

.neural-action-btn {
    width: 200px;
    height: 56px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 14px;
    border: 2.5px solid;
    background: #002a3a;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(.4, 2, .6, 1);
}

.neural-action-btn#attack-btn {
    color: #00eaff;
    border-color: #00eaff;
    box-shadow: 0 0 16px #00eaffcc;
}

.neural-action-btn#defend-btn {
    color: #ffe066;
    border-color: #ffe066;
    box-shadow: 0 0 16px #ffe066cc;
}

.neural-action-btn#skill-btn {
    color: #fff;
    border-color: #fff;
    box-shadow: 0 0 16px #fff8;
}

.neural-action-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.neural-action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* BATTLE LOG */
.battle-log {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(40px);
    padding: 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    max-width: 700px;
    width: 100%;
    margin: 32px auto 0;
    height: 150px;
    overflow-y: auto;
    color: #cbd5e1;
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MODAL INTERNALS */
.modal-label {
    font-size: 10px;
    color: #3b82f6;
    font-weight: 900;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.quiz-question {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2rem;
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.quiz-option-btn {
    padding: 1.25rem;
    border-radius: 1rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option-btn:hover {
    background: rgba(59, 130, 246, 0.8);
    transform: scale(1.02);
}

/* END GAME */
#victory-screen,
#defeat-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px);
    z-index: 200000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#victory-screen.active,
#defeat-screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.victory-container,
.defeat-container {
    text-align: center;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#victory-screen.active .victory-container,
#defeat-screen.active .defeat-container {
    transform: translateY(0) scale(1);
}

.victory-container h2 {
    font-family: 'Orbitron';
    font-size: 5rem;
    color: #34d399;
}

.defeat-container h2 {
    font-family: 'Orbitron';
    font-size: 5rem;
    color: #ef4444;
}
/* Hint budget bar (simple/hard hint allowance + credits) */
.hints-budget-bar {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #9ad1ff;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
}

.hints-budget-bar b {
    color: #e7f5ff;
}

/* Per-level correct/incorrect question review (victory/defeat screens) */
.level-results-list {
    max-width: 36rem;
    max-height: 14rem;
    overflow-y: auto;
    margin: 1.5rem auto;
    padding: 0.5rem 1rem;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.level-result-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.level-result-entry:last-child {
    border-bottom: none;
}

.level-result-entry .result-icon {
    flex-shrink: 0;
    font-weight: 700;
}

.level-result-entry.correct .result-icon {
    color: #34d399;
}

.level-result-entry.incorrect .result-icon {
    color: #ef4444;
}
