/* ============================================================
   GA Applications — Experimental Arcade
   Shared base stylesheet (all three games + hub)
   ============================================================ */

:root {
  --bg: #04070c;
  --ink: #dbe9f4;
  --dim: #8298aa;
  --line: #1b2a3a;
  --focus: #8be9ff;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 52px;
}

.topbar .back {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
  text-decoration: none;
  padding: 10px 12px;
  margin: -10px 0 -10px -12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.topbar .back:hover {
  color: var(--ink);
}

.topbar h1 {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
  flex: 1;
  text-align: center;
}

.topbar .tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 18px;
  min-height: 48px;
  min-width: 48px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
  user-select: none;
}

.btn:hover {
  border-color: var(--dim);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  opacity: 0.4;
  cursor: default;
}

.btn[disabled]:active {
  transform: none;
}

/* keyboard focus must always be obvious */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- layout helpers ---------- */
.shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hint {
  color: var(--dim);
  font-size: 13.5px;
  margin: 2px 0 0;
}

.hint kbd {
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.status-line {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  min-height: 1.5em;
  margin: 0;
}

.status-line::before {
  content: "> ";
  color: var(--dim);
}

/* screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* overlay panels inside the playfield frame */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 4, 8, 0.82);
  z-index: 5;
}

.overlay[hidden] {
  display: none;
}

.panel {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--line);
  background: #060a12;
  padding: 22px 20px;
  text-align: center;
}

.panel h2 {
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.panel p {
  color: var(--dim);
  font-size: 14px;
  margin: 8px 0;
}

.panel .btn {
  margin-top: 14px;
  width: 100%;
  min-height: 56px;
}

/* reduced motion: no decorative animation anywhere */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
