/* The Demo Disc — style.css */
:root {
  --bg: #f3e6d3;
  --paper: #fffaf2;
  --ink: #1b1b22;
  --blue: #2340b0;
  --navy: #1a2a6c;
  --red: #d8342b;
  --gold: #e3b23c;
  --green: #4f9e3a;
  --muted: #7d7266;
}

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

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(45deg, rgba(125, 114, 102, 0.08) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, rgba(125, 114, 102, 0.08) 0 1px, transparent 1px 14px);
}

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

h1, h2, h3 {
  margin: 0;
}

a {
  color: var(--blue);
}

.label {
  font-family: system-ui, sans-serif;
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

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

/* ---------- title block ---------- */

.title-block {
  position: relative;
  padding: 44px 0 8px;
  text-align: center;
}

.swoosh {
  position: absolute;
  /* top must keep the rotated ink box below the document top edge;
     see CLOSE_polish.md for the bounding-box computation */
  top: 20px;
  left: 50%;
  transform: translateX(-50%) rotate(-8deg);
  width: min(560px, 120%);
  height: auto;
  z-index: 0;
  opacity: 0.9;
}

.title-small {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}

.title-disc {
  position: relative;
  z-index: 1;
  font-family: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  font-size: clamp(72px, 17vw, 150px);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0;
  padding: 6px 12px;
  text-shadow:
    2px 0 0 var(--ink), -2px 0 0 var(--ink),
    0 2px 0 var(--ink), 0 -2px 0 var(--ink),
    2px 2px 0 var(--ink), -2px -2px 0 var(--ink),
    2px -2px 0 var(--ink), -2px 2px 0 var(--ink);
}

.title-disc::before,
.title-disc::after {
  content: "";
  display: block;
  height: 6px;
  background: var(--red);
  border-radius: 3px;
  margin: 8px auto;
  width: min(420px, 80%);
}

.tagline {
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-style: italic;
  margin: 10px 0 0;
}

/* ---------- fonts ---------- */

@font-face {
  font-family: "Anton";
  src: url("../fonts/Anton-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- layout ---------- */

.wrap {
  width: min(1100px, 100% - 24px);
  margin: 0 auto;
}

header.site {
  padding: 16px 0 20px;
}

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

.hdr-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 2;
}

/* the little spinning disc */
.disc {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background:
    conic-gradient(#e8e8ee 0deg, #b9bcc6 40deg, #f4f4f8 90deg, #a7abb8 150deg,
                   #e8e8ee 210deg, #cfd2da 270deg, #e8e8ee 360deg);
  box-shadow: 3px 3px 0 var(--ink);
  animation: spin 6s linear infinite;
}

.disc::after {
  content: "";
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid var(--ink);
}

.disc::before {
  content: "";
  position: absolute;
  inset: 44%;
  border-radius: 50%;
  background: var(--paper);
  z-index: 1;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- chips ---------- */

.chip {
  display: inline-block;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  white-space: nowrap;
}

.chip .pos { color: var(--green); }
.chip .neg { color: var(--red); }

.price {
  background: var(--gold);
  color: var(--ink);
  font-family: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 14px;
  box-shadow: 3px 3px 0 var(--ink);
}

.price.big {
  font-size: 28px;
  padding: 6px 20px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-family: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 12px 22px;
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease, background 80ms ease;
}

.btn:hover {
  background: var(--navy);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- shelves ---------- */

.shelf {
  margin: 26px 0 10px;
}

.shelf h2 {
  font-family: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  font-size: 28px;
  text-transform: uppercase;
  color: var(--blue);
  letter-spacing: 0.04em;
}

.shelf h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 5px;
  background: var(--red);
  border-radius: 2px;
  margin-top: 6px;
}

.shelf-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 14px 4px 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) var(--bg);
}

.shelf-row::-webkit-scrollbar {
  height: 8px;
}

.shelf-row::-webkit-scrollbar-track {
  background: var(--bg);
}

.shelf-row::-webkit-scrollbar-thumb {
  background: var(--ink);
  border-radius: 4px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 140px;
  width: 140px;
  scroll-snap-align: start;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.card::before {
  content: "\25B6";
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--red);
  font-size: 18px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--blue);
  box-shadow: 6px 6px 0 var(--ink);
}

.card:hover::before,
.card:focus-visible::before {
  opacity: 1;
}

.card .cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--bg);
}

.card .card-name {
  display: block;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  margin-top: 8px;
  min-height: 2.5em;
}

