/* The play host: the Marketplace's palette and type (white ground, Inter, the
 * ADR-0137 blue), kept small. One stylesheet, no script, nothing from any
 * other host. Hallmark · pre-emit critique: P4 H4 E4 S4 R5 V3 */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --paper: #ffffff;
  --paper-2: #f5f7fa;
  --ink: #1f2329;
  --ink-soft: #646a73;
  --line: #e4e8ec;
  --stone-2: #eaeef3;
  --stone-3: #cbd1d8;
  --blue: #357fbe;
  --blue-deep: #2e70aa;
  --blue-deeper: #285f91;
  --blue-air: #ddeaf7;
  --danger-deep: #96281b;
  --danger-soft: #fdecea;
  --sans: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --shell: 1080px;
  --radius-card: 16px;
  --radius-control: 8px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.18s;
  --shadow-card: 0 1px 2px rgb(31 35 41 / 0.04), 0 14px 36px -20px rgb(31 35 41 / 0.16);
}

* { box-sizing: border-box; }
html { color-scheme: light; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
main.shell { padding-top: 40px; padding-bottom: 72px; min-height: 60vh; }

h1, h2 { line-height: 1.12; letter-spacing: -0.018em; margin: 0 0 0.5em; text-wrap: balance; font-style: normal; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; letter-spacing: -0.026em; }
h2 { font-size: 1.25rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--blue-deep); text-underline-offset: 0.15em; }
a:hover { color: var(--blue-deeper); }
:is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--blue-deep);
  outline-offset: 2px;
}

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 8px 14px;
}
.skip:focus { left: 8px; }

/* ---------- Chrome ---------- */
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-row { display: flex; align-items: center; min-height: 64px; }
.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none; font-weight: 650; font-size: 1.0625rem;
  min-height: 44px; white-space: nowrap;
}
.wordmark .mark { flex: none; }
.wordmark-sub { color: var(--ink-soft); font-weight: 500; }
.wordmark-sub::before { content: "·"; margin: 0 8px 0 2px; color: var(--stone-3); }

.foot { border-top: 1px solid var(--line); background: var(--paper-2); padding: 28px 0 36px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 12px; }
.foot-nav a { color: var(--ink); white-space: nowrap; min-height: 24px; display: inline-block; }
.foot-fine { color: var(--ink-soft); font-size: 0.875rem; max-width: 42em; margin: 0; }

/* ---------- Type helpers ---------- */
.eyebrow { font-size: 0.875rem; font-weight: 600; color: var(--blue-deep); margin: 0 0 10px; }
.lede { font-size: 1.125rem; color: var(--ink-soft); max-width: 36em; }
.game-name { overflow-wrap: anywhere; min-width: 0; }
.byline { font-size: 1.0625rem; color: var(--ink-soft); max-width: 40em; overflow-wrap: anywhere; }
.byline strong { color: var(--ink); font-weight: 600; }
.developer { color: var(--ink); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; max-width: 100%;
  background: var(--blue-deep); color: #fff;
  text-decoration: none; font: 600 1rem/1.2 var(--sans);
  padding: 13px 26px; border-radius: var(--radius-pill);
  border: 0; cursor: pointer;
  touch-action: manipulation;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background var(--dur) var(--ease-out);
}
.btn:hover { background: var(--blue-deeper); color: #fff; }
.btn-small { min-height: 44px; padding: 9px 20px; font-size: 0.9375rem; }
.btn-ghost { background: var(--paper); color: var(--blue-deep); box-shadow: inset 0 0 0 1px var(--blue-deep); }
.btn-ghost:hover { background: var(--blue-air); color: var(--blue-deeper); }

/* ---------- The link page ---------- */
.doors {
  display: grid; gap: 20px; margin: 32px 0 24px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 760px) {
  .doors { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}
.door {
  border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 24px; background: var(--paper); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
}
.door-main { border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); }
.door .btn { margin-top: 8px; }
.door-note { font-size: 0.875rem; color: var(--ink-soft); margin: 12px 0 0; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8125rem; font-weight: 500; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 4px 12px 4px 10px; margin: 4px 0 8px;
}
.status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
  border: 1.5px dashed var(--ink-soft);
}
.expiry { color: var(--ink-soft); }
.made-with { margin-top: 28px; color: var(--ink-soft); }

