/* SPDX-License-Identifier: LicenseRef-Bitcoin-Arena-1.0 */
/* Copyright (c) 2026 The Bitcoin Arena authors. See LICENSE. */
/* TICK TOCK'S PART OF THE ARENA PAGE'S STYLE (kanban #521): the next round's box, moved out of the page's <style> as it was */
/* THE NEXT ROUND (2026-09-28, option 1 of A; spec "Timing - every network, every round"): after the result
   card, "joining next round in N seconds" beside "exit game" until the next start. */
#arena-next { position: fixed; left: 50%; bottom: 18%; transform: translateX(-50%); z-index: 35; display: none;
  align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; max-width: calc(100% - 32px); box-sizing: border-box;
  background: rgba(13,16,20,0.95); border: 2px solid #f7931a; color: #e8eaed; font: 700 16px/1.25 system-ui, sans-serif; }
/* SIDE BY SIDE ON A PHONE, NEITHER OVER THE OTHER (SPECTATE-2158: "exit game" lay on the countdown words): the words
   take the room left of the button and wrap inside it; the button keeps its own width. */
#arena-next-say { flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
#arena-next { width: max-content; }
/* "SECURING YOUR RUN" UNDER THE ARENA'S BAR (the owner 2026-10-30 playtest: at the foot it lay on "exit game", in landscape the box sits at the same bottom edge): the top of the
   screen is free of the box and of the touch pads */
#arena-securing { top: calc(49px + env(safe-area-inset-top, 0px)); bottom: auto !important; }
/* NEVER ONE LETTER A LINE (measured 2026-10-18 on a 390 px phone: beside "Buy add-ons", "Donate" and "exit game"
   the words had no room left and stood one letter per line down the box): the words keep at least 10em, and the buttons
   that do not fit beside them wrap to a row of their own; on a phone the words take the first row whole. */
