body{
    background-color: #050b05;
    background-image:
            linear-gradient(rgba(0, 255, 0, 0.05) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0, 255, 0, 0.03) 1px, transparent 1px),
            repeating-linear-gradient(
                to bottom,
                rgba(0, 255, 0, 0.03),
                rgba(0, 255, 0, 0.03) 1px,
                transparent 1px,
                transparent 3px
            );
    background-size: 20px 20px;
    font-family: 'Courier New', monospace;
    animation: subtleGlow 6s ease-in-out infinite alternate;
}

/* Overlay to progressively reveal content */
body::before {
    content: "";
    position: fixed;
    top: 0; /* change to bottom for top-down-up reveal, in the direction of the scanline */
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #050b05;
    pointer-events: none;
    z-index: 9997;
    animation: bodyReveal 4s linear forwards;
}

@keyframes bodyReveal {
    0% { height: 100vh; }
    100% { height: 0; }
}

body::after {
    content: "";
    position: fixed;
    top: -2px;
    left: 0;
    width: 100vw;
    height: 2px;
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 6px rgba(0, 255, 0, 0.3);
    pointer-events: none;
    animation: scanlineSweep 4s linear 1 forwards;
    animation-fill-mode: forwards;
    z-index: 9998;
}

body.red-endgame {
    background-color: #1a0000;
    background-image:
            linear-gradient(rgba(255, 0, 0, 0.05) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255, 0, 0, 0.03) 1px, transparent 1px),
            repeating-linear-gradient(
                    to bottom,
                    rgba(255, 0, 0, 0.03),
                    rgba(255, 0, 0, 0.03) 1px,
                    transparent 1px,
                    transparent 3px
            );
    background-size: 20px 20px;
    animation: subtleRedGlow 6s ease-in-out infinite alternate;
}

