:root {
    --bg-color: #030d1a;
    --terminal-bg: #061526;
    --text-primary: #00f3ff;
    --text-dim: #5c9bb0;
    --text-glow: #00f3ff;
    --yellow: #ffd700;
    --accent: #0f2b48;
    --error: #ff3b5c;
    --success: #00ff88;
    --border-color: #00f3ff;
    --font-main: 'Fira Code', 'Courier New', monospace;
}

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

body {
    background-color: #020b14;
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    line-height: 1.6;
}

/* CRT Effects */
.scanline {
    width: 100%;
    height: 10px;
    z-index: 100;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 243, 255, 0.05) 50%, rgba(0, 0, 0, 0) 100%);
    opacity: 0.15;
    position: absolute;
    bottom: 100%;
    animation: scanline 8s linear infinite;
    pointer-events: none;
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 99;
}

@keyframes scanline {
    0% {
        bottom: 100%;
    }
    100% {
        bottom: -20px;
    }
}

/* Container */
.terminal-container {
    width: 95%;
    max-width: 1000px;
    height: 90vh;
    background-color: rgba(6, 21, 38, 0.96);
    border: 2px solid var(--border-color);
    box-shadow: 0 0 35px rgba(0, 243, 255, 0.25), inset 0 0 40px rgba(0, 243, 255, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
}

/* Header */
.terminal-header {
    background: rgba(0, 243, 255, 0.1);
    border-bottom: 2px solid var(--border-color);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--text-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--text-primary);
    margin-right: 10px;
    animation: blink 1.5s infinite;
}

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

/* Main Content Area */
#app-content {
    flex: 1;
    position: relative;
    overflow-y: auto;
    padding: 20px;
}

/* Custom Scrollbar */
#app-content::-webkit-scrollbar {
    width: 6px;
}
#app-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
#app-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
    opacity: 0;
}

/* Start Screen */
#start-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.ascii-art {
    color: var(--text-primary);
    font-size: 0.75rem;
    line-height: 1.1;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    white-space: pre;
    font-weight: bold;
}

.mission-brief {
    border: 1px dashed var(--text-dim);
    padding: 18px 24px;
    background: rgba(0, 0, 0, 0.4);
    text-align: left;
    max-width: 650px;
    width: 100%;
    font-size: 0.88rem;
    border-radius: 6px;
}

.mission-brief p {
    margin-bottom: 6px;
    color: var(--text-dim);
}

.mission-brief p:last-child {
    margin-bottom: 0;
    color: var(--text-primary);
    font-weight: bold;
}

/* Buttons */
.cyber-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 30px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    border-radius: 4px;
}

.cyber-btn:hover {
    background: var(--text-primary);
    color: #030d1a;
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.6);
}

/* Quiz Screen */
.quiz-status-bar {
    display: flex;
    justify-content: space-between;
    background: rgba(15, 43, 72, 0.4);
    border: 1px solid var(--text-dim);
    padding: 10px 15px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border-radius: 4px;
}

.status-item .label {
    color: var(--text-dim);
    margin-right: 5px;
}

.status-item .value {
    color: var(--text-primary);
    font-weight: bold;
}

.question-terminal {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.prompt-line {
    font-size: 0.85rem;
}

.prompt-user {
    color: var(--success);
}

.command {
    color: #fff;
    margin-left: 8px;
}

.question-output {
    font-size: 1.05rem;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-left: 3px solid var(--text-primary);
    color: #e6f7ff;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
}

.option-btn {
    background: rgba(15, 43, 72, 0.3);
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: var(--yellow);
    padding: 12px 15px;
    text-align: left;
    font-family: var(--font-main);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--yellow);
    color: #ffffff;
    background: rgba(255, 215, 0, 0.15);
    transform: translateX(4px);
}

.option-btn:disabled {
    cursor: default;
    opacity: 0.9;
}

.option-btn.correct {
    background: rgba(0, 255, 136, 0.15) !important;
    border-color: var(--success) !important;
    color: var(--success) !important;
    font-weight: bold;
}

.option-btn.wrong {
    background: rgba(255, 59, 92, 0.15) !important;
    border-color: var(--error) !important;
    color: var(--error) !important;
}

/* Feedback Area */
.feedback-console {
    background: rgba(3, 13, 26, 0.9);
    border: 1px solid var(--text-dim);
    padding: 15px;
    margin-top: 10px;
    font-size: 0.9rem;
    border-radius: 4px;
}

.feedback-header {
    color: var(--text-dim);
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(92, 155, 176, 0.3);
    padding-bottom: 5px;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.feedback-content {
    color: #e6f7ff;
    line-height: 1.5;
}

/* Result Screen */
#result-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 25px;
}

.result-title {
    font-size: 1.6rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--text-primary);
}

.result-stats {
    display: flex;
    gap: 30px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--text-primary);
}

.mission-status {
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 10px 20px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .terminal-container {
        width: 98%;
        height: 96vh;
    }
    .ascii-art {
        font-size: 0.5rem;
    }
    .mission-brief {
        font-size: 0.8rem;
        padding: 12px;
    }
    .quiz-status-bar {
        flex-direction: column;
        gap: 5px;
    }
    .result-stats {
        flex-direction: column;
        gap: 15px;
    }
}
