/* KJH Games: a sunny shelf of game cartridges. One typeface, navy ink on yellow; each cartridge label wears its game's colours. */
:root {
  --sun: #ffd23f;
  --sun-deep: #f4bf12;
  --ink: #1a1d3a;
  --white: #ffffff;
  --pop: #ff4f7b;
  --soft-ink: #4a4e72;
  --font: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--sun); }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font); font-size: 18px; line-height: 1.5; color: var(--ink);
  background:
    repeating-linear-gradient(135deg, transparent 0 22px, rgba(244, 191, 18, .45) 22px 24px),
    var(--sun);
  padding: 0 max(16px, env(safe-area-inset-right)) 64px max(16px, env(safe-area-inset-left));
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.wordmark {
  margin: 0;
  font-weight: 800; font-stretch: 75%; font-variation-settings: 'opsz' 96;
  font-size: clamp(56px, 12vw, 148px); line-height: .82; letter-spacing: -.035em;
  color: var(--ink);
}

/* ---------- Dashboard ---------- */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto; padding-top: 40px; }
.lock {
  font: 700 16px var(--font); color: var(--ink); background: transparent; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 999px; padding: 6px 16px; margin-bottom: 10px;
}
.lock:hover { background: var(--ink); color: var(--sun); }
main { max-width: 1180px; margin: 0 auto; }
.intro { margin: 14px 0 40px; font-size: 22px; font-weight: 500; max-width: 40ch; }

.shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 320px)); gap: 48px 40px; }
.cart { display: flex; flex-direction: column; gap: 10px; }

/* The cartridge: a navy shell with grip ridges along the top and a coloured label. */
.shell {
  background: var(--ink); border-radius: 18px 18px 10px 10px;
  padding: 0 18px 22px; position: relative;
  box-shadow: 0 10px 0 -2px var(--sun-deep), 0 10px 0 0 var(--ink);
}
.shell::after { /* edge connector notch */
  content: ""; position: absolute; left: 50%; bottom: -10px; width: 46%; height: 10px; transform: translateX(-50%);
  background: repeating-linear-gradient(90deg, #c9a227 0 6px, var(--ink) 6px 9px); border-radius: 0 0 4px 4px;
}
.grip { height: 34px; margin: 0 -2px 14px; background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(255,255,255,.14) 9px 13px); border-radius: 0 0 6px 6px; }
.label {
  background: var(--label); border-radius: 8px; aspect-ratio: 4 / 3; padding: 16px 18px; position: relative; overflow: hidden;
  display: flex; align-items: flex-end;
  background-image:
    radial-gradient(circle at 82% 22%, var(--title) 0 13%, transparent 13.5%),
    repeating-radial-gradient(circle at 82% 22%, transparent 0 22px, rgba(255,255,255,.1) 22px 26px);
}
.label h2 {
  margin: 0; position: relative;
  font-weight: 800; font-stretch: 80%; font-size: 40px; line-height: .9; letter-spacing: -.02em;
  color: var(--title); text-shadow: 3px 3px 0 var(--shadow);
  text-wrap: balance;
}
.blurb { margin: 14px 0 0; max-width: 34ch; }
.facts { margin: 0; font-size: 15px; color: var(--soft-ink); }
.status { display: inline-block; margin-left: 4px; padding: 0 8px; border-radius: 999px; background: var(--ink); color: var(--sun); font-size: 13px; font-weight: 700; }
.play {
  align-self: flex-start; margin-top: 6px;
  font-weight: 800; font-size: 18px; text-decoration: none;
  background: var(--accent); color: var(--white); border: 3px solid var(--ink); border-radius: 12px;
  padding: 8px 18px; box-shadow: 4px 4px 0 var(--ink);
}
.play:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.play:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.unbuilt { margin: 6px 0 0; font-size: 15px; font-weight: 700; }

.cart.empty .shell { background: transparent; border: 3px dashed var(--ink); box-shadow: none; }
.cart.empty .shell::after { display: none; }
.cart.empty .grip { background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(26,29,58,.12) 9px 13px); }
.cart.empty .label { background: rgba(26,29,58,.06); }
.cart.empty .label h2 { color: var(--ink); text-shadow: none; opacity: .55; }
.cart.empty .blurb { color: var(--soft-ink); }

/* ---------- Login ---------- */
.is-login main.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 36px; max-width: 560px; padding-block: 40px; }
.slot { background: var(--ink); color: var(--sun); border-radius: 18px; padding: 20px; box-shadow: 8px 8px 0 var(--sun-deep); }
.slot label { display: block; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.slot-row { display: flex; gap: 10px; }
.slot input {
  flex: 1; min-width: 0; font: 600 20px var(--font); color: var(--ink); background: var(--white);
  border: 0; border-radius: 10px; padding: 10px 14px;
}
.slot input.code { text-transform: uppercase; letter-spacing: .3em; font-size: 28px; font-weight: 800; }
.slot button {
  font: 800 18px var(--font); color: var(--ink); background: var(--sun); cursor: pointer;
  border: 0; border-radius: 10px; padding: 10px 20px;
}
.slot button:hover { background: var(--white); }
.slot :focus-visible { outline-color: var(--pop); }
.error { margin: 12px 0 0; color: #ffb3c6; font-weight: 700; }

@media (max-width: 560px) {
  .top { padding-top: 28px; }
  .shelf { grid-template-columns: 1fr; }
  .slot-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .play:hover, .play:active { transform: none; }
}
