/* Camera control screens. Big type: the player reads these from two metres back. */
.body-layer { position: fixed; inset: 0; z-index: 10; pointer-events: none; font-family: -apple-system, system-ui, sans-serif; }
.body-layer > * { pointer-events: auto; }
.body-layer [hidden] { display: none !important; }

.body-screen { position: absolute; inset: 0; background: rgba(10, 14, 28, .93); backdrop-filter: blur(6px); color: #f6efe0; padding: 18px 28px; }
.body-screen.setup { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
.body-screen.walk { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: rgba(10, 14, 28, .86); }
.body-screen .col { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.body-screen .col.main { text-align: center; }
.body-screen .col.side { justify-content: center; overflow-y: auto; }
.body-screen .group { display: flex; flex-direction: column; gap: 10px; }

.body-layer .title { font-weight: 900; font-size: 46px; letter-spacing: .02em; line-height: 1.05; }
.body-layer .title.huge { font-size: 60px; }
.body-layer .title.good { color: #5de39a; }
.body-layer .say { font-size: 20px; color: #ffdf3d; max-width: 900px; margin: 0 auto; }
.body-layer .where { font-weight: 900; font-size: 26px; min-height: 32px; }
.body-layer .hint { font-size: 20px; color: #ff9a50; min-height: 26px; font-weight: 600; }
.body-layer .progress { font-size: 16px; font-weight: 800; color: #7cc4ff; letter-spacing: .1em; }
.body-layer .head { font-weight: 900; font-size: 20px; }
.body-layer .head.big { font-size: 26px; }
.body-layer .small { font-size: 13px; color: rgba(255, 255, 255, .62); }
.body-layer .ticks { font-weight: 800; font-size: 22px; color: rgba(124, 196, 255, .55); line-height: 1.5; }
.body-layer .ticks .ok { color: #7cc4ff; }

.body-screen .camview { flex: 1; min-height: 180px; width: 100%; display: block; }
.body-screen.walk .camview { max-width: 1100px; }

.body-layer .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.body-layer .bbtn { font: 800 16px/1 -apple-system, system-ui, sans-serif; letter-spacing: .04em; color: #f6efe0; background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 8px; padding: 14px 18px; cursor: pointer; }
.body-layer .bbtn:hover { background: rgba(255, 255, 255, .18); }
.body-layer .bbtn.go { background: #2f9e62; border-color: #5de39a; }
.body-layer .bbtn.go:hover { background: #38b672; }

.body-layer .setting .shead { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; }
.body-layer .setting .shead b { color: #ffdf3d; }
.body-layer .setting input { width: 100%; accent-color: #ffdf3d; }
.body-layer .toggle { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 14px; cursor: pointer; }
.body-layer .toggle input { width: 18px; height: 18px; accent-color: #5de39a; }

/* "Wave to start" / "step back in", over the held run. */
.body-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(10, 14, 28, .84); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .15); border-radius: 14px; padding: 22px 30px; text-align: center; color: #f6efe0; display: flex; flex-direction: column; gap: 10px; min-width: 420px; }
.body-card .title { font-size: 54px; color: #5de39a; }
.body-card .meter { height: 8px; background: rgba(255, 255, 255, .12); border-radius: 4px; overflow: hidden; }
.body-card .meter i { display: block; height: 100%; width: 0; background: #ffdf3d; transition: width .1s; }

/* The player's picture during a run. */
.body-layer .camview.corner { position: absolute; right: 14px; bottom: 14px; width: 240px; height: 135px; pointer-events: none; border-radius: 8px; }
.body-status { position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); background: rgba(8, 10, 14, .8); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 15px; font-weight: 600; }

@media (max-width: 900px) {
  .body-screen.setup { grid-template-columns: 1fr; overflow-y: auto; }
  .body-layer .title { font-size: 32px; }
  .body-layer .title.huge { font-size: 40px; }
  .body-card { min-width: 0; width: calc(100% - 32px); }
}

/* Title, over the game while it loads. */
.body-screen.title-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; background: rgba(10, 14, 28, .82); }
.body-layer .logo { font-weight: 900; font-size: 92px; letter-spacing: .02em; line-height: 1; color: #ffdf3d;
  -webkit-text-stroke: 4px #2b1200; paint-order: stroke fill; text-shadow: 0 6px 0 #b3261e, 0 12px 28px rgba(0, 0, 0, .5); }
.title-screen .camview { width: min(420px, 80vw); height: 236px; flex: none; }
.title-screen .status { font-size: 18px; font-weight: 700; color: #7cc4ff; min-height: 24px; }
.title-screen .meter { width: 260px; height: 8px; background: rgba(255, 255, 255, .12); border-radius: 4px; overflow: hidden; }
.title-screen .meter i { display: block; height: 100%; width: 0; background: #ffdf3d; transition: width .1s; }
.title-screen .bbtn { font-size: 18px; padding: 16px 22px; }

/* Move test. */
.body-screen.movetest { display: grid; grid-template-columns: 1fr 380px; gap: 22px; }
.movetest .tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.movetest .tile { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; }
.movetest .tile .tname { font-weight: 900; font-size: 16px; letter-spacing: .05em; }
.movetest .tile b { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.movetest .tile .note { font-size: 12px; color: rgba(255, 255, 255, .6); min-height: 15px; }
.movetest .tile.fire { animation: tilefire .6s ease-out; }
@keyframes tilefire { 0% { background: #5de39a; color: #0a0e1c; transform: scale(1.08); } 100% { background: rgba(255, 255, 255, .07); transform: scale(1); } }
.movetest .readout { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.movetest .rrow { display: grid; grid-template-columns: 88px 1fr 42px 42px; gap: 8px; align-items: center; }
.movetest .rrow b { text-align: right; font-variant-numeric: tabular-nums; }
.movetest .rrow em { text-align: right; font-style: normal; color: #ffdf3d; font-variant-numeric: tabular-nums; }
.movetest .rrow.note { display: block; color: #7cc4ff; font-weight: 600; }
.movetest .bar { position: relative; height: 10px; background: rgba(255, 255, 255, .1); border-radius: 5px; }
.movetest .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #ff9a50; border-radius: 5px; }
.movetest .bar i.ok { background: #5de39a; }
.movetest .bar u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #ffdf3d; }
@media (max-width: 900px) {
  .body-screen.movetest { grid-template-columns: 1fr; overflow-y: auto; }
  .movetest .tiles { grid-template-columns: repeat(3, 1fr); }
  .body-layer .logo { font-size: 56px; }
}

/* Loading: bar under the buttons; the play button shows the percentage until ready. */
.title-screen .loadbar { width: min(360px, 70vw); height: 6px; background: rgba(255, 255, 255, .12); border-radius: 3px; overflow: hidden; transition: opacity .4s; }
.title-screen .loadbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffdf3d, #ff9a50); transition: width .25s; }
.title-screen .loadbar.done { opacity: 0; }
.body-layer .bbtn:disabled { opacity: .65; cursor: progress; font-variant-numeric: tabular-nums; }
.body-layer .bbtn.big { font-size: 24px; padding: 18px 56px; border-radius: 12px; }
.body-screen.title-screen { background: linear-gradient(rgba(10, 14, 28, .55), rgba(10, 14, 28, .88)); }
.title-screen .touchhelp { font-size: 14px; max-width: 520px; line-height: 1.5; }

/* Pause on touch devices (no Esc). */
.body-layer .bbtn.pause { position: absolute; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); width: 44px; height: 44px; padding: 0;
  font-size: 14px; letter-spacing: -1px; border-radius: 50%; background: rgba(8, 10, 14, .45); border-color: rgba(255, 255, 255, .25); }

/* Short landscape phones. */
@media (max-height: 500px) {
  .body-screen.title-screen { gap: 8px; padding: 10px 16px; }
  .body-layer .logo { font-size: 48px; }
  .body-layer .say { font-size: 16px; }
}
.body-layer .bbtn.pause::before, .body-layer .bbtn.pause::after { content: ''; position: absolute; top: 14px; width: 5px; height: 16px; border-radius: 2px; background: #fff; }
.body-layer .bbtn.pause::before { left: 15px; }
.body-layer .bbtn.pause::after { right: 15px; }
.title-screen .controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 620px; font-size: 15px; color: #f6efe0; }
.title-screen .controls span { display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .1); border-radius: 999px; padding: 5px 14px 5px 5px; }
.title-screen .controls b { font-size: 14px; font-weight: 900; padding: 5px 9px; border-radius: 999px; background: #ffdf3d; color: #1a1408; }
