:root {
  --navy: #0e1f3d;
  --navy-2: #16284a;
  --navy-deep: #081532;
  --ink: #0b1426;
  --paper: #f7f7f4;
  --paper-2: #efefe9;
  --silver: #c8ccd4;
  --silver-2: #e3e6ec;
  --line: #d9d9d2;
  --muted: #6b7384;
  --gold: oklch(0.78 0.13 85);
  --gold-deep: oklch(0.62 0.14 75);
  --field: oklch(0.55 0.12 145);
  --warn: oklch(0.55 0.16 30);
  --shadow-sm: 0 1px 2px rgba(8,21,50,0.06), 0 1px 0 rgba(255,255,255,0.6) inset;
  --shadow-md: 0 6px 18px rgba(8,21,50,0.08), 0 1px 0 rgba(255,255,255,0.5) inset;
  --shadow-lg: 0 20px 50px rgba(8,21,50,0.18);
  --radius: 14px;
  --radius-sm: 8px;
  --display: "Barlow Condensed", "Oswald", Impact, sans-serif;
  --body: "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ===== Stage ===== */
.stage {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(14,31,61,0.12), transparent 60%),
    linear-gradient(180deg, #e9eaee 0%, #d6d9df 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
}
.phone {
  width: 100%;
  max-width: 420px;
  min-height: 860px;
  background: var(--paper);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.04);
  position: relative;
}
@media (max-width: 520px) {
  .stage { padding: 0; background: var(--paper); align-items: flex-start; }
  .phone { border-radius: 0; min-height: 100vh; max-width: none; box-shadow: none; }
}

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--navy);
  color: #fff;
  padding: 14px 18px 12px;
  border-bottom: 3px solid var(--gold);
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 2px var(--gold);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--silver);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.brand-text .title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.game-pill {
  font-family: var(--mono);
  font-size: 10.5px;
  background: rgba(255,255,255,0.08);
  color: var(--silver-2);
  border: 1px solid rgba(255,255,255,0.16);
  padding: 6px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.game-pill .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--field);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  height: 168px;
  background: var(--navy-deep);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-img {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255,225,150,0.22), transparent 50%),
    radial-gradient(ellipse at 85% 10%, rgba(255,225,150,0.18), transparent 50%),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.02) 0 24px,
      rgba(255,255,255,0.06) 24px 48px
    ),
    linear-gradient(180deg, #0a1830 0%, #0e1f3d 60%, #1a3060 100%);
}
.hero-img::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 38%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
.hero-tag {
  position: absolute;
  top: 14px; left: 16px;
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hero-title {
  position: absolute;
  left: 16px; bottom: 16px; right: 16px;
  color: #fff;
}
.hero-title h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 38px;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero-title h1 .accent { color: var(--gold); }
.hero-title p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--silver-2);
  max-width: 28ch;
}

/* ===== Category chips ===== */
.chips {
  position: sticky;
  top: 67px;
  z-index: 20;
  background: var(--paper);
  padding: 12px 16px 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--silver); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip .count {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}
.chip.active .count { color: var(--silver); }

/* ===== Menu ===== */
.menu { padding: 16px 16px 160px; }
.menu-loading {
  text-align: center;
  padding: 40px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.cat-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 20px 2px 12px;
}
.cat-header:first-child { margin-top: 4px; }
.cat-header h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
}
.cat-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.item.in-cart {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(14,31,61,0.06), var(--shadow-md);
}
.item-img {
  width: 84px; height: 84px;
  border-radius: 10px;
  background: var(--paper-2);
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
}
.ph-stripes {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(14,31,61,0.04) 0 6px,
    rgba(14,31,61,0.08) 6px 12px
  );
}
.ph-glyph { position: relative; font-size: 28px; opacity: 0.55; }
.item-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 10px;
}
.item-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.item-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
}
.item-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.35;
  margin: 2px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.item-price {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.item-flag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: 2px;
}
.flag-low { color: var(--warn); background: oklch(0.96 0.04 30); }
.flag-hot { color: var(--gold-deep); background: oklch(0.96 0.06 85); }
.flag-out { color: var(--muted); background: var(--paper-2); }

