:root {
  --bg: #f8faf9;
  --surface: #ffffff;
  --ink: #14201d;
  --muted: #5e6f69;
  --line: #d9e3df;
  --line-strong: #afc3bc;
  --teal: #11766f;
  --teal-dark: #0d5651;
  --signal: #b73532;
  --amber: #9b6a14;
  --shadow: 0 18px 50px rgba(20, 32, 29, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
}

button,
select {
  font: inherit;
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.brand {
  color: var(--ink);
  font-size: 21px;
  font-weight: 760;
  letter-spacing: 0;
  text-decoration: none;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a,
.cart-link {
  text-decoration: none;
}

.top-nav a:hover,
.cart-link:hover {
  color: var(--teal-dark);
}

.top-nav a[aria-current="page"],
.cart-link[aria-current="page"] {
  color: var(--teal-dark);
  font-weight: 740;
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
}

.cart-link span {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.route-view[hidden] {
  display: none !important;
}

.checkout-return {
  margin: 24px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.checkout-return h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.checkout-return p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.checkout-return p.return-order-status {
  color: var(--ink);
  font-weight: 700;
}

.checkout-return a {
  color: var(--teal);
  font-weight: 700;
}

.checkout-return span {
  display: inline-block;
  margin-left: 8px;
}

.checkout-return-success {
  border-color: #7bb78b;
  background: #f3fbf4;
}

.checkout-return-cancelled {
  border-color: #d3a36d;
  background: #fff8ed;
}

.intro {
  padding: 56px 0 32px;
}

.intro-copy h1 {
  max-width: 720px;
  margin: 0 0 14px;
  font-size: clamp(44px, 7vw, 86px);
  line-height: 0.96;
  letter-spacing: 0;
}

.intro-copy p {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.home-actions,
.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 7px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 720;
  text-decoration: none;
}

.primary-link {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
}

.secondary-link {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--teal-dark);
}

.primary-link.compact,
.secondary-link.compact {
  min-height: 36px;
  padding: 0 11px;
  font-size: 13px;
}

.checkout-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.checkout-panel h2,
.section-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.cart-lines {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.cart-line strong {
  display: block;
  font-size: 14px;
}

.cart-line span {
  color: var(--muted);
  font-size: 12px;
}

.cart-line em {
  display: block;
  margin-top: 2px;
  color: var(--amber);
  font-size: 12px;
  font-style: normal;
}

.cart-line-unavailable {
  background: #fffaf1;
}

.cart-line button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.cart-empty,
.checkout-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.shipping-country {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}

.shipping-country select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.shipping-country select:disabled {
  color: var(--muted);
  background: #f3f6f5;
}

.store-notes {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.store-notes:empty {
  display: none;
}

.store-notes p {
  margin: 0;
}

.primary-action,
.product-action,
.admin-toolbar button,
.bundle-button,
.status-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--teal);
  color: #fff;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
}

.primary-action {
  width: 100%;
}

.primary-action:disabled,
.product-action:disabled,
.bundle-button:disabled,
.status-button:disabled {
  background: #dbe4e1;
  color: #7d8b86;
  cursor: not-allowed;
}

.catalog-section,
.cart-section,
.games-section,
.orders-section {
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.cart-section .checkout-panel {
  max-width: 720px;
  margin: 0 auto;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.section-heading p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.product-list {
  display: grid;
  gap: 12px;
}

.game-page-head {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.back-link {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
}

.catalog-mode,
.product-message {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.product-message {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #9bc7b0;
  border-radius: 7px;
  background: #f1fbf5;
  color: var(--ink);
}

.product-message a {
  color: var(--teal-dark);
  font-weight: 720;
}

.product-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.deck-mark {
  width: 92px;
  aspect-ratio: 63 / 88;
  border: 1px solid var(--line-strong);
  border-top: 7px solid var(--teal);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(17, 118, 111, 0.16), transparent 45%),
    #fefefe;
  display: grid;
  place-items: center;
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 18px;
}

.product-row[data-format="4x6"] .deck-mark {
  aspect-ratio: 4 / 6;
  border-top-color: var(--signal);
  color: var(--signal);
}

.product-main h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.product-main p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
}

.product-controls {
  min-width: 190px;
  display: grid;
  gap: 10px;
}

.product-price {
  color: var(--ink);
  font-size: 16px;
  font-weight: 760;
  text-align: right;
}

.quantity {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.quantity input {
  width: 72px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--ink);
}

.product-reason {
  min-height: 18px;
  color: var(--amber);
  font-size: 12px;
}

.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.game-block {
  display: grid;
  align-content: space-between;
  min-height: 188px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.game-block h3 {
  margin: 0 0 6px;
}

.game-block p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.game-product-summary {
  font-weight: 680;
}

.support-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.support-links a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--teal-dark);
  font-size: 13px;
  text-decoration: none;
}

.admin-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.admin-toolbar button {
  padding: 0 14px;
}

#admin-status {
  color: var(--muted);
  font-size: 13px;
}

.orders-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

.orders-table th,
.orders-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.orders-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.orders-table tr:last-child td {
  border-bottom: 0;
}

.admin-detail,
.admin-address {
  display: grid;
  gap: 2px;
  max-width: 220px;
  color: var(--ink);
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
}

.bundle-button,
.status-button {
  min-height: 34px;
  margin: 2px 0;
  padding: 0 10px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 2px 0;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.status-button-warning {
  background: var(--amber);
}

.status-button-danger {
  background: var(--signal);
}

.fulfillment-note {
  max-width: 240px;
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.fulfillment-events {
  display: grid;
  gap: 4px;
  max-width: 280px;
  margin: 6px 0;
  padding: 0;
  list-style: none;
}

.fulfillment-events li {
  display: grid;
  gap: 1px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfa;
}

.fulfillment-events strong,
.fulfillment-events span,
.fulfillment-events em {
  overflow-wrap: anywhere;
}

.fulfillment-events strong {
  font-size: 12px;
}

.fulfillment-events span {
  color: var(--muted);
  font-size: 11px;
}

.fulfillment-events em {
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
}

@media (max-width: 840px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    grid-column: 1 / -1;
    order: 3;
  }

  .intro {
    grid-template-columns: 1fr;
    padding-top: 36px;
  }

  .product-row {
    grid-template-columns: 68px 1fr;
  }

  .deck-mark {
    width: 68px;
  }

  .product-controls {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .product-price {
    text-align: left;
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 8px;
  }
}
