/* The page the game runs in (README.md): what is shown before the engine draws, and the plain black behind it after. */
@font-face { font-family: "Jersey 10"; src: url(fonts/jersey10.woff2) format("woff2"); }
@font-face { font-family: "VT323"; src: url(fonts/vt323_vietnamese.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "VT323"; src: url(fonts/vt323.woff2) format("woff2"); }

html, body { margin: 0; height: 100%; background: #070a18; color: #fff8e0; overflow: hidden; touch-action: none; }
#backdrop { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
#canvas { position: absolute; top: 0; left: 0; display: block; outline: none; opacity: 0; transition: opacity 0.5s; }
.drawn #canvas { opacity: 1; }

/* Once the game is played the page is plain black behind it. */
.in-game { background: #000; }
.in-game #backdrop { display: none; }

#loader {
	position: fixed; inset: 0; z-index: 2; box-sizing: border-box; padding: clamp(24px, 9vh, 110px) 20px clamp(190px, 42vh, 430px);
	display: flex; flex-direction: column; align-items: center; justify-content: space-between;
	font-family: "VT323", monospace; text-align: center; transition: opacity 0.5s;
}
.drawn #loader { opacity: 0; visibility: hidden; transition: opacity 0.5s, visibility 0s 0.5s; }
.eyebrow { margin: 0; font-size: 22px; letter-spacing: 0.22em; text-transform: uppercase; color: #a8d4ff; text-shadow: 0 2px 0 #0b1024; }
h1 {
	margin: 4px 0 0; font: 400 clamp(64px, 11vw, 150px)/0.9 "Jersey 10", monospace; letter-spacing: 0.02em;
	background: linear-gradient(180deg, #fff8e0 0%, #ffe08a 38%, #ffbf4d 55%, #c9802a 78%, #a8621a 100%);
	-webkit-background-clip: text; background-clip: text; color: transparent;
	filter: drop-shadow(0 4px 0 #7a3d0c) drop-shadow(0 8px 0 rgb(7 10 24 / 0.65)) drop-shadow(0 0 22px rgb(255 154 46 / 0.35));
}
.slogan { margin: 14px 0 0; font-size: clamp(22px, 2.4vw, 32px); text-shadow: 0 2px 0 #0b1024; }
#progress { width: min(560px, 86vw); }
/* The bar's groove with its full part over it, seen as far as it came: a window (#part, the 130 of the bar's 140 pixels
   inside its ends) moved left and the picture in it moved back, so that only transforms change, which the browser moves
   by itself while the engine holds the page (loader.js). */
#bar { position: relative; aspect-ratio: 140 / 11; image-rendering: pixelated; }
#bar canvas { position: absolute; top: 0; height: 100%; }
#track { left: 0; width: 100%; }
#part { position: absolute; top: 0; bottom: 0; left: calc(100% * 5 / 140); width: calc(100% * 130 / 140); overflow: hidden; transform: translateX(-100%); }
#full { left: calc(-100% * 5 / 130); width: calc(100% * 140 / 130); transform: translateX(calc(100% * 130 / 140)); }
.starting #step { animation: breathe 1.2s ease-in-out infinite alternate; }
@keyframes breathe { from { opacity: 1; } to { opacity: 0.45; } }
.line { display: flex; justify-content: space-between; gap: 16px; margin: 8px 6px 0; font-size: 22px; color: #b8cce6; text-shadow: 0 2px 0 #0b1024; }
#tip { min-height: 1.3em; margin: 14px 0 0; font-size: 21px; color: #a8d4ff; text-shadow: 0 2px 0 #0b1024; transition: opacity 0.3s; }
#note { margin: 10px 0 0; font-size: 17px; color: #b8cce6; opacity: 0.75; text-shadow: 0 2px 0 #0b1024; }
#tip.changing { opacity: 0; }
.failed #tip, .failed #note { display: none; }
#problem { display: none; margin: 12px auto 0; padding: 12px 16px; max-width: 520px; border: 2px solid #e24b4a; background: rgb(30 10 16 / 0.92); font-size: 21px; color: #ffd9d3; }
.failed #problem { display: block; }
#problem p { margin: 0; }
#problem button { margin: 10px auto 0; display: none; }
.may-retry #problem button { display: block; }

/* A phone, a tablet: told to open the game on a computer, nothing loaded. */
.no-computer #bar, .no-computer .line { display: none; }

button { font: 22px "VT323", monospace; color: #eaf2ff; background: #141b33; border: 2px solid #7fa3c7; padding: 4px 18px; cursor: pointer; }
button:hover, button:focus-visible { background: #1d2850; border-color: #a8d4ff; }
#corner { position: fixed; top: 14px; left: 14px; z-index: 3; display: flex; gap: 10px; }
#float, #renew { display: none; }
.in-game.can-float:not(.floating) #float { display: block; }
.newer #renew { display: block; }

/* Words in the middle of the plain page: behind the game while it is played here (#reminder, the canvas is see-through),
   alone while it is in its floating window (#away). */
#reminder, #away { position: fixed; inset: 0; display: none; place-items: center; padding: 0 20px; font: 30px "VT323", monospace; text-align: center; text-shadow: 0 2px 0 #0b1024; }
#reminder { color: #8fa6c4; }
#away small { display: block; margin-top: 14px; font-size: 24px; color: #8fa6c4; }
.in-game:not(.floating) #reminder { display: grid; }
.floating #away { display: grid; }

@media (max-height: 520px) { .slogan, #tip, #note { display: none; } }
@media (prefers-reduced-motion: reduce) { #canvas, #loader, #tip, .drawn #loader { transition: none; } .starting #step { animation: none; } }
