/* AikiAventuras — CRT terminal cabinet.
   Retro identity preserved and turned up: phosphor green on black,
   scanlines, glow, typewriter text. Font: VT323 (loaded on the page). */

/* The monitor bezel */
#crt-bezel {
    background: linear-gradient(160deg, #2a2d31, #17181a);
    border-radius: 18px;
    padding: 22px;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.08),
        inset 0 -3px 6px rgba(0, 0, 0, 0.6),
        0 12px 30px rgba(0, 0, 0, 0.35);
    max-width: 900px;
    margin: 0 auto;
}

/* The screen */
#terminal {
    position: relative;
    color: #33ff33;
    background:
        radial-gradient(ellipse at center, #0c1a0c 0%, #050905 85%);
    font-family: 'VT323', 'Courier New', Courier, monospace;
    font-size: 1.35rem;
    line-height: 1.45;
    padding: 24px 26px 30px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.85);
    animation: crt-flicker 4s infinite;
}

/* Scanlines + subtle vignette overlay */
#terminal::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.22) 0px,
            rgba(0, 0, 0, 0.22) 1px,
            transparent 1px,
            transparent 3px
        );
    mix-blend-mode: multiply;
}

@keyframes crt-flicker {
    0%, 100% { opacity: 1; }
    97% { opacity: 1; }
    98% { opacity: 0.96; }
    99% { opacity: 1; }
}

/* Boot-style header bar */
#term-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(51, 255, 51, 0.4);
    padding-bottom: 6px;
    margin-bottom: 16px;
    font-size: 1.05rem;
    letter-spacing: 1px;
    text-shadow: 0 0 6px rgba(51, 255, 51, 0.6);
    flex-wrap: wrap;
}

/* Scene image: framed like a video feed on the terminal */
#imageElement {
    border: 1px solid rgba(51, 255, 51, 0.5);
    border-radius: 6px;
    box-shadow: 0 0 18px rgba(51, 255, 51, 0.25);
    filter: saturate(0.9) contrast(1.05);
    margin-bottom: 18px !important;
}

/* Story text with phosphor glow + blinking block cursor */
#storyText {
    background: transparent;
    border: none;
    color: #33ff33;
    text-shadow: 0 0 7px rgba(51, 255, 51, 0.55);
    min-height: 4.2em;
    margin-bottom: 14px;
}
#storyText::after {
    content: '█';
    margin-left: 2px;
    animation: cursor-blink 1s steps(1) infinite;
}
@keyframes cursor-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Choices: retro menu entries */
#choicesDiv {
    background: transparent;
    border: none;
}
#choicesDiv button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    color: #33ff33;
    border: 1px solid rgba(51, 255, 51, 0.45);
    border-radius: 4px;
    padding: 10px 14px;
    margin-top: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.15rem;
    text-shadow: 0 0 6px rgba(51, 255, 51, 0.5);
    transition: background 0.12s ease-in-out, color 0.12s ease-in-out;
}
#choicesDiv button::before {
    content: '> ';
}
#choicesDiv button:hover,
#choicesDiv button:focus-visible {
    background: #33ff33;
    color: #04140a;
    text-shadow: none;
    outline: none;
}

/* Screen-change static burst */
#terminal.scene-change #storyText,
#terminal.scene-change #imageElement {
    animation: scene-glitch 0.25s steps(3) 1;
}
@keyframes scene-glitch {
    0% { opacity: 0.2; transform: translateX(-2px); }
    50% { opacity: 0.7; transform: translateX(2px); }
    100% { opacity: 1; transform: none; }
}

/* Hint line */
#term-hint {
    margin-top: 14px;
    font-size: 0.95rem;
    opacity: 0.55;
    letter-spacing: 1px;
}

pre {
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
}

@media (max-width: 600px) {
    #crt-bezel { padding: 12px; border-radius: 12px; }
    #terminal { font-size: 1.15rem; padding: 16px 14px 20px; }
    #choicesDiv button { font-size: 1.05rem; }
}

/* Ending screen */
#virtues-line {
    margin: 6px 0 12px;
    padding: 8px 12px;
    border: 1px dashed rgba(51, 255, 51, 0.45);
    border-radius: 4px;
    font-size: 1.05rem;
    letter-spacing: 1px;
    text-shadow: 0 0 6px rgba(51, 255, 51, 0.5);
}

/* D20 rolls */
#dice-box {
    margin-top: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(51, 255, 51, 0.5);
    border-radius: 4px;
    letter-spacing: 1px;
    text-shadow: 0 0 6px rgba(51, 255, 51, 0.5);
}
#dice-num {
    display: inline-block;
    margin-top: 6px;
    font-size: 2.2rem;
    text-shadow: 0 0 12px rgba(51, 255, 51, 0.8);
}
.roll-success {
    margin-top: 6px;
    font-size: 1.3rem;
    animation: cursor-blink 0.5s steps(1) 3;
}
.roll-failure {
    margin-top: 6px;
    font-size: 1.3rem;
    color: #ff5533;
    text-shadow: 0 0 8px rgba(255, 85, 51, 0.6);
    animation: cursor-blink 0.5s steps(1) 3;
}
