/* Star Raid. One tall play field in a navy-and-gold frame; app.js sizes the canvas to the room .arena-wrap is given.
   Upright screens: the counters and the pause button in a row above the field.
   A screen held sideways (a desktop, a tablet on its side, a sideways phone): the field is upright, so it takes the whole
   height, with the counters in a column on one side and the pause button on the other. */
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px max(12px, var(--gk-safe-end)) max(12px, var(--gk-safe-bottom)) max(12px, var(--gk-safe-start)); }
.hud { flex: none; display: flex; align-items: center; justify-content: center; gap: 12px; }
.stats, .tools { display: flex; align-items: center; gap: 10px; }
.hud .gk-stat { min-width: 70px; padding: 4px 12px; }
#lives { min-height: 1.25em; letter-spacing: 1px; color: var(--gk-bad); }
.tool { width: 50px; min-height: 50px; padding: 0; font-size: var(--gk-text-xl); line-height: 1; }
.turn-hint { display: none; margin: 0; text-align: center; font-size: var(--gk-text-sm); line-height: var(--gk-read); color: var(--gk-muted); }
.turn-hint span:first-child { display: block; font-size: var(--gk-text-2xl); line-height: var(--gk-tight); color: var(--gk-gold); }

/* The field. The frame is 4px of rim and a 2px gold ring on each side: the 12px app.js leaves for it. */
.arena-wrap { flex: 1; min-width: 0; min-height: 0; width: 100%; display: grid; place-items: center; }
.arena { position: relative; overflow: hidden; border-radius: var(--gk-r-lg); border: 4px solid var(--gk-rim); box-shadow: 0 0 0 2px var(--gk-gold-deep), var(--gk-shadow-2); background: var(--gk-night); direction: ltr; line-height: 0; }
#screen { display: block; touch-action: none; cursor: crosshair; outline: none; }
/* The gun's level and the shields, over the foot of the field. */
.gauges { position: absolute; left: 10px; right: 10px; bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; font-size: var(--gk-text-sm); line-height: 1; text-shadow: var(--gk-shadow-1); }
.power { color: var(--gk-gold); letter-spacing: 1px; } .shield { color: var(--gk-info); letter-spacing: 2px; }
/* Before the first raid (after Back on New game) and while paused: the field is dimmed under a title and one green button. */
.cover { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--gk-s-3); padding: var(--gk-s-3); background: var(--gk-veil); text-align: center; }
.cover h2 { margin: 0; font: var(--gk-bold) var(--gk-text-xl)/var(--gk-tight) var(--gk-font); color: var(--gk-gold-pale); text-shadow: var(--gk-shadow-1); }
.cover .gk-btn { min-width: 128px; }
html[dir=rtl] .cover { direction: rtl; }
/* While the New game pop-up is up on arrival, the field behind it is shown clear. */
html.gk-clear .cover { visibility: hidden; }

/* A phone: no room for the best score. */
@media (max-width: 599px) { .hud { gap: 8px; } .stats, .tools { gap: 8px; } .best-stat { display: none; } .hud .gk-stat { min-width: 62px; padding: 4px 8px; } }
/* A tablet: a larger row above the field. */
@media (min-width: 600px) and (max-width: 1023px) { .stage { gap: 14px; padding-top: 14px; } .hud { gap: 16px; } .hud .gk-stat { min-width: 92px; } }
/* Desktop: larger counters and a larger pause button. */
@media (min-width: 1024px) {
  .stage { gap: 14px; padding-top: 14px; } .hud { gap: 16px; } .hud .gk-stat { min-width: 92px; }
  .tool { width: 64px; min-height: 64px; font-size: var(--gk-text-2xl); }
}
/* Held sideways: three columns, the field in the middle. The widest field is 520 by 640, plus the 12px of frame. */
@media (orientation: landscape) {
  .stage { flex-direction: row; justify-content: center; gap: 22px; }
  .hud { display: contents; }
  .stats, .tools { flex: none; width: 148px; flex-direction: column; align-items: stretch; gap: 12px; }
  .stats { order: 1; } .tools { order: 3; align-items: center; }
  .arena-wrap { order: 2; flex: 0 1 auto; width: auto; height: 100%; aspect-ratio: 532 / 652; }
}
/* A sideways phone: the same three columns, closer together. The field is a narrow upright strip, so a touch screen is told to turn. */
@media (orientation: landscape) and (max-height: 560px) {
  .stage { gap: 12px; padding-top: 6px; padding-bottom: max(6px, var(--gk-safe-bottom)); }
  .stats, .tools { width: 116px; gap: 6px; }
  .hud .gk-stat { min-width: 0; padding: 2px 8px; }
  .tool { width: 48px; min-height: 48px; font-size: var(--gk-text-xl); }
}
@media (orientation: landscape) and (max-height: 560px) and (pointer: coarse) { .turn-hint { display: block; } }