.report { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; max-width: 40rem; }
.report summary { cursor: pointer; color: var(--blue-deep); font-weight: 600; min-height: 44px; display: flex; align-items: center; width: fit-content; }
.report[open] summary { margin-bottom: 8px; }

/* ---------- Forms ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue-deep); flex: none; }
.field-label { display: block; font-weight: 600; margin: 0 0 6px; }
.optional { font-weight: 400; color: var(--ink-soft); }
.field-hint { font-size: 0.875rem; color: var(--ink-soft); margin: 6px 0 16px; }
input[type="password"], input[type="search"], select, textarea {
  width: 100%; max-width: 28rem;
  font: 400 1rem/1.4 var(--sans); color: var(--ink);
  background: var(--paper);
  /* 5.4:1 on the page: a field's edge is how you find it (WCAG 1.4.11, #2558). */
  border: 1px solid var(--ink-soft); border-radius: var(--radius-control);
  padding: 10px 12px; min-height: 44px;
}
textarea { max-width: 40rem; resize: vertical; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger-deep); }
fieldset.invalid { border-left: 3px solid var(--danger-deep); padding-left: 12px; }
.form-error {
  color: var(--danger-deep); background: var(--danger-soft);
  border-radius: var(--radius-control); padding: 8px 12px; font-weight: 500;
}
.password-form { margin: 24px 0; display: grid; gap: 12px; justify-items: start; max-width: 28rem; }

/* ---------- Notices ---------- */
.notice-page { max-width: 44rem; padding: 24px 0 8px; }
.notice {
  background: var(--paper-2); border-radius: var(--radius-card); padding: 16px 20px;
}

/* ---------- The shelf ---------- */
.shelf-head { max-width: 44rem; margin-bottom: 28px; }
.shelf-head .made-with { margin-top: 0; }
.shelf-search {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
  padding: 16px; margin-bottom: 28px;
  background: var(--paper-2); border-radius: var(--radius-card);
}
.shelf-search .field { flex: 1 1 14rem; min-width: 0; }
.shelf-search input, .shelf-search select { max-width: none; }
.shelf-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.card {
  border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 20px; background: var(--paper); box-shadow: var(--shadow-card);
  min-width: 0;
}
.card-name { font-size: 1.125rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.card-name a { color: var(--ink); text-decoration: none; }
.card-name a:hover { color: var(--blue-deep); text-decoration: underline; }
.card-by { color: var(--ink-soft); margin: 0 0 10px; overflow-wrap: anywhere; }
.card-meta { font-variant-numeric: tabular-nums; font-size: 0.875rem; color: var(--ink-soft); margin: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.tag { background: var(--blue-air); color: var(--blue-deeper); border-radius: var(--radius-pill); padding: 2px 10px; font-weight: 600; }
.tag-muted { background: var(--stone-2); color: var(--ink-soft); }
.empty { color: var(--ink-soft); font-size: 1.0625rem; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 32px; }
.pager a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; white-space: nowrap; }

/* ---------- Plain pages ---------- */
.prose { max-width: 44rem; }
.prose h2 { margin-top: 1.75em; }
.prose ul { padding-left: 1.25em; }
.prose li { margin-bottom: 0.5em; }

@media (max-width: 480px) {
  .shell { padding: 0 16px; }
  main.shell { padding-top: 28px; }
  .door { padding: 20px; }
}

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

@media (forced-colors: active) {
  .btn, .door, .card, .status, .tag { border: 1px solid CanvasText; }
  .status::before { border-color: CanvasText; }
}
