* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: #332223; color: #fff1d6; font-family: system-ui, sans-serif; }
main { height: 100dvh; padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom)); display: grid; grid-template-rows: 58px minmax(0, 1fr) 66px; gap: 6px; }
header, footer { display: flex; align-items: center; gap: 8px; }
header { justify-content: space-between; }
.back { display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; border: 1px solid #c99979; border-radius: 14px; background: #573631; color: #fff1d6; text-decoration: none; font-size: 24px; }
.back:focus-visible { outline: 3px solid #60ecda; outline-offset: 2px; }
header > div { min-width: 0; flex: 1; }
h1 { font-size: 21px; margin: 0; letter-spacing: -.6px; }
header span { font-size: 12px; color: #dfb7a4; }
#clock { font-size: 23px; font-variant-numeric: tabular-nums; }
#stage { position: relative; min-height: 0; overflow: hidden; border-radius: 20px; background: #633c32; touch-action: none; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#message { position: absolute; top: 9px; left: 8px; right: 8px; text-align: center; pointer-events: none; font-size: 12px; text-shadow: 0 1px 3px #25191a; }
footer p { flex: 1; font-size: 11px; line-height: 1.45; margin: 0; }
button { min-width: 52px; min-height: 46px; padding: 8px; border: 1px solid #c99979; border-radius: 14px; background: #573631; color: #fff1d6; font: inherit; font-size: 13px; touch-action: manipulation; cursor: pointer; }
button:focus-visible, #stage:focus-visible { outline: 3px solid #60ecda; outline-offset: -3px; }
#veil { position: absolute; inset: 0; background: #251b22ce; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
#veil[hidden] { display: none; }
#veil p { font-size: 20px; }
#resume { min-width: 120px; }
@media (orientation: landscape) and (max-height: 500px) {
  main { grid-template-columns: 170px minmax(0, 1fr); grid-template-rows: 1fr 1fr; }
  header { grid-column: 1; align-self: end; flex-wrap: wrap; }
  #stage { grid-column: 2; grid-row: 1 / 3; }
  footer { grid-column: 1; flex-wrap: wrap; align-content: start; }
  footer p { flex-basis: 100%; }
  h1 { font-size: 20px; }
}
