/* Page rules for status, downloads, guides, game pages, legal and the dead-end pages.
   Colour, radius and motion all come from site.css, so this file adds no new tones. */

.back-link { margin: 0 0 1.5rem; }

/* ---- Page header: the small red label, the heading, one line under it ---- */

.page-head { margin: 0 0 32px; }
.page-head h1 { margin: 0; }
.page-lead { margin: 14px 0 0; max-width: 62ch; color: var(--muted); font-size: 1.125rem; line-height: 1.5; }
.page-sub { margin: 10px 0 0; }
/* The way back up, above the header. */
.page-back { margin: 0 0 18px; }
.page-back a { gap: 10px; color: var(--muted); font-weight: 500; text-decoration: none; transition: color 140ms; }
.page-back a::before { content: ""; width: 7px; height: 7px; margin-left: 3px; border-left: 2px solid var(--red-text); border-bottom: 2px solid var(--red-text); transform: rotate(45deg); transition: transform 160ms var(--ease); }
.page-back a:hover { color: var(--text); }
.page-back a:hover::before { transform: translateX(-3px) rotate(45deg); }
/* Reading pages carry a smaller heading than the shelf pages, so a long title does not fill the screen. */
.page-narrow .page-head h1 { font-size: clamp(2.25rem, 1.85rem + 1.7vw, 3.25rem); }

/* ---- Shared row parts ---- */

.list-row { position: relative; }
.row-main { min-width: 0; }
.row-title {
  margin: 0;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  overflow-wrap: anywhere;
}
.row-text { margin: 0.25rem 0 0; max-width: 60ch; overflow-wrap: anywhere; }
.row-link { color: inherit; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
/* Only a row with a link reacts, and only with colour, so nothing promises a click that does nothing. */
.list-row:has(.row-link):hover .row-link { text-decoration-color: currentColor; }
/* The whole row is the target while the name stays the single link. */
.row-link::after { content: ""; position: absolute; inset: 0; }
/* Two spaces: the first one after the escape is its terminator and never renders. */
.row-meta-item + .row-meta-item::before { content: " \00B7  "; }
time { font-variant-numeric: tabular-nums; }
.list-row.guide-row { display: block; }

/* A list held in one panel. Each row draws its top line one pixel above itself, and the panel clips the first
   one away, so the list stays clean whichever rows a search hides. */
.panel-rows { list-style: none; margin: 0; padding: 0 24px; overflow: hidden; overflow: clip; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel-rows > li { position: relative; margin-top: -1px; padding: 20px 0; border-top: 1px solid var(--line); }
.panel-rows > li[hidden] { display: none; }
.panel-rows .row-title { font-size: 1.125rem; }
/* The secondary links sit above the row's own link, each a full tap target. */
.row-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin: -6px 0 -12px; }
.row-links a { position: relative; z-index: 1; display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; text-decoration-color: transparent; transition: color 140ms; }
.row-links a:hover { color: var(--text); text-decoration-color: currentColor; }
.row-links + .row-text { margin-top: 12px; }

/* ---- Status list ---- */

.status-summary { color: var(--text); }
.status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10.5rem auto;
  gap: 4px 24px;
  align-items: center;
}
.status-row:has(.row-link) { transition: background-color 160ms; }
.status-row-state { display: flex; }
.status-row-state .badge-status, .status-event .badge-status { min-height: 34px; padding: 0 14px 0 11px; border: 1px solid var(--line); border-radius: 17px; background: var(--bg); font-weight: 600; }
.status-row-time { margin: 0; min-width: 15rem; max-width: none; text-align: right; font-size: 1rem; white-space: nowrap; }

/* ---- Status detail ---- */

.status-current { margin: 0 0 40px; }
.status-current .badge-large { font-size: 1.25rem; }
.status-current .badge-large .status-shape { width: 22px; height: 22px; }
.status-note { margin: 14px 0 0; max-width: 60ch; font-size: 1.125rem; overflow-wrap: anywhere; }
.status-current .muted { margin: 10px 0 0; }
.status-history-heading { margin: 0 0 16px; font-size: 1.75rem; }
.status-history { margin-bottom: 16px; }
.status-event {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 6px 24px;
  align-items: center;
}
.status-event .row-text { margin-top: 10px; }
.status-product-link { margin: 20px 0 0; }