.card .card-year {
  display: block;
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  color: var(--muted);
  /* keeps the 8px gap above the price chip when margin-top: auto collapses */
  padding-bottom: 8px;
}

.card .price {
  display: inline-block;
  margin-top: auto;
  align-self: flex-start; /* keep the chip a pill, not stretched across the card */
  font-size: 16px;
  padding: 2px 12px;
}

/* ---------- game page ---------- */

main.page {
  padding-bottom: 48px;
}

.trailer {
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 5px 5px 0 var(--ink);
  overflow: hidden;
  background: var(--ink);
}

.trailer iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.trailer-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  color: var(--paper);
  font-weight: 700;
  font-style: italic;
  font-size: 18px;
  padding: 16px;
  text-align: center;
}

.game-grid {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.game-cover {
  width: min(280px, 100%);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 5px 5px 0 var(--ink);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--bg);
}

.game-meta .label {
  display: block;
  margin-bottom: 2px;
}

.game-meta .value {
  font-weight: 700;
  margin: 0 0 12px;
}

.game-summary {
  margin: 12px 0;
  max-width: 56ch;
}

.game-note {
  border-left: 4px solid var(--red);
  background: var(--paper);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  font-style: italic;
  font-weight: 600;
  margin: 14px 0;
  max-width: 56ch;
}

.game-buy {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* ---------- cart ---------- */

.cart-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.cart-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 12px;
}

.cart-list img {
  width: 48px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 4px;
}

.cart-list .name {
  flex: 1;
  font-weight: 700;
}

.cart-list button {
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}

.cart-list button:hover {
  background: var(--red);
  color: #fff;
}

.cart-totals {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.empty {
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  font-weight: 700;
  font-style: italic;
}

/* ---------- receipt ---------- */

.receipt-wrap {
  display: flex;
  justify-content: center;
  padding-top: 12px;
}

.receipt {
  width: min(360px, 100%);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-bottom: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  padding: 20px 18px 26px;
  box-shadow: 5px 5px 0 var(--ink);
}

.receipt::after {
  content: "";
  display: block;
  height: 10px;
  margin: 0 -20px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-top: none;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 97.5% 0, 95% 100%, 92.5% 0, 90% 100%,
    87.5% 0, 85% 100%, 82.5% 0, 80% 100%, 77.5% 0, 75% 100%, 72.5% 0, 70% 100%,
    67.5% 0, 65% 100%, 62.5% 0, 60% 100%, 57.5% 0, 55% 100%, 52.5% 0, 50% 100%,
    47.5% 0, 45% 100%, 42.5% 0, 40% 100%, 37.5% 0, 35% 100%, 32.5% 0, 30% 100%,
    27.5% 0, 25% 100%, 22.5% 0, 20% 100%, 17.5% 0, 15% 100%, 12.5% 0, 10% 100%,
    7.5% 0, 5% 100%, 2.5% 0, 0 100%);
}

.receipt h1 {
  font-family: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  font-size: 24px;
  text-align: center;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.receipt .sub {
  text-align: center;
  font-style: italic;
  margin: 4px 0 14px;
}

.r-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
}

.r-line .l {
  flex: 1;
}

.r-dash {
  border: none;
  border-top: 2px dashed var(--ink);
  margin: 12px 0;
}

.r-line.total {
  font-weight: 700;
  font-size: 16px;
}

.r-line.owed .r-val {
  color: var(--red);
  font-weight: 700;
}

.receipt .closer {
  margin: 12px 0 0;
  font-style: italic;
  text-align: center;
}

/* ---------- my shelf ---------- */

.my-shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.owned-card {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px;
}

.owned-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 6px;
  filter: saturate(0.45) contrast(0.95);
}

.owned-card .card-name {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-top: 8px;
}

.owned-card .card-year {
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  color: var(--muted);
}

.stamp {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) rotate(-8deg);
  color: var(--red);
  border: 3px double var(--red);
  border-radius: 6px;
  padding: 3px 10px;
  font-family: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255, 250, 242, 0.75);
  white-space: nowrap;
}

/* ---------- focus, motion, wide ---------- */

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .disc {
    animation: none;
  }
  .card,
  .btn,
  .card::before {
    transition: none;
  }
}

@media (min-width: 700px) {
  .hdr-row {
    align-items: center;
  }
  .game-grid {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }
  .wrap {
    width: min(1100px, 100% - 48px);
  }
}