@keyframes subtleRedGlow {
    0%   { background-color: #1a0000; }
    100% { background-color: #2a0000; }
}

@keyframes scanlineSweep {
    0% { transform: translateY(0); }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

@keyframes subtleGlow {
    0% { background-color: #050b05; }
    100% { background-color: #071107; }
}

html *,
.accordion {
    font-family: 'Courier New', monospace;
}

.question{
    color: whitesmoke;
}

.block{
    box-shadow: inset 0 0 0 1px #ccffcc; /* simulate 2px inward border */
}
.in-progress-banner {
    border-top-color: #e89f5d; /* CRT amber-orange */
    animation: crtFlicker 2s infinite alternate;
}

@keyframes crtFlicker {
    0%   { border-top-color: rgba(232, 159, 93, 0.2); }
    50%  { border-top-color: rgba(232, 159, 93, 0.8); }
    100% { border-top-color: rgba(232, 159, 93, 0.3); }
}

.end-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: 'Courier New', monospace;
}

.end-overlay-content {
    background: #0d0d0d;
    color: #00ffcc;
    padding: 40px;
    border: 2px solid #00ffcc;
    border-radius: 10px;
    box-shadow: 0 0 20px #00ffcc;
    text-align: center;
    font-size: 1.6rem;
    max-width: 600px;
    line-height: 1.6;
}

.end-overlay-close {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 3rem;
    color: #00ffcc;
    cursor: pointer;
}

.terminator-eye {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%,
        #ff1a1a 10%,
        #990000 35%,
        #000000 70%);
    box-shadow:
        0 0 15px #ff3333,
        0 0 40px #ff0000,
        0 0 80px #440000;
    border: 3px solid #660000;
    position: relative;
    overflow: hidden;
    animation: eyePulse 2.5s ease-in-out infinite;
}

.terminator-eye::before {
    content: "";
    position: absolute;
    top: 25%;
    left: 25%;
    width: 35px;
    height: 35px;
    background: radial-gradient(white, rgba(255,255,255,0) 80%);
    border-radius: 50%;
    opacity: 0.15;
}

.terminator-eye::after {
    content: "";
    position: absolute;
    bottom: 15%;
    right: 20%;
    width: 20px;
    height: 20px;
    background: radial-gradient(white, rgba(255,255,255,0) 80%);
    border-radius: 50%;
    opacity: 0.08;
}

@keyframes eyePulse {
    0% {
        box-shadow: 0 0 20px #ff1a1a, 0 0 60px #330000;
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 80px #ff0000, 0 0 150px #550000;
        transform: scale(1.07);
    }
    100% {
        box-shadow: 0 0 20px #ff1a1a, 0 0 60px #330000;
        transform: scale(1);
    }
}

.terminator-message {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    color: #ff3300;
    margin-top: 30px;
    text-shadow: 0 0 5px red;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-left: 80px;
    padding-right: 80px;
    position: relative;
    overflow: hidden;
    opacity: 1;
    animation: none;
}

@keyframes glitchCRT {
    0% {
        text-shadow: 2px 0 red, -2px 0 darkred;
        transform: scale(1.01);
    }
    10% {
        text-shadow: -2px 0 red, 2px 0 darkred;
        transform: scale(0.99) rotate(0.2deg);
    }
    20% {
        text-shadow: 1px 0 darkred, -1px 0 red;
        transform: scale(1.01) rotate(-0.2deg);
    }
    30% {
        text-shadow: 0 0 2px red, 0 0 2px darkred;
        transform: scale(1.02);
    }
    40% {
        text-shadow: none;
        transform: scale(1);
    }
    100% {
        text-shadow: 2px 0 red, -2px 0 darkred;
        transform: scale(1.01);
    }
}

/* 1. Red Pulse Effect */
@keyframes redPulse {
    0%   { background-color: rgba(0, 0, 0, 0.9); }
    50%  { background-color: rgba(50, 0, 0, 0.98); }
    100% { background-color: rgba(0, 0, 0, 0.9); }
}

.red-end-overlay {
    background-color: rgba(0, 0, 0, 0); /* transparent start */
    animation: redFadeToPulse 3s ease-in-out forwards, redPulse 3s ease-in-out infinite;
    animation-delay: 0s, 3s; /* redPulse starts after 3s */
}

/* 2. Horizontal Scan Flicker Line */
.scan-glitch {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 2px;
    background: red;
    opacity: 0.2;
    animation: flickerScanlineVertical 4s linear infinite;
    z-index: 9999;
}
@keyframes flickerScanline {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

@keyframes flickerScanlineVertical {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 0.2; }
    50% { top: 50%; opacity: 0.6; }
    90% { opacity: 0.3; }
    100% { top: 100%; opacity: 0; }
}

/* 3. Fragmentation/Glitch Text Line */
.fragment-line {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    color: #ff3300;
    text-align: center;
    animation: fragmentFade 6s ease-in-out infinite alternate;
}
@keyframes fragmentFade {
    0% { opacity: 1; letter-spacing: 0; }
    50% { opacity: 0.7; letter-spacing: 2px; }
    100% { opacity: 0.4; letter-spacing: 4px; }
}

.deploy-button {
    margin-top: 40px;
    padding: 14px 28px;
    background: linear-gradient(to bottom, #ff3300, #b30000);
    color: black;
    border: 2px solid #ff0000;
    border-radius: 5px;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 20px #ff0000, inset 0 0 10px #990000;
    transition: all 0.3s ease-in-out;
    animation: buttonPulse 2s infinite alternate;
}
.deploy-button:hover {
    transform: scale(1.1);
    background: linear-gradient(to bottom, #ff1a1a, #800000);
    box-shadow: 0 0 30px #ff0000, inset 0 0 15px #cc0000;
}

@keyframes buttonPulse {
    0% { box-shadow: 0 0 15px #ff0000; }
    100% { box-shadow: 0 0 30px #ff0000, inset 0 0 15px #b30000; }
}

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

.line-reveal {
    opacity: 0;
    animation: lineFadeIn 1.5s ease forwards;
    display: block;
    margin-top: 4px;
    margin-bottom: 4px;
}

.line-reveal:nth-child(1) { animation-delay: 0s; }
.line-reveal:nth-child(2) { animation-delay: 1.5s; }
.line-reveal:nth-child(3) { animation-delay: 4.5s; }
.line-reveal:nth-child(4) { animation-delay: 7.5s; }
.line-reveal:nth-child(5) { animation-delay: 10.5s; }
.line-reveal:nth-child(6) { animation-delay: 12.5s; }
.line-reveal:nth-child(7) { animation-delay: 17.5s; }
.line-reveal:nth-child(8) { animation-delay: 19.5s; }
.line-reveal:nth-child(9) { animation-delay: 22.5s; }
.line-reveal:nth-child(10) { animation-delay: 25.5s; }
.line-reveal:nth-child(11) { animation-delay: 28.5s; }
.line-reveal:nth-child(12) { animation-delay: 31.5s; }

@keyframes lineFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes redFadeToPulse {
    0%   { background-color: rgba(0, 0, 0, 0); }
    100% { background-color: rgba(0, 0, 0, 0.95); }
}

.world-map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('/img/courses/py-intro/world-map.png') no-repeat center center;
    background-size: cover;
    opacity: 0.1;
    z-index: 1;
    pointer-events: none;
}



@keyframes mapPulse {
    0%   { background-color: rgba(128, 0, 0, 0.0); }
    50%  { background-color: rgba(255, 0, 0, 0.85); }
    100% { background-color: rgba(128, 0, 0, 0.0); }
}
.map-pulse-effect {
    animation: mapPulse 0.25s linear;
}

/* Dramatic timer styles */
.dramatic-timer {
	position: fixed;
	top: 610px;
	left: 510px;
	font-size: 2rem;
	color: #ff3333;
	background: rgba(0, 0, 0, 0.7);
	padding: 10px 20px;
	border: 2px solid #ff0000;
	border-radius: 5px;
	font-family: 'Courier New', monospace;
	z-index: 1;
	box-shadow: 0 0 15px #ff0000;
	animation: timerPulse 1s infinite alternate;
}

@keyframes timerPulse {
	from { transform: scale(1); }
	to { transform: scale(1.05); }
}

@keyframes tvOffEffect {
    0% {
        transform: scaleY(1) scaleX(1);
        opacity: 1;
        filter: brightness(1);
    }
    70% {
        transform: scaleY(0.05) scaleX(1.1);
        opacity: 1;
        filter: brightness(2);
    }
    100% {
        transform: scaleY(0) scaleX(0);
        opacity: 1;
        filter: brightness(0);
        background-color: black;
    }
}

body.tv-off {
    animation: tvOffEffect 0.8s ease forwards;
}

.tv-off {
    animation: tvOffEffect 0.8s ease forwards;
}



.glow-container-effect {
    animation: glowSweepContainer 3s ease-in-out infinite;
    position: relative;
}

@keyframes glowSweepContainer {
    0% {
        box-shadow: 0 0 10px #00ffff, inset 0 0 0 #00ffff;
    }
    50% {
        box-shadow: 0 0 40px #00ffff, inset 0 0 30px #00ffff;
    }
    100% {
        box-shadow: 0 0 10px #00ffff, inset 0 0 0 #00ffff;
    }
}

@keyframes verticalGlowSweep {
    0% {
        background-position: 0% 0%;
        opacity: 0;
    }
    25% {
        opacity: 0.4;
    }
    50% {
        background-position: 0% 100%;
        opacity: 0.8;
    }
    75% {
        opacity: 0.4;
    }
    100% {
        background-position: 0% 0%;
        opacity: 0;
    }
}

.glow-container-effect::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 255, 255, 0.2), transparent);
    pointer-events: none;
    animation: verticalGlowSweep 4s ease-in-out infinite;
}


/* News Ticker Styles */
.news-ticker {
	position: fixed;
	bottom: 40px;
	width: 100%;
	background: rgba(0, 0, 0, 0.9);
	color: #ff3333;
	font-family: 'Courier New', monospace;
	font-size: 1.2rem;
	padding: 10px 0;
	overflow: hidden;
	z-index: 9999;
	box-shadow: 0 0 15px red;
	border-top: 2px solid #ff0000;
}

.news-ticker span {
	display: inline-block;
	padding-left: 100%;
	white-space: nowrap;
	animation: tickerScroll 90s linear infinite;
}

@keyframes tickerScroll {
	from { transform: translateX(0); }
	to { transform: translateX(-100%); }
}
@keyframes fadeOutTicker {
    from { opacity: 1; }
    to { opacity: 0; }
}

.news-ticker.fade-out {
    animation: fadeOutTicker 2s ease forwards;
}


.container {
    background-color: transparent !important;
    filter: drop-shadow(0 0 6px #00ffcc);
    position: absolute;
}

/* Ensure pop animation triggers only on first appearance when visible in container */
.container:has(.balloon) .balloon .spanBalloon:not(.initialized) {
    animation: popIn 0.4s ease forwards;
}

.balloon > div {
    width: 80px;
    background: #000 !important;
    color: #00ffcc !important;
    box-shadow: inset 0 0 15px #00ffcc !important;
    border-radius: 5px !important;
    font-family: 'Courier New', monospace;
    text-align: center;
    animation: popIn 5s ease-in-out infinite !important;
    justify-content: flex-start;
    align-items: flex-start;
    display: flex;
    padding-top: 8px;
}

.balloon > div:before {
    content: none !important;
}

@keyframes popIn {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }
    60% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.8;
    }
}

#close {
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 36px;
    cursor: pointer;
}

.survey-description {
    color: white;
}



/* Print overrides to prevent blank output in Safari */
@media print {
    body {
        background: none !important;
        animation: none !important;
        color: black !important;
    }
    body::before,
    body::after {
        display: none !important;
    }
    /* Hide any animated overlays or graphics */
    .terminator-eye,
    .end-overlay,
    .news-ticker,
    .container,
    .balloon {
        display: none !important;
    }
}