/* Layout: one phone-width column (max 520px) that reads like an app:
   deep-ocean hero stage → event cards rail → steps → form → sticky dock. Ticket view replaces it after submit.
   Single light look on purpose: the official TGGC 2026 palette (navy · sea blue · teal · mint · green · mist · white). */
:root {
  /* official palette */
  --navy: #075f98;
  --sea: #0a98c7;
  --teal: #15a8a0;
  --mint: #2cc394;
  --green: #148e64;
  --lteal: #5ba1a5;
  --mist: #a7d5db;
  --white: #fcfdfd;
  /* derived neutrals (biased toward the navy) */
  --ink: #0a2b42;
  --deep: #04324f;
  --muted: #4d7083;
  --dim: #86a4b1;
  --line: #dcecef;
  --line-strong: #bfdce1;
  --surface: #ffffff;
  --tint: #f0f8f9;
  --danger: #d93d4a;

  --f-display: "Kanit", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --f-body: "IBM Plex Sans Thai", "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  --f-tech: "Chakra Petch", "Kanit", ui-monospace, monospace;

  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --dock-h: 84px;
  --shadow: 0 1px 2px rgba(7, 95, 152, 0.06), 0 8px 24px rgba(7, 95, 152, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { background: var(--white); }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: var(--white);
}
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--sea); }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 3px; }

.app {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px) + 24px);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(90% 50% at 85% -5%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 60%),
    radial-gradient(70% 40% at 0% 30%, rgba(44, 195, 148, 0.10), transparent 70%),
    radial-gradient(80% 45% at 100% 100%, rgba(10, 152, 199, 0.10), transparent 70%),
    linear-gradient(180deg, #dff1f5 0%, #eef8fa 30%, var(--white) 65%, #eef7f4 100%);
}
/* lat/long graticule, like the frame of a map sheet */
.ambient::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(7, 95, 152, 0.05) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(90deg, rgba(7, 95, 152, 0.05) 0 1px, transparent 1px 72px);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 30%, #000 30%, transparent 85%);
          mask-image: radial-gradient(120% 80% at 50% 30%, #000 30%, transparent 85%);
}
#bgTopo { position: absolute; inset: 0; width: 100%; height: 100%; }
.ambient .breeze {
  position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(44, 195, 148, 0.16), rgba(44, 195, 148, 0));
  left: -25vmax; top: 35%;
  animation: breeze 26s ease-in-out infinite alternate;
}
.ambient .breeze.b2 {
  background: radial-gradient(closest-side, rgba(10, 152, 199, 0.14), rgba(10, 152, 199, 0));
  left: auto; right: -30vmax; top: -10%;
  animation-duration: 32s; animation-direction: alternate-reverse;
}
@keyframes breeze { from { transform: translate(0, 0); } to { transform: translate(12vmax, -6vmax); } }

/* ---------- logo ---------- */
.logo-mark svg, .logo-mark img { width: 100%; height: 100%; display: block; }
.wordmark { font-family: var(--f-tech); font-weight: 700; line-height: 0.95; letter-spacing: 0.02em; }
.wordmark .w1 { color: var(--navy); display: block; }
.wordmark .w2 { color: var(--green); display: block; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 10px;
  background: linear-gradient(to bottom, rgba(252, 253, 253, 0.96), rgba(252, 253, 253, 0.75));
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.brand .logo-mark { width: 40px; height: 40px; flex: none; }
.brand-full { height: 40px; width: auto; display: block; }
.brand .wordmark { font-size: 17px; }
.topbar .spacer { flex: 1; }
.date-pill {
  font-family: var(--f-tech);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--navy);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  white-space: nowrap;
}
.mine-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(120deg, var(--green), var(--mint));
  white-space: nowrap;
}

/* ---------- hero: light sky, clean-energy landscape ---------- */
.hero {
  position: relative;
  overflow: hidden;
  margin-top: 4px;
  padding: 18px 18px 0;
  border-radius: 32px;
  color: var(--ink);
  background:
    radial-gradient(60% 45% at 88% 6%, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #d4eef4 0%, #e9f7f9 45%, #f6fbfb 100%);
  border: 1px solid rgba(167, 213, 219, 0.7);
  box-shadow: 0 20px 50px rgba(7, 95, 152, 0.14);
  isolation: isolate;
}
#topo { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.9; }
.sun {
  position: absolute; right: 26px; top: 26px; z-index: -1;
  width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0 45%, rgba(255, 255, 255, 0.6) 46%, rgba(44, 195, 148, 0.14) 70%, rgba(44, 195, 148, 0) 72%);
  box-shadow: 0 0 60px 20px rgba(255, 255, 255, 0.85);
}
.hero-logo-full { display: block; width: min(64%, 250px); height: auto; margin-left: -6px; }