/* ---- Guides: cards ---- */

.guide-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 20px; }
.guide-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: transform 220ms var(--ease), border-color 220ms, box-shadow 220ms; }
.guide-card[hidden] { display: none; }
.guide-card:hover { transform: translateY(-3px); border-color: var(--red-line); box-shadow: 0 24px 50px -24px #000; }
.guide-card:has(.row-link:focus-visible) { outline: 2px solid var(--red-text); outline-offset: 2px; }
.guide-card .row-link:focus-visible { outline: none; }
.guide-card-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--red-text); }
.guide-card-icon .icon { width: 22px; height: 22px; }
.guide-card-title { font: 800 1.5rem/1.1 var(--display); letter-spacing: .005em; }
.guide-card .row-link { text-decoration: none; }
.guide-card .row-text { margin-top: 10px; color: var(--muted); }
.guide-card .search-snippet { color: var(--text); }
.guide-card-meta { margin-top: auto; padding-top: 18px; font-size: .9375rem; }

/* ---- One guide ---- */

/* Wide enough that the words inside a step's panel still run to the full reading measure. */
.guide-article { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
.guide-meta { margin: 12px 0 0; }
.guide-body { padding: 28px; }

/* Guide steps. Without guide.js every step shows, one after another. */
.js-steps .guide-step:not(.is-current) { display: none; }
.guide-step { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.guide-step + .guide-step { margin-top: 20px; }
.js-steps .guide-step + .guide-step { margin-top: 0; }
.step-count { display: flex; flex-direction: column; gap: 12px; margin: 0 0 24px; color: var(--muted); font-size: .9375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.step-bar { display: flex; gap: 4px; }
.step-bar > span { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--line); }
.step-bar > .is-done { background: var(--line-strong); }
.step-bar > .is-now { background: var(--red); }
.step-intro { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); color: var(--muted); }
.step-title { margin: 0 0 16px; font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem); outline: none; overflow-wrap: anywhere; }
.step-nav { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.step-nav .btn, .step-nav .btn-quiet { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; text-decoration: none; }
.step-nav .btn { margin-left: auto; }
@media (max-width: 480px) {
  .step-nav .btn, .step-nav .btn-quiet { flex: 1 1 0; }
  .step-nav .btn { margin-left: 0; }
}
@media print {
  .js-steps .guide-step:not(.is-current) { display: block; }
  .step-nav, .step-bar { display: none; }
}

/* ---- Downloads ---- */

.download-group { margin-top: 36px; }
.download-group[hidden] { display: none; }
.download-group h2 { margin: 0 0 14px; font-size: 1.75rem; }
.download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}
.download-row .row-main { flex: 1 1 20rem; }
.download-go { flex: none; }
.download-go .icon { color: var(--red-text); }
.download-buyers { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.download-buyers .icon { width: 18px; height: 18px; }

/* ---- Game pages ---- */

.game-below { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; margin-top: 56px; }
.game-page .home-section { margin-top: 48px; }
.game-side > .home-section:first-child { margin-top: 0; }
.game-copy-box { padding: clamp(24px, 3vw, 40px); }
/* With the owner's copy on the page, it reads on the left while status and guides stay in view beside it. */
@media (min-width: 1061px) {
  .game-below.has-copy { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: 40px; align-items: start; }
  .has-copy .game-side .home-section-head h2 { font-size: 1.625rem; }
  .has-copy .game-side .home-section-head { margin-bottom: 14px; }
  .has-copy .game-side .status-row { grid-template-columns: minmax(0, 1fr) auto; }
  .has-copy .game-side .status-row-time { grid-column: 1 / -1; min-width: 0; text-align: left; white-space: normal; }
}
.game-page .home-section-head h2 { font-size: clamp(1.625rem, 1.4rem + .8vw, 2rem); }

/* One product in a category: a single wide row across the page, picture on the left, the facts beside it. */
@media (min-width: 721px) {
  .grid-solo { grid-template-columns: minmax(0, 1fr); }
  .grid-solo .card { display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); grid-template-rows: 1fr auto auto 1fr; align-items: center; }
  .grid-solo .card-frame { grid-row: 1 / -1; align-self: stretch; }
  .grid-solo .card-frame img { position: absolute; inset: 0; }
  .grid-solo .card-line { grid-area: 2 / 2; padding: 0 28px; }
  .grid-solo .card-name { font-size: 2.25rem; }
  .grid-solo .card-price { font-size: 1.25rem; }
  .grid-solo .card-sub { grid-area: 3 / 2; margin-top: 0; padding: 12px 28px 0; }
  .grid-solo .card-stock { grid-area: 4 / 2; align-self: start; margin-top: 0; padding: 8px 28px 0; }
}

