/* Tanks Anyway: the look is taken from the game itself.
   Colours: Arc.Unity/Assets/Scripts/Palette.cs (exact values).
   Shapes:  Ui/UiKit.cs. Box = Panel at 0.88 alpha with a 2 px Line border; Button = Rest fill,
            Line border, Cyan border and Hover fill under the pointer, Amber text when primary.
   Fonts:   the game's own, Chakra Petch SemiBold (display) and IBM Plex Mono Medium (body). */

@font-face {
  font-family: "Chakra Petch";
  src: url("/fonts/ChakraPetch-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette.cs */
  --ink: #060c17;
  --panel: #0c1728;
  --line: #2b5b82;
  --text: #dbe9f4;
  --dim: #8ea6bb;
  --cyan: #7fe3ff;
  --amber: #ffb547;
  --hot: #ff7828;
  --ice: #e8faff;
  --good: #6ee7a8;
  --bad: #ff7b7b;
  --ash: #4e647a;

  /* Palette.Team(0..7), the eight seat colours */
  --team-1: #ffb547;
  --team-2: #ff6b8e;
  --team-3: #a58bff;
  --team-4: #6ee7a8;
  --team-5: #d9f04e;
  --team-6: #5fcfff;
  --team-7: #f06be0;
  --team-8: #ecf4fa;

  /* UiKit.cs */
  --box: rgba(12, 23, 40, 0.88);      /* Box: Panel at 0.88 */
  --rest: #12243b;                    /* Button Rest (0.07, 0.14, 0.23) */
  --hover: #244c6b;                   /* Button Hover (0.14, 0.30, 0.42) */
  --selected: #29577a;                /* Choice, selected (0.16, 0.34, 0.48) */
  --field: rgba(5, 13, 26, 0.95);     /* FieldFill (0.02, 0.05, 0.10, 0.95) */
  --dim-veil: rgba(5, 10, 20, 0.55);  /* Ui.Dim(0.55), as on the title screen */
  --border: 2px;

  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gutter: 16px;

  color-scheme: dark;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* The game's scanlines (V in the game), kept faint so the words stay easy to read. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.16) 0,
    rgba(0, 0, 0, 0.16) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.55;
}

@media (prefers-contrast: more) {
  body::after { display: none; }
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: var(--ice); }

:focus-visible { outline: var(--border) solid var(--amber); outline-offset: 3px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--rest);
  border: var(--border) solid var(--cyan);
  color: var(--amber);
  font-family: var(--display);
  text-decoration: none;
}
.skip:focus { left: 8px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.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;
}

/* ---------- Type ---------- */

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

/* Box headings in the game: amber, upper case. */
.box-title {
  color: var(--amber);
  text-transform: uppercase;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.box-hint {
  color: var(--cyan);
  margin: 0 0 18px;
}

.small { font-size: 0.875rem; }
.dim { color: var(--dim); }
.cyan { color: var(--cyan); }
.amber { color: var(--amber); }

p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

/* ---------- Title screen ---------- */

.title-screen {
  position: relative;
  isolation: isolate;
  min-height: min(100vh, 860px);
  display: flex;
  align-items: center;
  padding: 72px 0 56px;
  overflow: hidden;
  border-bottom: var(--border) solid var(--line);
  background-color: var(--ink);
}

/* The map behind the menu, as on the game's title screen: a real screenshot (Bit Nippy),
   softened so its HUD reads as shapes, not words. */
.title-screen::before {
  content: "";
  position: absolute;
  inset: -16px;
  z-index: -2;
  background: url("/img/bit-nippy.jpg") center 55% / cover no-repeat;
  filter: blur(4px) brightness(0.6);
}

/* Darker behind the words, as Ui.Dim(0.55) does on the title screen. */
.title-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(var(--dim-veil), var(--dim-veil)),
    radial-gradient(ellipse at 50% 38%, rgba(6, 12, 23, 0.72) 0%, rgba(6, 12, 23, 0.35) 55%, rgba(6, 12, 23, 0.15) 100%),
    linear-gradient(to bottom, rgba(6, 12, 23, 0) 70%, var(--ink) 100%);
}

.title-in { text-align: center; }

.game-title {
  color: var(--amber);
  font-size: clamp(2.9rem, 11vw, 7rem);
  letter-spacing: 0.01em;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.85);
  overflow-wrap: anywhere;
}

.tagline {
  color: var(--cyan);
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  margin: 10px 0 0;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.85);
}

.studio-line {
  color: var(--dim);
  font-size: 0.9rem;
  margin: 6px 0 0;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.85);
}

.title-grid {
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(0, 420px);
  justify-content: center;
  gap: 32px;
  margin-top: 40px;
  text-align: left;
}

/* The main menu: stacked buttons, 480 wide, 58 high, a 68 pitch. */
.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.menu-hint {
  margin: 14px 0 0;
  text-align: center;
  color: var(--dim);
  font-size: 0.875rem;
}

/* ---------- Box and Button (UiKit) ---------- */

.box {
  background: var(--box);
  border: var(--border) solid var(--line);
  padding: 20px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px 16px;
  background: var(--rest);
  border: var(--border) solid var(--line);
  color: var(--text);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  text-align: center;
  text-decoration: none;
  transition: background-color 80ms linear, border-color 80ms linear;
}

.btn:hover,
.btn:focus-visible {
  background: var(--hover);
  border-color: var(--cyan);
  color: var(--text);
}

.btn.primary,
.btn.primary:hover { color: var(--amber); }