.live-chip {
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: rgba(44, 195, 148, 0.14);
  border: 1px solid rgba(44, 195, 148, 0.5);
  color: var(--green);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(44, 195, 148, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(44, 195, 148, 0); } 100% { box-shadow: 0 0 0 0 rgba(44, 195, 148, 0); } }

.hero h1 {
  margin: 10px 0 0;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(36px, 11vw, 58px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--navy);
  text-wrap: balance;
}
.hero h1 > span { display: block; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--sea) 0%, var(--teal) 45%, var(--mint) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero h1 .amp { font-weight: 600; color: var(--lteal); font-size: 0.6em; }
.hero .lede { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 36ch; }
.hero .lede b { color: var(--ink); font-weight: 600; }

.countdown {
  position: relative;
  margin-top: 16px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(167, 213, 219, 0.8);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
.countdown-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.countdown-head b { color: var(--navy); font-weight: 600; }
.cd-grid { margin-top: 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cd-cell { text-align: center; padding: 8px 4px 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.cd-num { font-family: var(--f-tech); font-weight: 700; font-size: clamp(24px, 8vw, 32px); line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--navy); }
.cd-cell:first-child .cd-num { color: var(--green); }
.cd-lab { font-size: 12px; color: var(--muted); }

/* landscape: hills with contour lines, wind turbines, solar panels */
.landscape { position: relative; z-index: 0; display: block; width: calc(100% + 36px); height: auto; margin: -34px -18px 0; }
.landscape g[stroke="#fcfdfd"] { filter: drop-shadow(0 0 1.2px rgba(7, 95, 152, 0.45)); }
.countdown { z-index: 1; }
.landscape .rotor { transform-box: view-box; animation: spin 6s linear infinite; }
.landscape .rotor.r2 { animation-duration: 8s; }
.landscape .rotor.r3 { animation-duration: 5s; }

/* royal trophy */
.trophy {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.trophy svg { width: 46px; height: 46px; }
.trophy p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); min-width: 0; }
.trophy p strong { display: block; font-family: var(--f-display); font-weight: 600; font-size: 16px; color: var(--navy); }

/* ---------- section titles ---------- */
.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 32px 0 12px;
}
.section-title h2 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 24px; line-height: 1.2; color: var(--ink); text-wrap: balance; }
.section-title span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.section-title .req { color: var(--danger); font-weight: 700; }

