/* The arena page (app/index.html): the 3D canvas under the HUD. Thin wiring: block styles live with their blocks. */
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #dfeef8;
}
.app-arena {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  cursor: crosshair;
}
.app-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.app-arena[hidden] { display: none; }
/* The menus (ui/Garage, ui/MenuPages) fill the page; the run's end (ui/RunEnd) stands over the yard. */
.app-menu {
  position: fixed;
  inset: 0;
}
.app-menu:empty { display: none; }
.app-end {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.app-end:empty { display: none; }
.app-stats {
  position: fixed;
  right: 16px;
  bottom: 18px;
  padding: 6px 10px;
  background: #fffaf0;
  border: 2px solid #1d2433;
  font: 600 12px/1.4 "Martian Mono", ui-monospace, monospace;
  color: #1d2433;
  white-space: pre;
  pointer-events: none;
}
.app-noscript {
  margin: 40px;
  font: 600 18px/1.4 sans-serif;
}
/* Online, before the yard arrives (app/arena.js): what is happening, and a way back. */
.tk-online {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  max-width: min(440px, calc(100vw - 32px));
  padding: 18px 22px;
  background: var(--tk-paper, #fffaf0);
  color: var(--tk-ink, #1d2433);
  border: 3px solid var(--tk-ink, #1d2433);
  box-shadow: 0 5px 0 var(--tk-ink, #1d2433);
  font: 600 16px/1.35 var(--tk-font-ui, sans-serif);
  text-align: center;
}
.tk-online__text { margin: 0; }
.tk-online__back {
  margin-top: 14px;
  padding: 8px 16px;
  font: 400 15px/1 var(--tk-font-display, sans-serif);
  background: var(--tk-sun, #ffc928);
  color: var(--tk-ink, #1d2433);
  border: 3px solid var(--tk-ink, #1d2433);
  box-shadow: 0 4px 0 var(--tk-ink, #1d2433);
  cursor: pointer;
}
/* A phone held upright (the mobile pass): the whole game waits under a "turn sideways" card. */
.tk-rotate { display: none; }
@media (orientation: portrait) {
  html[data-touch] .tk-rotate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 24px;
    background: var(--tk-ground, #dfeef8);
    color: var(--tk-ink, #1d2433);
    text-align: center;
  }
}
.tk-rotate__phone {
  width: 54px;
  height: 92px;
  border: 3px solid var(--tk-ink, #1d2433);
  box-shadow: 0 5px 0 var(--tk-ink, #1d2433);
  background: var(--tk-sun, #ffc928);
  animation: tk-rotate-turn 1.8s ease-in-out infinite;
}
.tk-rotate__text { margin: 0; font: 400 20px/1.25 var(--tk-font-display, sans-serif); max-width: 280px; }
@keyframes tk-rotate-turn { 0%, 30% { transform: rotate(0deg); } 60%, 100% { transform: rotate(-90deg); } }
/* No page gestures on a phone: no double-tap zoom, no pull-to-refresh, no text picked up by a held thumb. */
html[data-touch], html[data-touch] body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html[data-touch] .app-arena { touch-action: none; }
html[data-touch] button { touch-action: manipulation; }
/* A phone has no number keys: the offer cards' 1–4 badges go. */
html[data-touch] .tk-botoffer__key { display: none; }
