/* TechVizier Games — dark arcade shell.
   One accent variable is re-pointed per game so the chrome adopts each game's
   colour without a second theme system. */

:root {
  --bg: #0b0f14;
  --surface: #131a23;
  --surface-2: #1a232e;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8eef5;
  --muted: #91a1b4;
  --accent: #4dd6f2;
  --radius: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Notch / home-indicator insets, zero on everything that isn't an iPhone. */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  /* Kills the iOS rubber-band bounce that otherwise fights swipe controls. */
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------- masthead */

.masthead {
  padding: calc(var(--safe-t) + 56px) 20px 40px;
  background:
    radial-gradient(120% 90% at 12% -10%, rgba(77, 214, 242, 0.16), transparent 60%),
    radial-gradient(100% 80% at 90% 0%, rgba(192, 125, 232, 0.14), transparent 55%);
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  max-width: 960px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.masthead h1 {
  margin: 0;
  font-size: clamp(38px, 9vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.lede {
  margin: 14px 0 0;
  max-width: 46ch;
  font-size: clamp(15px, 3.6vw, 18px);
  line-height: 1.55;
  color: var(--muted);
}

.masthead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

/* ------------------------------------------------------------- sections */

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-note {
  margin: 0 0 22px;
  max-width: 60ch;
  line-height: 1.6;
  color: var(--muted);
}

/* ----------------------------------------------------------------- grid */

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-top: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

a.card:hover,
a.card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--surface-2);
}

a.card:active {
  transform: translateY(-1px);
}

.card-art {
  display: grid;
  place-items: center;
  height: 116px;
  color: var(--accent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  border-bottom: 1px solid var(--line);
}

.card-art svg {
  width: 84px;
  height: 74px;
}

.card-body {
  padding: 14px 16px 16px;
}

.card-title {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.card-tagline {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.tags {
  display: flex;
  gap: 6px;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 3px 9px;
}

.card-best {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- ideas */

.grid-ideas {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card-idea {
  background: transparent;
  border-style: dashed;
}

.card-note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(145, 161, 180, 0.8);
}

.pill {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 10px;
}

.pill-next {
  color: #7ef0b0;
  background: rgba(126, 240, 176, 0.12);
}

.pill-exploring {
  color: #f7d154;
  background: rgba(247, 209, 84, 0.12);
}

.pill-someday {
  color: #9fb3c8;
  background: rgba(159, 179, 200, 0.12);
}

/* ---------------------------------------------------------------- notes */

.notes {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 18px;
}

.note h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.note p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px calc(var(--safe-b) + 36px);
  font-size: 13px;
  color: rgba(145, 161, 180, 0.7);
}

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px; /* iOS minimum comfortable tap target */
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #08111a;
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, white);
}

/* --------------------------------------------------------------- player */

#player {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.hud-btn {
  min-width: 44px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.hud-btn.is-off {
  color: var(--muted);
  opacity: 0.6;
}

.hud-tools {
  display: flex;
  gap: 8px;
}

.hud-scores {
  display: flex;
  gap: 22px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.status {
  margin: 0;
  padding: 6px 12px 0;
  min-height: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.stage {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0; /* lets the canvas shrink inside the flex column */
  padding: 10px;
}

.game-canvas {
  display: block;
  border-radius: 12px;
  background: var(--bg);
}

/* ------------------------------------------------------------- touchpad */

.touchpad {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px 14px;
}

.pad-btn {
  flex: 1;
  max-width: 96px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.pad-btn:active {
  background: color-mix(in srgb, var(--accent) 26%, var(--surface));
}

/* Pointing devices get keyboard control, so the on-screen pad is noise. */
@media (hover: hover) and (pointer: fine) {
  .touchpad {
    display: none;
  }
}

/* -------------------------------------------------------------- overlay */

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 9, 13, 0.78);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.overlay-card {
  width: min(420px, 100%);
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: center;
}

.overlay-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.overlay-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.controls {
  margin: 20px 0 0;
  text-align: left;
}

.controls > div {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.controls dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.controls dd {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
