/* 26 Cases: the 1994 cabinet.
   Every token is copied from the app, not chosen for the web:
   colors from Assets.xcassets/Arcade (light and dark pairs), type from
   ArcadeTypeScale.swift, keys from ArcadeButtonStyle.swift and
   ArcadeOutlineButtonStyle.swift, cases from ArcadeCase.swift, the floor
   from RetroGrid.swift. If the app changes, change it here too. */

@font-face {
  font-family: "Press Start 2P";
  src: url("assets/fonts/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "VT323";
  src: url("assets/fonts/VT323-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --screen: #F1EEF8;
  --panel: #FFFFFF;
  --dim: #B9B1CC;
  --cyan: #006E99;
  --magenta: #C2006F;
  --yellow: #BA8000;
  --amber: #D98A00;
  --green: #007A40;
  --red: #C8102E;
  --text: #1B1030;
  --secondary-text: #5E527A;
  --ink: #1B1030;
  --glow: 0;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --terminal: "VT323", ui-monospace, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --screen: #07020F;
    --panel: #1A0B33;
    --dim: #3A2A55;
    --cyan: #2DFCFF;
    --magenta: #FF00AA;
    --yellow: #FFE600;
    --amber: #FFB300;
    --green: #00D26A;
    --red: #FF2A4F;
    --text: #F7F7F7;
    --secondary-text: #B0A4C8;
    --glow: 1;
  }
}

:root[data-theme="dark"] {
  --screen: #07020F;
  --panel: #1A0B33;
  --dim: #3A2A55;
  --cyan: #2DFCFF;
  --magenta: #FF00AA;
  --yellow: #FFE600;
  --amber: #FFB300;
  --green: #00D26A;
  --red: #FF2A4F;
  --text: #F7F7F7;
  --secondary-text: #B0A4C8;
  --glow: 1;
}

* { box-sizing: border-box; }

html { background: var(--screen); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--screen);
  color: var(--text);
  font-family: var(--terminal);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* CRT scanlines over everything, as CRTScreen draws them. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 3px);
  z-index: 10;
}

/* RetroGrid: magenta 1pt lines, 30pt columns, 22pt rows, from 62% down. */
.floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 320px;
  pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--magenta) 22%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--magenta) 22%, transparent) 1px, transparent 1px);
  background-size: 30px 22px;
  z-index: 0;
}

.cabinet {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto;
  padding: 56px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---------- ArcadeLogo ---------- */

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-weight: normal;
}

.logo .number {
  font-family: var(--pixel);
  font-size: 60px;
  line-height: 1;
  color: var(--yellow);
  text-shadow:
    5px 5px 0 var(--magenta),
    0 0 calc(12px * var(--glow)) var(--amber);
}

.logo .word {
  font-family: var(--pixel);
  font-size: 26px;
  line-height: 1;
  color: var(--cyan);
  text-shadow:
    3px 3px 0 var(--magenta),
    0 0 calc(8px * var(--glow)) var(--cyan);
}

/* ---------- Text roles from ArcadeTypeScale ---------- */

.body {
  font-family: var(--terminal);
  font-size: 26px;
  line-height: 31px;
  letter-spacing: 0.6px;
  margin: 0;
  text-shadow: 1px 0 0 currentColor;
}

.note {
  font-family: var(--terminal);
  font-size: 24px;
  line-height: 29px;
  letter-spacing: 0.5px;
  color: var(--secondary-text);
  margin: 0;
  text-shadow: 0.8px 0 0 currentColor;
}

.label {
  font-family: var(--pixel);
  font-size: 11px;
  line-height: 19px;
  margin: 0;
}

.title {
  font-family: var(--pixel);
  font-size: 13px;
  line-height: 21px;
  margin: 0;
}

.heading {
  font-family: var(--pixel);
  font-size: 15px;
  line-height: 25px;
  margin: 0;
  font-weight: normal;
}

.center { text-align: center; }
.cyan { color: var(--cyan); }
.green { color: var(--green); }
.yellow { color: var(--yellow); }
.magenta { color: var(--magenta); }

/* ---------- The daily card ---------- */

.card {
  background: var(--panel);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.card hr {
  border: 0;
  height: 2px;
  background: var(--dim);
  margin: 2px 0;
}

/* ---------- ArcadeCase: the board, six columns ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px 7px;
}

.case {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--text);
  background: var(--panel);
  border: 3px solid var(--cyan);
  box-shadow: 3px 3px 0 var(--magenta);
}

.case.mine {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--text);
}

.case.open {
  font-size: 9px;
  background: var(--screen);
  border: 2px solid var(--dim);
  box-shadow: none;
  padding: 0 3px;
  white-space: nowrap;
}

.case.open.big { color: var(--red); }

/* ---------- Keys ---------- */

/* ArcadeButtonStyle: fill, 4pt rim, bevel, hard black shadow. */
.key {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 10px;
  font-family: var(--pixel);
  font-size: 15px;
  line-height: 23px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--yellow);
  border: 4px solid var(--text);
  box-shadow: 5px 5px 0 #000;
}

.key::before,
.key::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 4px;
}

.key::before { top: 4px; background: rgba(255, 255, 255, 0.35); }
.key::after { bottom: 4px; background: rgba(0, 0, 0, 0.3); }

.key:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 #000; }

/* ArcadeOutlineButtonStyle: panel fill, 3pt neon rim, black shadow. */
.quiet-key {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 12px;
  font-family: var(--pixel);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  border: 3px solid var(--key-color, var(--magenta));
  box-shadow: 4px 4px 0 #000;
}

.quiet-key::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 3px;
  background: rgba(0, 0, 0, 0.18);
}

.quiet-key:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #000;
  background: var(--key-color, var(--magenta));
  color: var(--screen);
}

.keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* ---------- How it plays ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.steps li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
}

.steps .count {
  font-family: var(--pixel);
  font-size: 15px;
  line-height: 31px;
  color: var(--magenta);
}

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

.foot {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 8px;
}

.foot a { color: inherit; }

/* ---------- Reading pages (privacy, terms, support) ---------- */

.reading {
  background: var(--panel);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reading h2 {
  font-family: var(--pixel);
  font-size: 13px;
  line-height: 21px;
  color: var(--cyan);
  margin: 14px 0 0;
  font-weight: normal;
}

.reading p,
.reading li {
  font-family: var(--terminal);
  font-size: 25px;
  line-height: 31px;
  letter-spacing: 0.6px;
  margin: 0;
  text-shadow: 1px 0 0 currentColor;
}

.reading ul {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reading a { color: var(--cyan); }

.back-logo {
  text-decoration: none;
  align-self: center;
}

.back-logo .number { font-size: 36px; }
.back-logo .word { font-size: 16px; }

@media (max-width: 360px) {
  .logo .number { font-size: 48px; }
  .body { font-size: 23px; line-height: 28px; }
  .keys { grid-template-columns: 1fr; }
}