/* The rank panel beside the menu, reused as the status note. */
.status .tag {
  display: inline-block;
  font-family: var(--display);
  color: var(--ink);
  background: var(--amber);
  padding: 2px 10px;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.status .box-title { font-size: 1.2rem; }

.status ul {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.status li {
  padding: 6px 0;
  border-top: 1px solid rgba(43, 91, 130, 0.6);
}

.status li span { color: var(--dim); }

/* ---------- Sections ---------- */

main { padding: 40px 0 24px; }

.section { margin: 0 0 32px; scroll-margin-top: 16px; }

.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
}

.facts li {
  padding-left: 18px;
  position: relative;
}

.facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  background: var(--cyan);
}

.facts strong { color: var(--ice); font-weight: 500; }

/* A choice row, like the game's Classic / Fast selector. */
.mode-name {
  display: inline-block;
  font-family: var(--display);
  color: var(--amber);
  background: var(--selected);
  border: var(--border) solid var(--cyan);
  padding: 2px 14px;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

/* ---------- Pictures ---------- */

.shot {
  margin: 0;
  background: var(--box);
  border: var(--border) solid var(--line);
}

.shot img { width: 100%; }

.shot figcaption {
  padding: 10px 14px 12px;
  border-top: var(--border) solid var(--line);
  font-size: 0.875rem;
  color: var(--dim);
}

.shot figcaption b {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  color: var(--amber);
  text-transform: uppercase;
  font-size: 0.95rem;
}

.gallery {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.gallery .wide { grid-column: 1 / -1; }

.shots-note { margin: 14px 0 0; }

/* ---------- The Gift Shop and other lists ---------- */

.shop {
  list-style: none;
  counter-reset: item;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.shop li {
  counter-increment: item;
  padding: 10px 0 10px 34px;
  position: relative;
  border-top: 1px solid rgba(43, 91, 130, 0.6);
}

.shop li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 10px;
  font-family: var(--display);
  color: var(--dim);
}

.shop li.extra::before { content: "+"; color: var(--good); }

.shop .name {
  display: block;
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--ice);
}

.shop .kind {
  font-size: 0.8rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shop .blurb { display: block; color: var(--dim); font-size: 0.9rem; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th,
.table td {
  text-align: left;
  vertical-align: top;
  padding: 9px 12px 9px 0;
  border-top: 1px solid rgba(43, 91, 130, 0.6);
}

.table th {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ice);
  white-space: nowrap;
}

.table td { color: var(--dim); }

.table caption {
  text-align: left;
  color: var(--dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 6px;
}

/* Seat list, with the eight seat colours as in the match HUD. */
.seats {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.seats li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px solid rgba(43, 91, 130, 0.6);
}

.seats .swatch {
  flex: 0 0 auto;
  width: 6px;
  height: 14px;
  align-self: center;
}

.seats .who { color: var(--text); }
.seats .how { color: var(--dim); font-size: 0.85rem; margin-left: auto; text-align: right; }

.s1 { background: var(--team-1); }
.s2 { background: var(--team-2); }
.s3 { background: var(--team-3); }
.s4 { background: var(--team-4); }
.s5 { background: var(--team-5); }
.s6 { background: var(--team-6); }
.s7 { background: var(--team-7); }
.s8 { background: var(--team-8); }

/* Platforms */
.platforms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.platforms li {
  background: var(--field);
  border: var(--border) solid var(--line);
  padding: 14px 16px;
}

.platforms .pname {
  display: block;
  font-family: var(--display);
  color: var(--ice);
  font-size: 1.15rem;
}

.platforms .pstate {
  display: block;
  font-size: 0.875rem;
  color: var(--cyan);
}

.platforms .later .pstate { color: var(--dim); }

.notice {
  border-left: 4px solid var(--amber);
  padding: 4px 0 4px 14px;
  margin: 18px 0 0;
}

/* Studio */
.hallmarks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0 0 18px;
}

.hallmarks figure {
  margin: 0;
  border: var(--border) solid var(--line);
  background: #000;
}

.hallmarks figcaption {
  padding: 8px 12px;
  border-top: var(--border) solid var(--line);
  font-family: var(--display);
  color: var(--text);
  background: var(--box);
}

/* ---------- Footer ---------- */

.footer {
  border-top: var(--border) solid var(--line);
  background: var(--panel);
  padding: 22px 0 28px;
  color: var(--dim);
  font-size: 0.875rem;
}

.footer p { margin: 0 0 6px; }
.footer a { color: var(--cyan); }

/* ---------- Not found ---------- */

.lost {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 40px 0;
}

.lost .box { max-width: 560px; margin: 0 auto; text-align: center; }
.lost .btn { margin-top: 18px; }

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  .title-grid { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin-left: auto; margin-right: auto; }
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .two,
  .facts,
  .gallery,
  .shop,
  .seats,
  .hallmarks { grid-template-columns: minmax(0, 1fr); }
  .title-screen { min-height: 0; padding: 48px 0 40px; }
  .box { padding: 16px; }
  .btn { min-height: 48px; font-size: 1.05rem; }
  .table th { white-space: normal; }
}

@media (max-width: 460px) {
  .platforms { grid-template-columns: minmax(0, 1fr); }
  .table, .table tbody, .table tr, .table th, .table td { display: block; }
  .table tr { border-top: 1px solid rgba(43, 91, 130, 0.6); padding: 8px 0; }
  .table th, .table td { border: 0; padding: 0; }
}