/* qty stepper */
.stepper {
  display: inline-flex;
  align-items: center;
  background: var(--paper-2);
  border-radius: 999px;
  padding: 2px;
  height: 36px;
}
.stepper button {
  width: 32px; height: 32px;
  border: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  font-family: var(--body);
}
.stepper button:hover:not(:disabled) { background: #fff; }
.stepper button:disabled { color: var(--silver); cursor: not-allowed; }
.stepper .qty {
  min-width: 22px;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}
.add-btn {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.add-btn:hover { background: var(--navy-2); }
.add-btn:disabled { background: var(--silver-2); color: var(--muted); cursor: not-allowed; }

.item.sold-out .item-img { opacity: 0.5; }
.item.sold-out .item-name { color: var(--muted); }

/* ===== Sticky cart bar (fixed to viewport, centered to phone) ===== */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: 100%;
  max-width: 420px;
  z-index: 25;
  background: var(--navy);
  color: #fff;
  padding: 12px 14px;
  border-top: 3px solid var(--gold);
  transition: transform 0.25s ease;
  box-shadow: 0 -10px 30px rgba(8,21,50,0.18);
}
.cart-bar.hidden {
  transform: translateX(-50%) translateY(110%);
}
@media (max-width: 520px) {
  .cart-bar { left: 0; max-width: none; transform: translateY(0); }
  .cart-bar.hidden { transform: translateY(110%); }
}
.cart-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cart-summary { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cart-badge {
  position: relative;
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cart-badge svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 1.8; }
.cart-badge .ct {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 20px; height: 20px;
  background: var(--gold);
  color: var(--navy-deep);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--navy);
}
.cart-meta { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.cart-meta .lbl {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--silver);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.cart-meta .val {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 32ch;
}
.review-btn {
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy-deep);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.review-btn:hover { background: oklch(0.82 0.14 85); }
.review-btn .arrow { font-size: 18px; line-height: 1; }

/* ===== Sheet ===== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8,21,50,0.45);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  z-index: 50;
  background: var(--paper);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  transform: translate(-50%, 100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -20px 60px rgba(8,21,50,0.3);
}
.sheet.open { transform: translate(-50%, 0); }
@media (max-width: 520px) {
  .sheet { max-width: none; left: 0; transform: translateY(100%); }
  .sheet.open { transform: translateY(0); }
}
.sheet-handle {
  width: 40px; height: 4px;
  background: var(--silver);
  border-radius: 4px;
  margin: 10px auto 0;
  flex-shrink: 0;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sheet-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
}
.sheet-close {
  width: 32px; height: 32px;
  border: 0;
  background: var(--paper-2);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: var(--ink);
}
.sheet-body { flex: 1; overflow-y: auto; padding: 14px 18px 16px; }

/* ===== Cart rows (in sheet) ===== */
.cart-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.cart-row:last-of-type { border-bottom: 0; }
.mini-img {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  font-size: 20px;
  position: relative;
  overflow: hidden;
}
.mini-img::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(14,31,61,0.04) 0 4px, rgba(14,31,61,0.07) 4px 8px);
}
.mini-img span { position: relative; }
.ci-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.ci-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.ci-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ci-total { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--navy); }
.mini-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--paper-2);
  border-radius: 999px;
  height: 28px;
  padding: 2px;
}
.mini-stepper button {
  width: 24px; height: 24px;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--navy);
  cursor: pointer;
  border-radius: 999px;
  padding: 0;
}
.mini-stepper button:hover { background: #fff; }
.mini-stepper .q {
  min-width: 18px;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
}

.empty-cart { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-cart .glyph { font-size: 38px; opacity: 0.4; margin-bottom: 10px; }
.empty-cart .et {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.empty-cart .ed { font-size: 13px; margin-top: 4px; }

/* ===== Totals ===== */
.totals {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 14px;
}
.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
}
.totals-row.grand {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.totals-row.grand .label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.totals-row.grand .val {
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  color: var(--navy);
}
.donation-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: oklch(0.96 0.06 85);
  border: 1px dashed var(--gold-deep);
  border-radius: var(--radius-sm);
  margin-top: 10px;
}
.donation-line .dl-text { font-size: 12px; color: var(--ink); line-height: 1.3; }
.donation-line .dl-text strong {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12.5px;
}
.toggle {
  position: relative;
  width: 38px; height: 22px;
  background: var(--silver);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--field); }
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on::after { transform: translateX(16px); }

/* ===== Checkout form ===== */
.form-section { margin-top: 18px; }
.form-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.field label .req { color: var(--warn); margin-left: 2px; }
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--body);
  font-size: 15px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: 0;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(14,31,61,0.1);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.3; }

.notif-group { display: flex; gap: 8px; margin-bottom: 12px; }
.notif-chip {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.notif-chip.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.notif-chip .nc-icon { font-size: 16px; display: block; margin-bottom: 2px; }
.notif-chip .nc-label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pay-btn {
  width: 100%;
  margin-top: 16px;
  height: 56px;
  border: 0;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: background 0.15s;
  box-shadow: 0 4px 12px rgba(14,31,61,0.2);
}
.pay-btn:hover:not(:disabled) { background: var(--navy-2); }
.pay-btn:disabled { background: var(--silver-2); color: var(--muted); cursor: not-allowed; box-shadow: none; }
.pay-btn .pay-total { font-size: 19px; color: var(--gold); }
.pay-btn:disabled .pay-total { color: var(--muted); }
.pay-trust {
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 10px;
}
.pay-trust .lock { margin-right: 4px; }

/* ===== Ribbon ===== */
.ribbon {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px;
  background: var(--navy);
  color: var(--gold);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