/* ---------- event cards rail ---------- */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82%;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-inline: -16px;
  padding: 4px 16px 14px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.ev-card {
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.ev-art { position: relative; height: 108px; overflow: hidden; }
.ev-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ev-art .tag {
  position: absolute; left: 14px; top: 14px;
  font-family: var(--f-tech); font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
  padding: 4px 10px; border-radius: 999px;
  color: #fff;
  background: rgba(4, 50, 79, 0.35); border: 1px solid rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ev-art .big {
  position: absolute; right: 14px; bottom: 4px;
  font-family: var(--f-tech); font-weight: 700; font-size: 64px; line-height: 1;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 6px 24px rgba(4, 50, 79, 0.35);
}
.ev-card.c1 .ev-art { background: linear-gradient(135deg, var(--sea), var(--navy)); }
.ev-card.c2 .ev-art { background: linear-gradient(135deg, var(--mint), var(--teal) 50%, var(--navy)); }
.ev-card.c3 .ev-art { background: linear-gradient(135deg, var(--mint), var(--green)); }
.ev-body { padding: 14px 16px 16px; display: grid; gap: 3px; }
.ev-body .k { font-size: 12px; font-weight: 600; color: var(--teal); letter-spacing: 0.04em; }
.ev-body .v { font-family: var(--f-display); font-weight: 600; font-size: 19px; line-height: 1.3; color: var(--ink); }
.ev-body .s { font-size: 14px; color: var(--muted); line-height: 1.45; }
.ev-body .coord { font-family: var(--f-tech); font-size: 13px; font-weight: 600; color: var(--sea); letter-spacing: 0.04em; }
.ev-body a { font-size: 14px; font-weight: 600; text-decoration: none; }

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li {
  display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}
.steps .n {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  font-family: var(--f-tech); font-weight: 700; font-size: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--sea), var(--navy));
}
.steps li:nth-child(2) .n { background: linear-gradient(135deg, var(--mint), var(--teal)); }
.steps li:nth-child(3) .n { background: linear-gradient(135deg, var(--mint), var(--green)); }
.steps b { display: block; font-weight: 600; font-size: 16px; line-height: 1.35; }
.steps small { display: block; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ---------- form ---------- */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.group { margin-top: 22px; display: grid; gap: 16px; }
.group-label {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font-family: var(--f-tech); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; color: var(--teal);
  padding: 0;
}
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.field { display: grid; gap: 7px; min-width: 0; }
.field > label, .field > .label {
  font-size: 15px; font-weight: 600; color: var(--ink);
  display: flex; align-items: baseline; gap: 4px;
}
.field .req { color: var(--danger); font-weight: 700; }
.field .hint { margin-left: auto; font-size: 12px; color: var(--dim); font-weight: 500; }
.input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  font-size: 17px;
  color: var(--ink);
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-strong);
  background: var(--tint);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
          appearance: none;
}
.input::placeholder { color: var(--dim); }
.input:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 4px rgba(10, 152, 199, 0.15); background: var(--surface); }
.field.ok .input { border-color: rgba(44, 195, 148, 0.75); background: var(--surface); }
.field.bad .input { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(217, 61, 74, 0.1); }
.err { display: none; font-size: 13px; color: var(--danger); }
.field.bad .err { display: block; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute; right: 18px; top: 50%;
  width: 9px; height: 9px;
  border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
select.input { padding-right: 44px; }
select.input:invalid { color: var(--dim); }

.tel-wrap { position: relative; }
.tel-wrap .cc {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--f-tech); font-weight: 700; font-size: 14px; color: var(--teal);
}
.tel-wrap .input { padding-left: 54px; font-family: var(--f-tech); font-weight: 600; letter-spacing: 0.06em; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span, .chip-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-size: 15px; font-weight: 500; color: var(--ink);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
  user-select: none;
}
.chip input:focus-visible + span { outline: 2px solid var(--sea); outline-offset: 2px; }
.chip input:checked + span {
  background: linear-gradient(135deg, var(--sea), var(--navy));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(7, 95, 152, 0.3);
}
.chip:active span, .chip-btn:active { transform: scale(0.96); }
.chip-btn { cursor: pointer; font-size: 14px; min-height: 38px; padding: 0 13px; color: var(--muted); background: var(--tint); }
.chip-btn:hover { color: var(--navy); border-color: var(--sea); }
.chip-btn.suggest { color: var(--green); border-color: rgba(44, 195, 148, 0.6); background: rgba(44, 195, 148, 0.08); font-weight: 600; }

.consent {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--tint);
  border: 1px solid var(--line);
  font-size: 14px; color: var(--muted); line-height: 1.5;
  cursor: pointer;
}
.consent input {
  width: 26px; height: 26px; margin: 0;
  -webkit-appearance: none; appearance: none;
  border-radius: 8px; border: 1.5px solid var(--line-strong);
  background: var(--surface);
  display: grid; place-items: center;
  cursor: pointer;
}
.consent input:checked { background: var(--mint); border-color: var(--mint); }
.consent input:checked::after { content: ""; width: 7px; height: 13px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }
.consent.bad { border-color: var(--danger); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-error {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm);
  background: rgba(217, 61, 74, 0.08); border: 1px solid rgba(217, 61, 74, 0.35);
  color: #a3222e; font-size: 14px;
}