/* ---- Legal ---- */

.legal-updated { margin: 12px 0 0; }
.legal-lead { font-size: 1.25rem; font-weight: 600; }
/* Each numbered section starts under its own rule, so a long policy can be scanned. */
.legal-page .prose h2 { margin-top: 1.5em; padding-top: 1.1em; border-top: 1px solid var(--line); font-size: 1.625rem; }
.legal-page .prose { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.legal-page .prose h2, .legal-page .prose strong, .legal-page .legal-lead { color: var(--text); }
.legal-also { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---- Dead ends: not found, something broke, a file for buyers ---- */

.dead-end { padding-top: clamp(40px, 8vh, 96px); padding-bottom: clamp(56px, 10vh, 120px); }
.dead-end-panel { position: relative; overflow: hidden; max-width: 860px; margin-inline: auto; padding: clamp(28px, 5vw, 56px); border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(80% 130% at 100% 0%, rgba(208, 12, 56, .18), transparent 62%), var(--surface); }
.dead-end-panel > * { position: relative; }
/* The number behind the words, as faint as the step numbers on the home page. Decoration only. */
.dead-end-404::before { content: "404"; position: absolute; right: clamp(12px, 3vw, 32px); top: clamp(4px, 2vw, 20px); font: 800 clamp(7rem, 4rem + 10vw, 11rem)/1 var(--display); color: rgba(244, 239, 233, .05); pointer-events: none; }
.dead-end-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; }
.dead-end-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0 28px; margin: 24px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); }

/* ---- Small screens ---- */

@media (max-width: 860px) {
  /* Name and state share the first line, and the time drops under them. */
  .status-row { grid-template-columns: minmax(0, 1fr) auto; }
  .status-row > .row-main { display: contents; }
  .status-row .row-title { grid-area: 1 / 1; }
  .status-row-state { grid-area: 1 / 2; }
  .status-row .row-main > :not(.row-title), .status-row-time { grid-column: 1 / -1; }
  .status-row-time { min-width: 0; text-align: left; white-space: normal; }
}
@media (max-width: 359px) {
  /* The two links stay on one line. The product's name is in the row's heading, so the long link may be cut short. */
  .row-links { flex-wrap: nowrap; }
  .row-links a { flex: none; }
  .row-links a:last-child:not(:first-child) { flex: 0 1 auto; min-width: 0; display: block; line-height: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 720px) {
  .page-head { margin-bottom: 24px; }
  .page-lead { font-size: 1.0625rem; }
  .panel-rows { padding: 0 18px; }
  .panel-rows > li { padding: 16px 0; }
  .status-event { grid-template-columns: minmax(0, 1fr); }
  .guide-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .guide-card { padding: 18px; }
  .guide-card:hover { transform: none; }
  .guide-card-icon { margin-bottom: 14px; }
  .guide-step, .guide-body { padding: 20px 18px; }
  .download-go { width: 100%; }
  .dead-end-actions .btn, .dead-end-actions .btn-quiet { flex: 1 1 auto; }
  .dead-end-404::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .guide-card:hover { transform: none; }
  .page-back a:hover::before { transform: rotate(45deg); }
}
