/* Shared arcade shell and controls. Each game owns its palette, scene overlays,
   and responsive positions in its own stylesheet, loaded after this file. */
:root {
  color-scheme: dark;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  color: var(--cream);
  font-family: 'Trebuchet MS', sans-serif;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
}
.topbar {
  height: 60px;
  max-width: 1600px;
  margin: auto;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 11px monospace;
  letter-spacing: 1px;
}
.terminal {
  color: var(--mint);
}
.topbar button,
.bottom-bar button {
  color: var(--cream);
  border-radius: 6px;
  font: 10px monospace;
  padding: 9px 12px;
}
#game-shell {
  position: relative;
  min-height: 0;
  max-width: 1540px;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
}
.hud {
  position: absolute;
  z-index: 2;
  left: 30px;
  right: 30px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}
.stats {
  display: flex;
  border-radius: 10px;
}
.stats > div {
  border-right: 1px solid #fff2;
}
.stats > div:last-child {
  border: 0;
}
.stats span {
  display: block;
  font: 10px monospace;
  letter-spacing: 1px;
  color: var(--muted);
}
.stats strong {
  display: block;
  font-variant-numeric: tabular-nums;
}
.bottom-bar {
  position: absolute;
  z-index: 3;
  left: 30px;
  right: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.keyboard-help {
  font: 10px monospace;
}
kbd {
  font: inherit;
  padding-bottom: 2px;
}
.bottom-bar button {
  font-size: 10px;
}
#toast {
  position: absolute;
  z-index: 6;
  left: 50%;
  transform: translate(-50%, -8px);
  opacity: 0;
  background: var(--cream);
  text-align: center;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.overlay {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: flex;
  align-items: center;
}
.menu-card {
  border-radius: 15px;
}
.menu-card > .eyebrow {
  color: var(--mint);
}
.menu-card h2 {
  font-weight: 600;
  margin: 16px 0;
}
.menu-card > p {
  font-size: 13px;
  line-height: 1.7;
}
.intro-details {
  display: grid;
  gap: 14px;
}
.intro-details > div {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.intro-details p {
  font-size: 11px;
  margin: 0;
  line-height: 1.6;
}
.intro-details strong {
  display: block;
  color: var(--cream);
  font-size: 12px;
  font-weight: 600;
}
.primary {
  width: 100%;
  border: 0;
  background: var(--mint);
  padding: 15px 19px;
  border-radius: 7px;
  font-size: 12px;
  letter-spacing: 1px;
  font-weight: bold;
  text-align: left;
}
.menu-card .menu-note {
  font: 10px/1.8 monospace;
  text-align: center;
  margin: 14px 0 0;
}
.secondary {
  width: 100%;
  background: transparent;
  margin-top: 10px;
  padding: 12px;
  border-radius: 6px;
  font: 10px monospace;
  letter-spacing: 1px;
}
.results div {
  padding-top: 12px;
}
.load-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 10;
  font: 12px/1.8 monospace;
  padding: 30px;
  text-align: center;
  color: var(--mint);
}
footer {
  height: 45px;
  max-width: 1540px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 10px monospace;
  padding: 0 12px;
}
.hidden {
  display: none !important;
}
.touch-controls {
  position: absolute;
  z-index: 4;
  bottom: 57px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.touch-controls > div {
  display: flex;
  pointer-events: auto;
}
.touch-controls button {
  height: 55px;
  color: var(--cream);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Compact minimaps retain their visual markers and accessible names. The main
   target panel provides the destination, leaving space for readable HUD text. */
@media (max-width: 650px), (max-height: 520px) and (orientation: landscape) {
  footer > :nth-child(n + 2),
  .game-brand .eyebrow,
  .map-panel .map-title,
  .map-panel .map-legend {
    display: none;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .results:not(.hidden) ~ .menu-note {
    display: none;
  }
}