#arena-next { flex-wrap: wrap; justify-content: center; } #arena-next-say { min-width: min(10em, 100%); }
@media (max-width: 520px) { #arena-next { width: calc(100% - 32px); font-size: 15px; } #arena-next-say { flex-basis: 100%; text-align: center; } }
/* AT THE BOTTOM EDGE IN LANDSCAPE (MF 19: at 18% up it stood over the result summary - "1 still driving",
   "YOU PENDING" - and a wreck's summary has no room above it there). Between the touch pads, which sit in the bottom
   corners; upright there is room above 18%, and on a touch screen it goes above the pads (below). Unity reads its top
   (nextBoxTop) and ends the card above it. */
@media (orientation: landscape) { #arena-next { bottom: max(10px, env(safe-area-inset-bottom)); } }
@media (orientation: landscape) and (max-height: 460px) { #arena-next { padding: 6px 10px; font-size: 14px; gap: 10px; }
  #arena-next-exit { padding: 5px 10px; } }
/* on a touch screen no wider than the gap between the pads: each corner group is 2 buttons of 20% of the short side and
   1.5 margins of 3.5% (TouchPad.ButtonSize, Margin) - 45.25vh a side; the words wrap inside */
@media (orientation: landscape) and (pointer: coarse) { #arena-next { max-width: calc(100vw - 92vh); } }
/* upright on a touch screen, above the pads: their top is 2 buttons and 1.5 margins up (45.25vw) */
@media (orientation: portrait) and (pointer: coarse) { #arena-next { bottom: max(18%, calc(45.25vw + 10px)); } }
#arena-next-exit { flex: none; font: inherit; padding: 9px 14px; cursor: pointer; background: #1e2833; color: #e8eaed;
  border: 1px solid #3a4a5c; border-radius: 6px; }
#arena-next-addons { flex: none; font: inherit; padding: 9px 12px; cursor: pointer; background: #f7931a; color: #111;
  border: 1px solid #f7931a; border-radius: 6px; }
@media (orientation: landscape) and (max-height: 460px) { #arena-next-addons { padding: 5px 10px; } }
/* DONATE IN THE COUNTDOWN (2026-10-17: "Ticktok location accepted") */
#arena-next-donate { flex: none; font: inherit; padding: 9px 12px; cursor: pointer; background: #1b1408; color: #f7931a; border: 1px solid #f7931a; border-radius: 6px; }
@media (orientation: landscape) and (max-height: 460px) { #arena-next-donate { padding: 5px 10px; } }
body.arena-clean #arena-next { display: none !important; }

/* TICK TOCK'S LOADING SCREEN AND SETTINGS (kanban #521 step 3: the CSS goes with the game that owns it): Unity's canvas, the
   title and its line, the gold panel Unity's lobby is drawn in, the 90 -> 100 % creep and the 91 ... 99 % steps, the how-to,
   the download line, the note, the graphics settings - what another game's loading screen does not show. Moved in their order. */
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#title { font-size: clamp(22px, 5vw, 40px); font-weight: 700; letter-spacing: -0.02em; }
#title span { color: #f7931a; }               /* the one bitcoin orange */
#title { display: flex; align-items: center; gap: 0.45em; }
#logo { width: 1.5em; height: 1.5em; flex: none; }
/* THE GAME'S OWN PANEL, ALREADY ON THE LOADING SCREEN (2026-10-17: "the header slightly jumps between the
   screens 'loading a game' and 'the game' ... make it consistent"). Measured on UI 188: the loading title sat unframed ~1,100 px
   wide; Unity's lobby (SplashScreen.Measure) draws it in a gold head of a panel min(86 % w, 900) x min(88 % h, 760) - the
   title jumped up into the frame and to capitals as Unity took over. The page now draws that panel at Unity's rectangle
   (bootPanel() below, the same arithmetic in CSS pixels - BlwpUiScale makes Unity's units the canvas's CSS pixels), so only
   what is inside it changes. Another game's loading screen keeps its own look. */
#boot-panel { display: none; }
html:not(.other-game) #boot.paneled > #boot-panel { display: block; position: absolute; left: var(--px); top: var(--py); width: var(--pw); height: var(--ph);
  box-sizing: border-box; border: 2px solid rgba(255, 214, 79, 0.85); background: linear-gradient(#1a1d26f0, #0e0f13f0);
  box-shadow: 0 0 0 1px rgba(255, 214, 79, 0.12), 0 0 6px rgba(255, 214, 79, 0.34); pointer-events: none; z-index: -1; }   /* under the words, over #boot's ground */
/* THE HEAD INSIDE THE FRAME (kanban #789, the owner 2026-10-29 playtest: "der Header schneidet den Rahmen"): it sat 2 px over the gold border
   on three sides, so the frame stopped at the head and only its corners showed; inside it, the border runs round the whole panel */
#boot-panel .head { position: absolute; left: 0; right: 0; top: 0; height: var(--hh);
  background: linear-gradient(#2b2412fa, #12110dfa); border-bottom: 3px solid #ffd64f; box-sizing: border-box; }
html:not(.other-game) #boot.paneled > #title { position: absolute; left: var(--px); top: var(--py); width: var(--pw); height: var(--hh);
  justify-content: center; gap: var(--tg); font-size: var(--tf); line-height: 1; letter-spacing: 0; color: #ffd64f; text-transform: uppercase;
  text-shadow: 3px 4px 0 rgba(0, 0, 0, 0.6); z-index: 1; margin: 0; }
html:not(.other-game) #boot.paneled > #title span { color: inherit; }
html:not(.other-game) #boot.paneled > #title #logo { width: var(--tm); height: var(--tm); }
html:not(.other-game) #boot.paneled { padding: var(--ct) var(--ir) var(--cb) var(--ix); justify-content: center; }
html:not(.other-game) #boot.paneled #track { width: min(440px, var(--iw)); }
html:not(.other-game) #boot.paneled #howto { --h: min(calc((min(var(--iw), var(--hw)) - 18px) / 6.248), 30vh); }
@media (orientation: portrait) { html:not(.other-game) #boot.paneled #howto { width: min(var(--iw), var(--hw)); } }
html:not(.other-game) #boot.paneled { gap: var(--gap); }
/* 90 -> 100 % NEVER STANDS STILL (2026-10-08: "add 90-100 sub steps ... so it never feels like it
   stalls"): Unity's own start holds the main thread for seconds in one piece, and no text can repaint inside it. This
   layer creeps from 90 % towards 99 % by a TRANSFORM animation, which the compositor runs while the main thread is busy. */
#arena-set-graphics .fps-toggle { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; cursor: pointer; }
#arena-set-graphics .fps-toggle input { width: 18px; height: 18px; accent-color: #f7931a; }
/* ONE BAR, NOT TWO (2026-10-11: "split in two: one stretch to 90, then another to 100. It should be
   one bar"): the creep starts on the colour the bar ends on, and while it runs the bar's own end is square - before, a
   rounded cap at 90 % and a lighter second gradient after it read as a second bar */
#creep { position: absolute; left: 90%; top: 0; height: 100%; width: 10%; transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, #ffc46b, #ffd08a); border-radius: 0 99px 99px 0; }
#track.creeping #bar { border-top-right-radius: 0; border-bottom-right-radius: 0; }
#creep.on { animation: creep90 6s cubic-bezier(0.15, 0.7, 0.3, 1) 0.25s forwards; }
/* AND THE NUMBER (measured: inside Unity's one-piece start the text cannot repaint - the screencast showed
   "90 %" for all 2.2 s at 10x CPU while the creep bar moved): "91 %" ... "99 %" are drawn in advance and shown one after
   another by OPACITY animations, which the compositor runs while the main thread is busy; 99 % holds until Unity says 100. */
#pctwrap { display: grid; justify-items: center; }
#pctwrap > #pct, #pctwrap > #pct-steps { grid-area: 1 / 1; }
#pct-steps { display: grid; justify-items: center; font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 600; pointer-events: none; }
#pct-steps > span { grid-area: 1 / 1; opacity: 0; will-change: opacity; }
#pctwrap.on > #pct { opacity: 0; }
/* LINEAR keyframes, not step-start: measured, a stepped opacity animation stayed on the main thread and froze on "91 %" */
#pctwrap.on > #pct-steps > span { animation: pctstep 0.3s linear; }
#pctwrap.on > #pct-steps > span:last-child { animation: pctlast 0.3s linear forwards; }
@keyframes pctstep { 0% { opacity: 1; } 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pctlast { 0% { opacity: 1; } 100% { opacity: 1; } }
@keyframes creep90 { from { transform: scaleX(0); } to { transform: scaleX(0.9); } }
/* THE OWNER'S HOW-TO ON THE LOADING SCREEN (2026-09-14 07:55): four panels,
   each whole and never stretched, white knocked out for this dark ground -
   1-2-3-4 in a row on a wide screen, 1-2 over 3-4 on a tall one, shrunk to
   fit and no smaller than readable. A phone on its side gets a shorter row so
   the bar and the words under it stay on screen. */
/* Each panel is cut from the owner's whole at its true edges (tools/cut-howto.py)
   and keeps its own shape: in a row all four share one height (6.248 = the
   four widths over that height); 1-2 over 3-4 is two equal columns, each
   panel at its natural height. */
#howto { --h: min(calc((min(1100px, 94vw) - 18px) / 6.248), 30vh);
  display: flex; gap: 6px; justify-content: center; align-items: flex-start; }
#howto img { display: block; height: var(--h); width: auto; }
@media (orientation: portrait) {
  #howto { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; width: min(620px, 94vw, 66vh); }
  #howto img { width: 100%; height: auto; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #howto { --h: min(calc((94vw - 18px) / 6.248), 26vh); }
}
#pct { font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 600; }
/* THE DOWNLOAD, IN MEGABYTES AND MB/s */
#dl { color: #c9d1d9; font: 600 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 1.4em; text-align: center; font-variant-numeric: tabular-nums; }
#note { color: #5c6570; font-size: 12px; max-width: 460px; text-align: center; }