/* ---------- dock ---------- */
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  padding-top: 14px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: linear-gradient(to top, rgba(252, 253, 253, 0.98) 60%, rgba(252, 253, 253, 0));
}
.dock-inner { max-width: 488px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.btn {
  position: relative;
  flex: 1;
  height: 58px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--f-display); font-weight: 600; font-size: 18px;
  color: #fff;
  background: linear-gradient(110deg, var(--navy) 0%, var(--sea) 50%, var(--mint) 120%);
  box-shadow: 0 10px 28px rgba(7, 95, 152, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  text-decoration: none;
}
.btn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.32) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: glint 3.6s ease-in-out infinite;
}
@keyframes glint { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.btn:active { transform: scale(0.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.green { background: linear-gradient(110deg, var(--green), var(--mint)); box-shadow: 0 10px 28px rgba(20, 142, 100, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn.ghost { flex: none; width: 58px; padding: 0; color: var(--navy); background: var(--surface); border: 1.5px solid var(--line-strong); box-shadow: var(--shadow); }
.btn.ghost::after { display: none; }
.btn[data-ready="0"] { filter: saturate(0.55) brightness(1.05); }
.btn.loading { pointer-events: none; }
.btn .spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* ---------- footer ---------- */
.foot { margin-top: 36px; display: grid; justify-items: center; gap: 10px; text-align: center; font-size: 12px; color: var(--dim); line-height: 1.7; }
.foot .logo-mark { width: 48px; height: 48px; opacity: 0.9; }
.foot b { color: var(--muted); font-weight: 600; }

/* ---------- ticket view ---------- */
.ticket-view { padding-block: 10px 0; }
.tv-head { text-align: center; display: grid; gap: 8px; justify-items: center; }
.tv-head h2 { margin: 4px 0 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(28px, 8.5vw, 38px); line-height: 1.15; color: var(--navy); text-wrap: balance; }
.tv-head p { margin: 0; color: var(--muted); font-size: 15px; max-width: 34ch; }
.sync {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--surface);
}
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.sync.ok { color: var(--green); border-color: rgba(44, 195, 148, 0.6); background: rgba(44, 195, 148, 0.08); }
.sync.ok i { background: var(--mint); }
.sync.wait { color: #9a6a00; border-color: rgba(230, 170, 30, 0.5); background: rgba(230, 170, 30, 0.08); }
.sync.wait i { background: #e6aa1e; }
.sync.demo { color: var(--navy); border-color: rgba(10, 152, 199, 0.45); background: rgba(10, 152, 199, 0.07); }
.sync.demo i { background: var(--sea); }


.ticket-tilt {
  position: relative;
  border-radius: 22px;
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out;
  box-shadow: 0 30px 70px rgba(7, 95, 152, 0.35), 0 8px 24px rgba(4, 50, 79, 0.25);
}
.ticket-tilt img { width: 100%; height: auto; border-radius: 22px; -webkit-touch-callout: default; user-select: auto; }


.longpress { margin: 12px 0 0; text-align: center; font-size: 13px; color: var(--dim); }

.where {
  margin-top: 20px;
  display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: var(--r-md);
  background: linear-gradient(120deg, rgba(44, 195, 148, 0.12), rgba(167, 213, 219, 0.18));
  border: 1px solid rgba(44, 195, 148, 0.4);
}
.where svg { width: 44px; height: 44px; }
.where p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; min-width: 0; }
.where p strong { display: block; color: var(--green); font-family: var(--f-display); font-weight: 600; font-size: 16px; }
.tv-actions { margin-top: 12px; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; }
.linkish { background: none; border: 0; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; font-weight: 500; padding: 10px; }

/* ---------- scroll cue: "more below" arrow, shown on every page while content continues ---------- */
.scroll-cue {
  position: fixed; left: 50%;
  bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 44;
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px 0 16px;
  border: 1px solid rgba(7, 95, 152, 0.16); border-radius: 999px;
  background: rgba(252, 253, 253, 0.88);
  -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: 0 8px 24px rgba(4, 50, 79, 0.16);
  color: var(--navy);
  font-family: var(--f-display); font-weight: 500; font-size: 14px;
  cursor: pointer;
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.scroll-cue.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.scroll-cue.show:active { transform: translate(-50%, 0) scale(0.95); }
.scroll-cue svg { width: 20px; height: 20px; animation: cueBob 1.6s ease-in-out infinite; }
.scroll-cue svg .c2 { opacity: 0.4; }
@keyframes cueBob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
/* compact: small round arrow at the right edge, so it never sits on top of fields or chips */
.scroll-cue.compact { left: auto; right: max(16px, env(safe-area-inset-right, 0px)); width: 44px; height: 44px; padding: 0; justify-content: center; transform: translateY(12px); }
.scroll-cue.compact.show { transform: none; }
.scroll-cue.compact.show:active { transform: scale(0.92); }
.scroll-cue.compact span { display: none; }
.scroll-cue.show.mute { opacity: 0; pointer-events: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px) + 12px);
  transform: translate(-50%, 20px);
  opacity: 0;
  z-index: 60;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 16px; border-radius: 14px;
  background: var(--deep); color: var(--white);
  font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 40px rgba(4, 50, 79, 0.35);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

/* load-in: visible at rest, gentle rise */
.rise { animation: rise 0.8s cubic-bezier(.16, 1, .3, 1) both; }
.rise.d1 { animation-delay: 0.06s; } .rise.d2 { animation-delay: 0.12s; } .rise.d3 { animation-delay: 0.18s; } .rise.d4 { animation-delay: 0.24s; }
@keyframes rise { from { transform: translateY(14px); } to { transform: none; } }

@media (min-width: 560px) { .rail { grid-auto-columns: 60%; } }
@media (prefers-reduced-motion: reduce) {
  .scroll-cue svg { animation: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* ================= v2: separate pages ================= */
.view { animation: viewIn 0.45s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes viewIn { from { transform: translateY(10px); } to { transform: none; } }
.mine-btn svg { width: 16px; height: 16px; }
.btn.ghost svg { width: 22px; height: 22px; }

.hero-cta {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 22px;
  border-radius: 999px;
  font-family: var(--f-display); font-weight: 600; font-size: 17px;
  color: #fff; background: linear-gradient(110deg, var(--navy), var(--sea) 60%, var(--teal));
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(7, 95, 152, 0.3);
  transition: transform 0.15s;
}
.hero-cta svg { width: 20px; height: 20px; }
.hero-cta:active { transform: scale(0.97); }

/* sample ticket teaser */
.teaser {
  position: relative;
  display: grid;
  grid-template-columns: 44% 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px 16px 18px 18px;
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, #e3f3f6, var(--surface) 70%);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.teaser-img { position: relative; transform: rotate(-5deg); aspect-ratio: 9 / 16; }
.teaser-img img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 10px; box-shadow: 0 14px 30px rgba(4, 50, 79, 0.3);
  opacity: 0; transition: opacity 0.8s ease;
}
.teaser-img img.on { opacity: 1; }
.teaser-list { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; min-width: 0; }
.teaser-list li { display: grid; gap: 1px; padding-left: 26px; position: relative; }
.teaser-list li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.teaser-list b { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.teaser-list span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.design-note { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.design-note b { color: var(--navy); font-weight: 600; }

/* app bar used by register + ticket pages */
.appbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  display: grid;
  grid-template-columns: 44px 1fr 40px;
  align-items: center;
  gap: 10px;
  padding-block: 10px;
  background: linear-gradient(to bottom, rgba(252, 253, 253, 0.97), rgba(252, 253, 253, 0.82));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); background: var(--surface);
  color: var(--navy); cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: scale(0.94); }
.appbar-title { display: grid; justify-items: center; text-align: center; min-width: 0; line-height: 1.25; }
.appbar-title b { font-family: var(--f-display); font-weight: 600; font-size: 17px; color: var(--ink); }
.appbar-title small { font-size: 12px; color: var(--muted); }
.appbar-logo { width: 40px; height: 40px; }

/* register page */
.reg-view { padding-bottom: 8px; }
.stepper {
  list-style: none; margin: 6px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.stepper li { display: grid; gap: 6px; justify-items: start; font-size: 12px; font-weight: 600; color: var(--dim); }
.stepper li::before { content: ""; width: 100%; height: 6px; border-radius: 99px; background: var(--line); transition: background 0.3s; }
.stepper li i { display: none; }
.stepper li.on { color: var(--navy); }
.stepper li.on::before { background: linear-gradient(90deg, var(--sea), var(--mint)); }
.stepper li.done { color: var(--green); }
.stepper li.done::before { background: var(--mint); }

.reg-form { margin-top: 18px; }
.step { animation: stepIn 0.4s cubic-bezier(.16, 1, .3, 1) both; }
.step.back { animation-name: stepBack; }
@keyframes stepIn { from { transform: translateX(24px); opacity: 0.001; } to { transform: none; opacity: 1; } }
@keyframes stepBack { from { transform: translateX(-24px); opacity: 0.001; } to { transform: none; opacity: 1; } }
.step-head h1 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(28px, 8vw, 34px); line-height: 1.15; color: var(--navy); }
.step-head p { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.step-body { margin-top: 20px; display: grid; gap: 18px; }

/* review card: a preview of what prints on the ticket */
.review {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 18px;
  color: var(--white);
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(44, 195, 148, 0.4), transparent 60%),
    linear-gradient(160deg, var(--sea), var(--navy) 45%, var(--deep));
  box-shadow: 0 18px 44px rgba(7, 95, 152, 0.3);
}
.review::after {
  content: ""; position: absolute; inset: 8px; border-radius: 18px;
  border: 1px solid rgba(167, 213, 219, 0.35); pointer-events: none;
}
.rv-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--f-tech); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--mint); }
.rv-name { margin-top: 10px; font-family: var(--f-display); font-weight: 700; font-size: 26px; line-height: 1.2; }
.rv-name span { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.rv-pos { margin-top: 8px; display: inline-flex; padding: 4px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; background: linear-gradient(120deg, var(--mint), var(--green)); }
.rv-rows { margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.rv-rows div { min-width: 0; }
.rv-rows .full { grid-column: 1 / -1; }
.rv-rows dt { font-size: 12px; color: var(--mist); }
.rv-rows dd { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.rv-edit { position: relative; z-index: 1; margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.rv-edit button {
  border: 1px solid rgba(167, 213, 219, 0.5); background: rgba(252, 253, 253, 0.1); color: var(--white);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* ticket page */
.tv-head { margin-top: 8px; }
.tv-head h2::before {
  content: "";
  display: block; margin: 0 auto 10px;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--mint), var(--green)) ;
  box-shadow: 0 10px 26px rgba(20, 142, 100, 0.35);
  -webkit-mask: none;
}
.tv-head h2 { position: relative; }
.tv-head h2::after {
  content: "";
  position: absolute; left: 50%; top: 14px;
  width: 22px; height: 12px;
  border: solid #fff; border-width: 0 0 4px 4px;
  transform: translateX(-50%) rotate(-45deg);
}
.tv-head.again h2::before, .tv-head.again h2::after { display: none; }

.ticket-stage {
  position: relative;
  margin: 22px auto 0;
  max-width: 400px;
  perspective: 1200px;
  isolation: isolate;
}
.ticket-stage::before {
  content: "";
  position: absolute; inset: 4% -14% 0;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(10, 152, 199, 0.32), rgba(44, 195, 148, 0.12) 65%, rgba(44, 195, 148, 0) 100%);
}
.ticket-print { animation: printIn 1.5s cubic-bezier(.2, .9, .2, 1) both; }
@keyframes printIn {
  0% { clip-path: inset(0 0 100% 0 round 22px); transform: translateY(-30px) rotateX(18deg); }
  70% { clip-path: inset(0 0 0 0 round 22px); }
  100% { clip-path: inset(0 0 0 0 round 22px); transform: none; }
}
.ticket-tilt .holo {
  position: absolute; inset: 0; border-radius: 22px; pointer-events: none;
  background:
    linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, 0.35) 42%, rgba(167, 213, 219, 0.35) 48%, rgba(44, 195, 148, 0.3) 54%, rgba(10, 152, 199, 0.25) 60%, transparent 75%);
  background-size: 250% 250%;
  background-position: var(--hx, 50%) var(--hy, 50%);
  mix-blend-mode: overlay;
}
.ticket-tilt::after {
  content: "";
  position: absolute; inset: 0; border-radius: 22px; pointer-events: none;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.5) 50%, transparent 65%);
  mix-blend-mode: soft-light;
  transform: translateX(-100%);
  animation: foil 5s ease-in-out 1.6s infinite;
  overflow: hidden;
}
@keyframes foil { 0% { transform: translateX(-100%); } 35%, 100% { transform: translateX(100%); } }
.ticket-tilt { overflow: hidden; }

.spark {
  position: absolute; width: 22px; height: 22px; z-index: 2; pointer-events: none;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  background: var(--mint);
  animation: twinkle 2.6s ease-in-out infinite;
}
.spark.s1 { left: -6px; top: 12%; }
.spark.s2 { right: -4px; top: 30%; width: 16px; height: 16px; animation-delay: 0.7s; background: var(--sea); }
.spark.s3 { left: 4%; bottom: 18%; width: 14px; height: 14px; animation-delay: 1.3s; background: var(--mist); }
.spark.s4 { right: 6%; bottom: -8px; animation-delay: 1.9s; }
@keyframes twinkle { 0%, 100% { transform: scale(0.4) rotate(0); opacity: 0.2; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }
