/* Loading screen in the main menu's CRT look (colours from ui.gd, corner labels from menu.gd).
   Copied into dist/loading/ by pack.sh, linked from html/head_include in game/export_presets.cfg. */
@font-face { font-family: Junker; src: url(junker.ttf); font-display: block; }
@font-face { font-family: Zerocool; src: url(zerocool.ttf); font-display: block; }

/* Godot's own overlay: keep it only for its error notice, above us */
#status { background: none !important; z-index: 3; pointer-events: none; }
#status-splash, #status-progress { display: none !important; }

#dr-load {
	--u: min(calc(100vw / 1280), calc(100vh / 720));  /* one pixel of the game's 1280x720 canvas */
	--green: #8cff6b; --dim: #478c38;
	position: fixed; inset: 0; z-index: 2; overflow: hidden;
	background: #030904; color: var(--green);
	font-family: Junker, monospace; font-size: calc(28 * var(--u)); letter-spacing: .04em;
	text-shadow: 1px 0 rgba(255, 40, 40, .35), -1px 0 rgba(40, 140, 255, .35), 0 0 .45em rgba(140, 255, 107, .45);
	transition: opacity .25s;
}
#dr-load.ready { cursor: pointer; }
#dr-load.ready #dr-note { color: var(--green); font-size: calc(28 * var(--u)); text-align: center; margin-top: calc(24 * var(--u)); animation: dr-blink 1.2s steps(1) infinite; }
/* turning on: the text goes, a beat of black (the switch click), then a bright line opens to the full
   screen and fades, showing the menu (timed to the power-on thunk in crt_on.mp3) */
#dr-load.on > * { opacity: 0; transition: opacity .1s; }
#dr-load.on { background: transparent; transition: background .3s .6s; }
#dr-load::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 0; background: #e4ffd8; opacity: 0; pointer-events: none; }
#dr-load.on::after { animation: dr-on .4s .55s ease-out forwards; }
@keyframes dr-on { 0% { top: 50%; height: 2px; opacity: 1; } 45% { top: 0; height: 100%; opacity: .55; } 100% { top: 0; height: 100%; opacity: 0; } }
#dr-load .c { position: absolute; font-size: calc(22 * var(--u)); }
#dr-load .tl { left: calc(48 * var(--u)); top: calc(30 * var(--u)); }
#dr-load .tr { right: calc(48 * var(--u)); top: calc(30 * var(--u)); }
#dr-load .bl { left: calc(48 * var(--u)); bottom: calc(30 * var(--u)); }
#dr-load .br { right: calc(48 * var(--u)); bottom: calc(30 * var(--u)); }
#dr-load .mid {
	position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
	display: flex; flex-direction: column; gap: calc(14 * var(--u)); width: calc(620 * var(--u));
}
#dr-load .t { font-size: calc(34 * var(--u)); text-align: center; margin-bottom: calc(14 * var(--u)); }
#dr-load .dim { color: var(--dim); font-size: calc(20 * var(--u)); }
#dr-load #dr-step::after { content: "_"; animation: dr-blink 1s steps(1) infinite; }
#dr-load .bar { height: calc(30 * var(--u)); border: calc(2 * var(--u)) solid var(--green); padding: calc(4 * var(--u)); box-shadow: 0 0 .5em rgba(140, 255, 107, .3); }
#dr-load .bar i {
	display: block; height: 100%; width: 0;
	background: repeating-linear-gradient(90deg, var(--green) 0 calc(16 * var(--u)), transparent 0 calc(22 * var(--u)));
	transition: width .2s steps(4);
}
#dr-load.busy .bar i { width: 24%; animation: dr-slide 1.4s steps(14) infinite alternate; }
#dr-load .logo {
	position: absolute; left: 0; right: 0; bottom: calc(40 * var(--u)); text-align: center;
	font-family: Zerocool, Junker, monospace; font-size: calc(96 * var(--u)); letter-spacing: 0;
}
/* the tube: scanlines, vignette, dark rounded corners, mains flicker */
#dr-load .tube {
	position: absolute; inset: 0; pointer-events: none;
	background:
		repeating-linear-gradient(to bottom, rgba(0, 0, 0, .35) 0 1px, transparent 1px 3px),
		radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, .6) 100%);
	box-shadow: inset 0 0 calc(60 * var(--u)) calc(14 * var(--u)) #000;
	border-radius: calc(36 * var(--u));
	outline: calc(40 * var(--u)) solid #000;
	animation: dr-flicker .09s steps(2) infinite;
}
@keyframes dr-blink { 50% { opacity: 0; } }
@keyframes dr-slide { to { margin-left: 76%; } }
@keyframes dr-flicker { 50% { opacity: .94; } }
@media (prefers-reduced-motion: reduce) { #dr-load .tube, #dr-load.busy .bar i { animation: none; } }
