/*
 * Munch Maze website: tokens, fonts, resets and the few shared building blocks (container,
 * eyebrow, glow text, card, button, chip, form field). Dark only, in the game's palette and
 * the screen designs' look (docs/design.md). Components and pages use only these tokens.
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
}

:root {
  color-scheme: dark;

  /* The game's colours (flutter-app/lib/theme/palette.dart, design/screens.html) */
  --bg: #0b0b1e;
  --surface: #15153a;
  --surface-2: #1e1e4d;
  --line: #2e2e6b;
  --track: #2e2e6b;
  --ink: #f2f2ff;
  --muted: #9a9ac8;
  --primary: #ffd23f;
  --primary-hover: #ffd95c;
  --on-primary: #0b0b1e;
  --accent: #3fe0ff;
  --accent-hover: #5ce5ff;
  --chip: #1e1e4d;
  --good: #4dffa6;
  --bad: #ff4d6d;
  --coin: #ffc23f;
  --coin-edge: #b37f00;

  /* The maze: wall colours per zone, pellets, pickups */
  --wall-neon: #4d7cff;
  --wall-ice: #5ff2ff;
  --wall-blackout: #8a5cff;
  --wall-haunted: #ff4d8d;
  --pellet: #ffe9c2;
  --power: #fff4e0;
  --item-dash: #ffd23f;
  --item-magnet: #ff5da2;
  --item-freeze: #7fe7ff;
  --item-phase: #b06bff;
  --item-bomb: #ff7a3f;

  /* The designs' glows */
  --glow-primary: 0 0 24px rgb(255 210 63 / 55%);
  --glow-accent: 0 0 18px rgb(63 224 255 / 30%);
  --glow-coin: 0 0 18px rgb(255 194 63 / 30%);

  --text: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --radius-card: 20px;
  --radius-tile: 12px;
  --radius-pill: 999px;

  --gutter: clamp(16px, 5vw, 40px);
  --column: 1120px;
  --focus-ring: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--text);
  overflow-x: clip;
}

main {
  flex: 1;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

/* The designs' titles: Inter Black, tight */

h1,
h2,
h3 {
  font-family: var(--text);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Layout */

.container {
  width: min(100% - 2 * var(--gutter), var(--column));
  margin-inline: auto;
}

/* The small spaced capitals of the designs' labels, in the neon cyan */

.eyebrow {
  font: 800 12px/1.4 var(--text);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Neon text: the designs' glowing titles (MUNCH MAZE, PAUSED, ZONE 2 · BLACKOUT) */

.glow {
  text-shadow: 0 0 0.4em currentColor, 0 0 1em color-mix(in srgb, currentColor 50%, transparent);
}

.glow--primary {
  color: var(--primary);
}

.glow--accent {
  color: var(--accent);
}

/* Cards: the designs' panels, and the glowing ones (daily maze, coins earned) */

.card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card);
}

.card--accent {
  border: 2px solid var(--accent);
  box-shadow: var(--glow-accent);
}

.card--coin {
  border: 2px solid var(--coin);
  box-shadow: var(--glow-coin);
}

/* Buttons: the designs' pills (PLAY, RESUME and the secondary QUIT RUN, HOME) */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--radius-pill);
  font: 900 15px/1.2 var(--text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 80ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.button:active {
  transform: scale(0.97);
}

.button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.button--primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--glow-primary);
}

.button--primary:hover {
  background: var(--primary-hover);
  color: var(--on-primary);
}

.button--secondary {
  background: var(--surface-2);
  color: var(--ink);
}

.button--secondary:hover {
  background: var(--line);
  color: var(--ink);
}

.button--danger {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--bad);
  color: var(--bad);
}

.button--danger:hover {
  background: var(--surface-2);
  color: var(--bad);
}

.button__icon {
  width: 20px;
  height: 20px;
}

/* Chips: the designs' pills of heavy capitals (NEW BEST!, MAX) */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font: 900 12px/1.3 var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip--primary {
  background: var(--primary);
  color: var(--on-primary);
}

.chip--muted {
  background: var(--surface-2);
  color: var(--muted);
}

/* Form fields (contact form, new password) */

.field {
  display: grid;
  gap: 6px;
}

.field__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field__label {
  font: 700 14px/1.4 var(--text);
}

.field__input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-tile);
  font-size: 16px;
}

.field__input:hover {
  border-color: var(--muted);
}

.field__input:focus-visible {
  border-color: var(--accent);
  border-radius: var(--radius-tile);
}

.field__input[aria-invalid] {
  border-color: var(--bad);
}

.field__hint,
.field__counter {
  font-size: 13px;
  color: var(--muted);
}

.field__counter {
  font-variant-numeric: tabular-nums;
}

.field__error {
  font-size: 14px;
  color: var(--bad);
}

.form-status {
  font-size: 15px;
  color: var(--muted);
}

.form-status:empty {
  display: none;
}

.form-status[data-tone='good'] {
  color: var(--good);
}

.form-status[data-tone='bad'] {
  color: var(--bad);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
