:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --yellow: #f5c518;
  --yellow-dark: #e0b000;
  --brand: #1d4ed8;
  --ok: #059669;
  --danger: #dc2626;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}
body.on-checkout .details-bottom-bar { display: none; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px;
  object-fit: contain; display: block; flex-shrink: 0;
  background: transparent;
}
.brand-name { font-weight: 800; letter-spacing: -0.02em; }
.app-link {
  color: var(--brand); text-decoration: none; font-weight: 600; font-size: 0.9rem;
}

.page-state {
  max-width: 520px; margin: 80px auto; text-align: center;
  padding: 24px; color: var(--muted);
}

.progress-bar {
  display: flex; align-items: center; gap: 16px;
  max-width: 1200px; margin: 0 auto; padding: 18px 20px 8px;
}
.back-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  width: 36px; height: 36px; cursor: pointer; font-size: 1rem;
}
.steps { display: flex; gap: 18px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-weight: 600; font-size: 0.92rem;
}
.step span {
  width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center;
  background: #e5e7eb; color: #374151; font-size: 0.8rem;
}
.step.on { color: var(--ink); }
.step.on span { background: var(--yellow); color: #111; }

/* Details screen (mobile-like: info first, CTA bar) */
.screen-details {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px 108px;
}
.details-shell { width: 100%; }
.details-bottom-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(17, 24, 39, 0.08);
}
.details-price { flex: 2; min-width: 0; }
.details-price-row {
  display: flex; align-items: baseline; gap: 6px;
  white-space: nowrap; overflow: hidden;
}
.details-price-main {
  font-size: 1.35rem; font-weight: 900; letter-spacing: -0.02em;
}
.details-price-main.is-free { color: #099a20; }
.details-price-sub { font-size: 0.9rem; font-weight: 500; }
.details-cta {
  flex: 3;
  width: auto !important;
  margin-top: 0 !important;
  border-radius: 22px;
  padding: 14px 12px;
  max-width: 100%;
}

/* Checkout screen */
.screen-checkout {
  padding-bottom: 24px;
}
.checkout-event-strip {
  max-width: 960px;
  margin: 0 auto 12px;
  padding: 12px 14px !important;
  display: flex;
  gap: 12px;
  align-items: center;
}
.checkout-thumb {
  width: 56px; height: 56px; border-radius: 12px;
  object-fit: cover; background: #e5e7eb; flex-shrink: 0;
}
.checkout-event-copy { min-width: 0; flex: 1; }
.checkout-title {
  font-weight: 800; font-size: 1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.layout {
  max-width: 960px;
  margin: 0 auto 40px;
  padding: 8px 20px 32px;
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(260px, 0.9fr);
  gap: 18px;
  align-items: start;
}
.layout.confirm-mode {
  grid-template-columns: 1fr;
  max-width: 560px;
}

@media (max-width: 860px) {
  .layout,
  .layout.confirm-mode { grid-template-columns: 1fr; }
  .sticky-summary { position: static; }
  .checkout-event-strip { margin-left: 16px; margin-right: 16px; }
}

.card, .event-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.event-card { padding: 0; overflow: hidden; }
.cover {
  position: relative;
  aspect-ratio: 16/10;
  background: #d1d5db;
  overflow: hidden;
}
.cover-track { width: 100%; height: 100%; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-count {
  position: absolute; right: 12px; bottom: 10px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 0.75rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
}
.cover-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 999px;
  border: none; background: rgba(255,255,255,0.9);
  color: #111; font-size: 1.25rem; line-height: 1;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.cover-nav.prev { left: 10px; }
.cover-nav.next { right: 10px; }
.event-body { padding: 14px 16px 18px; }
.event-card h1 {
  font-size: 1.35rem; margin: 0 0 6px;
  font-weight: 900; letter-spacing: -0.02em; line-height: 1.2;
}
.category-sub {
  margin: 0 0 10px; font-size: 0.9rem; font-weight: 500;
}
.about-inline { margin-bottom: 16px; }
.about-inline p { margin: 0; white-space: pre-wrap; line-height: 1.55; font-size: 0.92rem; }
.about-text.clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.organised-by {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 16px; padding: 12px;
  border-radius: 14px;
  background: rgba(245, 197, 24, 0.1);
  border: 1px solid rgba(245, 197, 24, 0.45);
}
.club-pic {
  width: 48px; height: 48px; border-radius: 999px;
  object-fit: cover; background: #e5e7eb; flex-shrink: 0;
}
.organised-copy { min-width: 0; flex: 1; }
.organised-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.club-badge {
  background: var(--yellow); color: #111;
  font-size: 0.7rem; font-weight: 800;
  padding: 3px 10px; border-radius: 8px;
}
.club-name {
  font-weight: 800; font-size: 0.95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.logistics { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.logistics-row {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.92rem; color: #111; font-weight: 600;
}
.logistics-text {
  flex: 1; min-width: 0; line-height: 1.35;
  overflow: hidden; display: -webkit-box;
  -webkit-box-orient: vertical; -webkit-line-clamp: 4;
}
.ico { flex-shrink: 0; line-height: 1.35; }
.cat-pill {
  flex-shrink: 0;
  background: #15203a; color: #fff;
  font-size: 0.78rem; font-weight: 700;
  padding: 6px 12px; border-radius: 8px;
  max-width: 42%; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.map-link {
  flex-shrink: 0;
  color: #1e90ff; font-size: 0.82rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
}

.hosts, .availability { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.hosts-label, .availability h3 {
  margin: 0 0 10px; font-size: 0.78rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700;
}
.host-row { display: flex; gap: 10px; align-items: center; }
.host-copy { min-width: 0; flex: 1; }
.host-pic { width: 48px; height: 48px; border-radius: 999px; object-fit: cover; background: #e5e7eb; }
.host-name { font-weight: 800; font-size: 0.95rem; }
.host-ig {
  margin-top: 2px; color: #e94277; font-size: 0.78rem; font-weight: 600;
}
.ig-btn {
  flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 10px; background: #fff; color: #111;
  font-size: 0.75rem; font-weight: 700; text-decoration: none;
  white-space: nowrap;
}
.availability-card {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; background: #fafafa;
}
.availability-top {
  display: flex; justify-content: space-between; gap: 10px;
  align-items: flex-start; font-weight: 800; font-size: 0.92rem;
  margin-bottom: 10px;
}
.availability-bar {
  height: 8px; border-radius: 999px; background: #e5e7eb; overflow: hidden;
}
.availability-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: #2eaf4b; transition: width 0.35s ease;
}
.availability-fill.full { background: #ff3b61; }
#availabilityPct { margin-top: 8px; }
.link-btn {
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: #ca8a04;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.row-actions .btn-ghost { margin-top: 0; }
.row-actions .link-btn { margin-top: 0; }
.ticket-desc {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.ticket-desc.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.ticket-toggle {
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  color: #ca8a04;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.panel .card + .card { margin-top: 14px; }
.card h2 { margin: 0 0 14px; font-size: 1.05rem; }

label { display: block; font-size: 0.85rem; font-weight: 600; margin: 10px 0 6px; }
input[type="text"], input[type="email"], input:not([type]), input[type="tel"] {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); font-size: 0.95rem; background: #fff;
}
input:focus { outline: 2px solid rgba(245, 197, 24, 0.45); border-color: var(--yellow); }

.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  background: #fafafa;
}
.ticket.selected { border-color: var(--yellow); background: #fffbeb; }
.ticket-name { font-weight: 700; }
.ticket-desc { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.ticket-price { font-weight: 700; white-space: nowrap; }
.qty {
  display: flex; align-items: center; gap: 8px;
}
.qty button {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-weight: 700;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 14px; padding: 14px 16px; border-radius: 14px;
  border: none; font-weight: 800; font-size: 1rem; cursor: pointer;
}
.btn-primary, .btn-pay { background: var(--yellow); color: #111; }
.btn-primary:hover, .btn-pay:hover { background: var(--yellow-dark); }
.btn-ghost {
  width: auto; margin-top: 8px; padding: 10px 14px;
  background: #fff; border: 1px solid var(--line); color: #111; font-weight: 700;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.is-loading { pointer-events: none; }
.btn-spinner {
  width: 1.05em;
  height: 1.05em;
  border: 2px solid rgba(17, 17, 17, 0.2);
  border-top-color: #111;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.sticky-summary { position: sticky; top: 76px; }
.summary-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.summary-line { display: flex; justify-content: space-between; gap: 10px; font-size: 0.92rem; }
.summary-line.muted-line { color: var(--muted); }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; }
.total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 1.05rem;
}
.card-head-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 4px;
}
.card-head-row h2 { margin: 0; }
.guest-rows { display: flex; flex-direction: column; gap: 12px; }
.guest-row {
  display: flex; flex-direction: column; gap: 2px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.guest-row:last-child { padding-bottom: 0; border-bottom: none; }
.guest-row strong {
  font-size: 1rem; font-weight: 700; word-break: break-word;
}
.error-text { color: var(--danger); font-size: 0.88rem; margin: 8px 0 0; }
.pill.ok {
  display: inline-block; background: #d1fae5; color: var(--ok);
  padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 0.8rem;
}
.success-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 32px 22px 28px;
}
.success-card.play-success .success-check,
.success-card.play-success .success-burst span {
  animation-play-state: running;
}
.success-check {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
}
.success-check svg { display: block; width: 72px; height: 72px; }
.success-check-circle {
  stroke: var(--ok);
  stroke-width: 2.5;
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: success-draw 0.6s ease forwards paused;
}
.success-check-mark {
  stroke: var(--ok);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: success-draw 0.35s ease 0.45s forwards paused;
}
.success-burst {
  pointer-events: none;
  position: absolute;
  inset: 12% 10% auto;
  height: 120px;
}
.success-burst span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--yellow);
  opacity: 0;
  animation: success-burst 0.9s ease-out forwards paused;
}
.success-burst span:nth-child(1) { --dx: -52px; --dy: -28px; background: #34d399; animation-delay: 0.35s; }
.success-burst span:nth-child(2) { --dx: 48px; --dy: -32px; animation-delay: 0.4s; }
.success-burst span:nth-child(3) { --dx: -40px; --dy: 36px; background: #60a5fa; animation-delay: 0.45s; }
.success-burst span:nth-child(4) { --dx: 44px; --dy: 30px; background: #34d399; animation-delay: 0.5s; }
.success-burst span:nth-child(5) { --dx: 0; --dy: -48px; animation-delay: 0.38s; }
.success-burst span:nth-child(6) { --dx: 8px; --dy: 46px; background: #f59e0b; animation-delay: 0.48s; }
@keyframes success-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes success-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); }
}
.success-card h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.25rem, 4vw, 1.55rem);
}
.success-card #confirmMsg {
  max-width: 28rem;
  margin: 0 auto;
  line-height: 1.45;
}
.success-card .link-btn {
  display: inline-block;
  margin-top: 16px;
  text-align: center;
}
.subtle-app-link {
  color: var(--muted) !important;
  font-weight: 600 !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

