@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

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

body {
    font-family: 'VT323', monospace;
    background: #000000;
    color: #00ff00;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-size: 20px;
    line-height: 1.2;
}

.terminal {
    width: 800px;
    height: 700px; /* increased height */
    background: #000000;
    border: 4px solid #00ff00;
    position: relative;
    box-shadow: 
        0 0 20px #00ff00,
        inset 0 0 20px rgba(0, 255, 0, 0.1);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.03) 2px,
        rgba(0, 255, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 100;
    animation: crtFlicker 1.4s infinite;
}

@keyframes crtFlicker {
    0%, 100% { opacity: 0.12; }
    50% { opacity: 0.18; }
}

.header {
    background: #00ff00;
    color: #000000;
    padding: 8px 16px;
    font-weight: bold;
    text-align: center;
    font-size: 24px;
    letter-spacing: 2px;
}

.content {
    padding: 20px;
    height: calc(100% - 48px);
    display: flex;
    gap: 20px;
    position: relative;
}

.boot-sequence {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.console-panel {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
}

.door-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.8s ease-in;
}

.ascii-door {
    font-size: 18px; /* increased size for taller door */
    line-height: 1;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: pre;
    letter-spacing: 0.5px;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
    animation: doorPulse 3s ease-in-out infinite;
}

@keyframes doorPulse {
    0%, 100% { 
        text-shadow: 0 0 5px #00ff00;
        opacity: 0.9;
    }
    50% { 
        text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
        opacity: 1;
    }
}

.ascii-door:hover {
    color: #ffffff;
    text-shadow: 0 0 15px #00ff00, 0 0 30px #00ff00;
    transform: scale(1.02);
}

.ascii-door.opening {
    animation: doorOpen 1s ease-in-out;
}

@keyframes doorOpen {
    0% { 
        opacity: 1; 
        transform: scale(1);
    }
    25% { 
        opacity: 0.8; 
        transform: scale(1.05) rotateY(5deg);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(1.1) rotateY(10deg);
    }
    75% { 
        opacity: 0.4; 
        transform: scale(1.15) rotateY(15deg);
    }
    100% { 
        opacity: 0.8; 
        transform: scale(0.95) rotateY(30deg);
    }
}

.ascii-door.door-attract {
    animation: doorPulse 1.2s infinite, doorBlink 2s infinite alternate;
    box-shadow: 0 0 24px #00ff00, 0 0 60px #00ff00;
    border: 2px solid #00ff00;
}

@keyframes doorBlink {
    0% { filter: brightness(1); }
    50% { filter: brightness(2); }
    100% { filter: brightness(1); }
}

.ascii-door.open {
    opacity: 0.8;
    transform: scale(0.95) rotateY(30deg);
    text-shadow: 0 0 8px #00ff00;
    transition: all 0.3s ease;
}

.message-display {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.message-display.visible {
    display: flex;
    animation: terminalBoot 0.8s ease-out;
}

@keyframes terminalBoot {
    0% { 
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

.message-box {
    border: 2px solid #00ff00;
    padding: 40px;
    text-align: center;
    max-width: 800px;
    background: #000000;
    position: relative;
    box-shadow: 0 0 30px #00ff00;
}

.message-box::before {
    content: '╔═══════════════════════════════════════════════════════════════════════════════╗';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    background: #000000;
    padding: 0 10px;
    color: #00ff00;
}

.message-box::after {
    content: '╚═══════════════════════════════════════════════════════════════════════════════╝';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    background: #000000;
    padding: 0 10px;
    color: #00ff00;
}

.message-title {
    font-size: 32px;
    margin-bottom: 25px;
    color: #ffffff;
    text-shadow: 0 0 10px #00ff00;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: #000000;
    padding: 15px;
    border: 1px solid #00ff00;
    font-weight: bold;
}

.message-text {
    font-size: 22px;
    line-height: 1.8;
    margin-bottom: 30px;
    color: #00ff00;
    background: #000000;
    padding: 30px;
    border: 1px solid #00ff00;
    margin-top: 20px;
    font-weight: normal;
    text-align: left;
}

.button {
    background: #000000;
    color: #00ff00;
    border: 2px solid #00ff00;
    padding: 10px 20px;
    font-family: 'VT323', monospace;
    font-size: 18px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    margin: 10px;
}

.button:hover {
    background: #00ff00;
    color: #000000;
    box-shadow: 0 0 15px #00ff00;
}

.button:active {
    transform: scale(0.95);
}

.instructions {
    margin-top: auto;
    padding-top: 20px;
    font-size: 16px;
    color: #00ff00;
    text-align: center;
    opacity: 0.8;
    animation: blink 2s infinite;
}

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

.cursor {
    animation: blink 1s infinite;
    font-weight: bold;
}

.status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #00ff00;
    color: #000000;
    padding: 4px 16px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

.glitch {
    animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
    0% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    40% { transform: translateX(2px); }
    60% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
    100% { transform: translateX(0); }
}

@media (max-width: 768px) {
    .terminal {
        width: 95vw;
        height: auto; /* let content determine height */
        max-height: 95vh;
    }
    
    body {
        font-size: 16px;
        overflow: auto; /* allow scrolling if needed */
    }
    
    /* Show console panel on mobile so boot sequence is visible */
    .console-panel {
        display: flex;
    }
    .door-container {
        /* Make the door overlay the whole terminal on mobile */
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        visibility: visible !important;
        opacity: 1 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1500; /* above console panel */
        background: #000000;
    }

    .ascii-door {
        font-size: 5vw; /* scale with viewport width */
        line-height: 0.9;
    }
    
    .message-title {
        font-size: 22px;
    }
    
    .message-text {
        font-size: 16px;
    }

    /* Stack terminal columns vertically for narrow screens */
    .content {
        flex-direction: column;
        gap: 10px;
    }

    .console-panel,
    .door-container {
        width: 100%;
    }

    .door-container {
        align-items: center;
    }

    /* Make quiz overlay and form scrollable and fit on mobile */
    #quiz-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        overflow-y: auto;
        background: rgba(0,0,0,0.98);
        z-index: 3000;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 0;
    }
    #quiz-form {
        width: 100vw;
        max-width: 100vw;
        padding: 10px 0 30px 0;
        box-sizing: border-box;
        overflow-y: auto;
    }
    #quiz-questions {
        font-size: 15px;
        padding: 0 8px;
        max-width: 100vw;
        box-sizing: border-box;
    }
    #quiz-prompt {
        padding: 0 8px 20px 8px !important;
        font-size: 15px;
        max-width: 100vw;
        box-sizing: border-box;
    }
    #quiz-form button {
        font-size: 15px;
        padding: 8px 10px;
        margin: 4px 2px;
    }
    .quiz-question-line {
        font-size: 15px;
        padding: 6px 0 2px 0;
        word-break: break-word;
    }
} 