/* Tindahan Tickets, the demo storefront: its own palette (a market-stall terracotta on warm paper), deliberately
   not Upuan's purple, so the picker frame reads as the partner's embed inside someone else's shop. Mobile first:
   every page is readable at 375 px with no sideways scroll. No looping animation anywhere. */
:root {
  --shop-bg: #fbf8f3;
  --shop-panel: #ffffff;
  --shop-ink: #1f1a17;
  --shop-muted: #6b625b;
  --shop-accent: #c2410c;
  --shop-accent-ink: #ffffff;
  --shop-line: #e7dfd5;
  --shop-label-bg: #fff4d6;
  --shop-label-ink: #6b4a00;
  --shop-void: #9f1239;
  --shop-radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --shop-bg: #171311;
    --shop-panel: #211b18;
    --shop-ink: #f4eee8;
    --shop-muted: #b3a89f;
    --shop-accent: #fb923c;
    --shop-accent-ink: #1a0d05;
    --shop-line: #352d28;
    --shop-label-bg: #3a2c0a;
    --shop-label-ink: #ffe4a3;
    --shop-void: #fda4af;
    color-scheme: dark;
  }
}

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

/* `hidden` must win over every display rule below (a `display: grid` form showed while hidden: the walk caught it). */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--shop-bg);
  color: var(--shop-ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: anywhere;
}

a { color: var(--shop-accent); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4rem; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.1rem; }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--shop-line);
  background: var(--shop-panel);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--shop-ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--shop-accent) 0 50%, #f59e0b 50% 100%);
}

.demo-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--shop-muted);
  border: 1px solid var(--shop-line);
  border-radius: 999px;
  padding: 2px 10px;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.foot {
  max-width: 960px;
  margin: 24px auto 0;
  padding: 16px;
  color: var(--shop-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--shop-line);
}

.banner {
  padding: 20px 0 12px;
}

.banner p { color: var(--shop-muted); margin: 0; max-width: 40rem; }

.section-title { margin-top: 12px; }

.meta { color: var(--shop-muted); margin: 0 0 0.25rem; }

.events {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.event-tile, .panel {
  background: var(--shop-panel);
  border: 1px solid var(--shop-line);
  border-radius: var(--shop-radius);
  padding: 16px;
}

.event-tile { display: flex; flex-direction: column; gap: 2px; }
.event-tile .button { margin-top: 10px; align-self: flex-start; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--shop-accent);
  color: var(--shop-accent-ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button:focus-visible, .quiet:focus-visible, input:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

.quiet {
  display: inline-block;
  margin-top: 12px;
  color: var(--shop-muted);
}

.back { display: inline-block; margin-bottom: 8px; }

.notice {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--shop-label-bg);
  color: var(--shop-label-ink);
  font-weight: 600;
}

.empty { color: var(--shop-muted); padding: 24px 0; }

.error { color: var(--shop-void); font-weight: 600; margin: 8px 0 0; }

/* the event page: the picker frame is Upuan's; this is only its slot */
.picker-slot {
  margin: 12px 0;
  border-radius: var(--shop-radius);
  overflow: hidden;
  background: #120d24;
  min-height: 240px;
}

.running-total { font-weight: 600; margin: 8px 0; }

.hold-form { display: grid; gap: 6px; margin-top: 12px; }
.hold-form label { font-weight: 600; margin-top: 6px; }
.hold-form input {
  font: inherit;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--shop-line);
  border-radius: 8px;
  background: var(--shop-bg);
  color: var(--shop-ink);
  width: 100%;
}
.hold-form .button { margin-top: 8px; }
.hint { color: var(--shop-muted); font-size: 0.85rem; margin: 2px 0 0; }

/* the checkout */
.test-label {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 2px dashed var(--shop-label-ink);
  border-radius: 10px;
  background: var(--shop-label-bg);
  color: var(--shop-label-ink);
  font-weight: 800;
  text-align: center;
}

.lines { list-style: none; margin: 12px 0 0; padding: 0; }
.lines li, .total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--shop-line);
}
.total { font-weight: 800; font-size: 1.1rem; border-bottom: 0; margin: 0; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.countdown { color: var(--shop-muted); margin: 4px 0 12px; }
.pay { width: 100%; font-size: 1.05rem; }

/* the ticket: a stub you could hold up at the door */
.ticket {
  position: relative;
  max-width: 440px;
  margin: 8px auto 16px;
  background: var(--shop-panel);
  border: 1px solid var(--shop-line);
  border-radius: 16px;
  overflow: hidden;
}

.ticket-head {
  padding: 18px 18px 14px;
  background: linear-gradient(135deg, var(--shop-accent), #f59e0b);
  color: #fff;
}
.ticket-head .meta { color: rgba(255, 255, 255, 0.92); }

.ticket-kicker {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ticket-seats {
  list-style: none;
  margin: 0;
  padding: 14px 18px;
  font-weight: 700;
  border-bottom: 2px dashed var(--shop-line);
}
.ticket-seats li + li { margin-top: 4px; }

.ticket-stub { display: grid; justify-items: center; gap: 12px; padding: 16px 18px 6px; }

.qr {
  width: min(232px, 100%);
  height: auto;
  image-rendering: pixelated;
  background: #fff;
  padding: 8px;
  border-radius: 8px;
}

.ticket-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0;
  width: 100%;
}
.ticket-facts dt { color: var(--shop-muted); }
.ticket-facts dd { margin: 0; font-weight: 600; text-align: right; }

.paid-by { margin: 8px 18px 18px; color: var(--shop-muted); font-size: 0.9rem; text-align: center; }

.void {
  margin: 0;
  padding: 12px 18px;
  background: var(--shop-void);
  color: #fff;
  font-weight: 800;
  text-align: center;
}
.is-cancelled .ticket-seats, .is-cancelled .ticket-stub { opacity: 0.45; text-decoration: line-through; }

@media (min-width: 720px) {
  h1 { font-size: 2rem; }
  .pay { width: auto; }
  .hold-form { max-width: 28rem; }
}
