/* ============================================================
   Tapliner self-pour guest flow — shared design system.
   Recreated from a design handoff (loading splash -> tap reveal ->
   age gate -> check-in -> pour -> cheers -> party board -> tap list).
   Cream/ink/amber palette, Newsreader (serif display) + Instrument
   Sans (UI) + IBM Plex Mono (all-caps micro-labels). Self-contained —
   does not depend on styles.css/app.css (those still back admin.html
   and reset-password.html, which keep the older look).
   ============================================================ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --sp-cream: #fdf7ec;
  --sp-cream-card: #fffdf8;
  --sp-ink: #2a201a;
  --sp-amber: #c47a22;
  --sp-amber-light: #d4901f;
  --sp-amber-lighter: #eaad4d;
  --sp-foam: #f2e6cc;
  --sp-sand: #f6ecd8;
  --sp-sand-2: #f4e7d2;
  --sp-text-2: #5a4c3e;
  --sp-muted: #8a7a68;
  --sp-muted-2: #9a8a72;
  --sp-muted-3: #a99a83;
  --sp-cream-on-dark: #c9b48f;
  --sp-cream-on-dark-2: #e8cfa6;
  --sp-border: rgba(42,32,26,.13);
  --sp-border-soft: rgba(42,32,26,.1);
  --sp-disabled-bg: #e4d9c4;
  --sp-disabled-text: #b3a692;
}

body.sp-body {
  background: var(--sp-cream);
  color: var(--sp-ink);
  font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}
/* Brand mark, fixed behind every screen -- large and centered like a
   watermark pressed into paper, not a logo pinned to a corner. Sits
   behind all in-flow content via a negative z-index (this page has no
   night mode, so no invert variant here -- see dashboard.css's
   .td-watermark for the day/night pair). Uses the pre-flattened black
   SVG + the plain `opacity` property rather than a `filter` -- a CSS
   `filter` on a small stroked SVG background forces a coarser
   rasterization pass in Chromium that visibly facets thin circular
   strokes (confirmed: the same file renders as a clean circle under
   `opacity` and as a faceted hexagon under `filter: brightness(0)`
   at this size). */
body.sp-body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .04;
  background: url('/assets/tapline-mark-black.svg') no-repeat 50% 42% / min(78vw, 480px) auto;
}

.sp-serif { font-family: 'Newsreader', serif; }
.sp-serif-italic { font-family: 'Newsreader', serif; font-style: italic; }
.sp-mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: .13em; text-transform: uppercase; }

@keyframes sp-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(196,122,34,.35); } 50% { box-shadow: 0 0 0 14px rgba(196,122,34,0); } }
@keyframes sp-pop { 0% { transform: scale(0) rotate(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: scale(1) translateY(180px) rotate(220deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .sp-live-dot, .sp-confetti-bit { animation: none !important; }
  .sp-screen { animation: none !important; }
}

/* ---------- screen shell ---------- */
.sp-shell { min-height: 100vh; min-height: 100dvh; width: 100%; }
.sp-screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: 44px 24px 30px;
  max-width: 480px;
  margin: 0 auto;
  animation: sp-fade .4s ease both;
}
.sp-screen-rise { animation: sp-rise .45s ease both; }
.sp-screen-dark { background: var(--sp-ink); color: var(--sp-cream); }

/* ---------- wordmark / brand ---------- */
.sp-wordmark { font-family: 'Newsreader', serif; font-style: italic; font-weight: 500; color: var(--sp-ink); }
.sp-screen-dark .sp-wordmark { color: var(--sp-cream); }
.sp-wordmark-lg { font-size: 44px; }
.sp-wordmark-sm { font-size: 21px; }
.sp-wordmark-xs { font-size: 22px; }

/* ---------- live/pulsing dot + labeled row ---------- */
.sp-live-row { display: flex; align-items: center; gap: 9px; }
.sp-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sp-amber);
  box-shadow: 0 0 0 4px rgba(196,122,34,.16);
  animation: sp-pulse 2.4s ease-in-out infinite;
  flex: 0 0 auto;
}
.sp-live-label { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--sp-muted); font-family: 'IBM Plex Mono', monospace; }

/* ---------- back link ---------- */
.sp-back {
  align-self: flex-start;
  appearance: none; border: none; background: none; cursor: pointer;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--sp-muted);
  letter-spacing: .05em; padding: 4px 0; text-decoration: none;
}

/* ---------- buttons ---------- */
.sp-btn {
  appearance: none; border: none; cursor: pointer; width: 100%;
  border-radius: 100px;
  font-family: 'Instrument Sans', sans-serif; font-weight: 600;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  display: block;
}
.sp-btn-primary { padding: 18px; font-size: 16.5px; background: var(--sp-ink); color: var(--sp-cream); box-shadow: 0 8px 22px rgba(42,32,26,.24); }
.sp-btn-amber { padding: 18px; font-size: 16.5px; background: var(--sp-amber); color: #fff; box-shadow: 0 8px 22px rgba(196,122,34,.3); }
.sp-btn-outline { padding: 16px; font-size: 15px; background: transparent; color: var(--sp-ink); border: 1.5px solid rgba(42,32,26,.18); }
.sp-btn-outline-dark { padding: 15px; font-size: 14px; background: transparent; color: var(--sp-cream); border: 1.5px solid rgba(253,247,236,.22); }
.sp-btn-ghost { appearance: none; border: none; background: none; cursor: pointer; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--sp-muted-3); letter-spacing: .06em; padding: 2px; text-align: center; }
.sp-btn[disabled] { cursor: default; background: var(--sp-disabled-bg); color: var(--sp-disabled-text); box-shadow: none; }

/* ---------- fields ---------- */
.sp-field { margin-bottom: 18px; }
.sp-field label {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--sp-muted); display: block; margin-bottom: 7px;
}
.sp-field label small { color: var(--sp-disabled-text); text-transform: none; letter-spacing: 0; }
.sp-field input {
  width: 100%; box-sizing: border-box; padding: 15px 16px; border-radius: 14px;
  border: 1.5px solid var(--sp-border); background: var(--sp-cream-card);
  font-family: 'Instrument Sans', sans-serif; font-size: 16px; color: var(--sp-ink); outline: none;
}
.sp-field input:focus { border-color: rgba(196,122,34,.5); }
.sp-field input::placeholder { color: var(--sp-disabled-text); }
.sp-callout {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--sp-sand); border-radius: 14px; padding: 13px 15px;
}
.sp-callout-icon { font-family: 'Newsreader', serif; font-style: italic; font-size: 20px; color: var(--sp-amber); line-height: 1; flex: 0 0 auto; }
.sp-callout p { margin: 0; font-family: 'Instrument Sans', sans-serif; font-size: 12.5px; line-height: 1.42; color: #6b5c4c; }
.sp-screen .app-check {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13.5px;
  line-height: 1.4;
  color: #6b5c4c;
  opacity: 1;
  margin: 12px 2px 0;
}
.sp-screen .app-check input[type="checkbox"] { accent-color: var(--sp-amber); }

/* ---------- cards / tiles ---------- */
.sp-card { border: 1px solid var(--sp-border-soft); border-radius: 20px; background: var(--sp-cream-card); padding: 16px 18px; }
.sp-stat-tile { flex: 1; border: 1px solid var(--sp-border); border-radius: 14px; padding: 11px 13px; background: var(--sp-cream-card); }
.sp-stat-tile-label { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .13em; color: var(--sp-muted-2); text-transform: uppercase; }
.sp-stat-tile-val { font-family: 'Newsreader', serif; font-size: 23px; color: var(--sp-ink); line-height: 1; margin-top: 3px; }
.sp-stat-tile-val-sm { font-family: 'Instrument Sans', sans-serif; font-weight: 600; font-size: 13px; color: var(--sp-ink); line-height: 1.15; margin-top: 5px; }

.sp-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sp-muted-2); background: rgba(253,247,236,.72); padding: 5px 9px; border-radius: 20px;
  backdrop-filter: blur(2px);
}

/* ---------- glass (loading splash + pour screen) ---------- */
.sp-glass {
  position: relative;
  border: 2px solid rgba(42,32,26,.18);
  border-radius: 10px 10px 46px 46px;
  overflow: hidden;
  background: var(--sp-cream-card);
}
.sp-glass-dark { border-color: rgba(253,247,236,.3); background: rgba(255,255,255,.04); border-radius: 9px 9px 40px 40px; }
.sp-glass-liquid { position: absolute; left: 0; right: 0; bottom: 0; background: var(--sp-amber-light); }
.sp-glass-foam { position: absolute; top: -6px; left: 0; right: 0; height: 11px; background: var(--sp-foam); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }

/* ---------- hero (tap reveal) ---------- */
.sp-hero {
  position: relative; border-radius: 26px; overflow: hidden;
  background: repeating-linear-gradient(48deg, #efe2c9, #efe2c9 11px, #ead9ba 11px, #ead9ba 22px);
  border: 1px solid var(--sp-border-soft);
  display: flex; align-items: flex-end;
}
.sp-hero-badge { position: absolute; top: 16px; left: 16px; }
.sp-hero-scrim {
  position: relative; width: 100%; padding: 20px 18px;
  background: linear-gradient(to top, rgba(28,20,12,.62), rgba(28,20,12,.14) 62%, transparent);
}
.sp-hero-style { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #f3e2c2; }
.sp-hero-name { font-family: 'Newsreader', serif; font-weight: 500; font-size: 40px; line-height: .98; color: var(--sp-cream); margin-top: 4px; letter-spacing: -.01em; }

/* ---------- photo collage / grid ---------- */
.sp-photo-tile {
  position: relative; border-radius: 16px; overflow: hidden;
  background: repeating-linear-gradient(45deg, #efe2c9, #efe2c9 7px, #e8d7b8 7px, #e8d7b8 14px);
  border: 1px solid var(--sp-border-soft);
}
.sp-photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-photo-tile-caption {
  position: absolute; left: 11px; bottom: 9px;
  font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .1em; color: #fff;
  text-shadow: 0 1px 5px rgba(0,0,0,.55); pointer-events: none;
}

/* ---------- leaderboard row ---------- */
.sp-lb-row { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-radius: 14px; background: var(--sp-cream-card); border: 1px solid var(--sp-border-soft); }
.sp-lb-row.is-you { background: var(--sp-ink); border-color: transparent; box-shadow: 0 6px 16px rgba(42,32,26,.2); }
.sp-lb-rank { font-family: 'IBM Plex Mono', monospace; font-size: 12px; width: 24px; color: var(--sp-muted-3); flex: 0 0 auto; }
.sp-lb-row.is-you .sp-lb-rank { color: var(--sp-amber); }
.sp-lb-name { flex: 1; font-family: 'Instrument Sans', sans-serif; font-weight: 600; font-size: 15px; color: var(--sp-ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-lb-row.is-you .sp-lb-name { color: var(--sp-cream); }
.sp-lb-meta { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--sp-muted-2); flex: 0 0 auto; }
.sp-lb-row.is-you .sp-lb-meta { color: var(--sp-cream-on-dark-2); }

/* ---------- confetti ---------- */
.sp-confetti-bit { position: absolute; top: -10px; width: 9px; height: 13px; border-radius: 2px; animation: sp-pop 1.6s ease-in both; }

/* ---------- boot / loading splash (overlay, covers page until ready) ---------- */
.sp-boot-loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--sp-ink); color: var(--sp-cream);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px; box-sizing: border-box;
  transition: opacity .4s ease;
}
.sp-boot-loader.is-hidden { opacity: 0; pointer-events: none; }
.sp-boot-qr-row { position: absolute; top: 44px; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
.sp-boot-qr-row .sp-mono { font-size: 10.5px; color: var(--sp-cream-on-dark); text-transform: uppercase; }
.sp-boot-caption { margin-top: 24px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .1em; color: #9a8a72; }
.sp-glass-liquid[data-boot-liquid] { transition: height .12s linear; }

/* ---------- tap list rows ---------- */
.sp-tap-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  appearance: none; padding: 15px 17px; border-radius: 18px;
  background: var(--sp-cream-card); border: 1.5px solid var(--sp-border);
  cursor: pointer; font: inherit;
}
.sp-tap-row.is-now { border-color: rgba(196,122,34,.4); box-shadow: 0 6px 18px rgba(196,122,34,.12); }
.sp-tap-row.is-off { background: #f3ecdf; opacity: .6; cursor: default; }
.sp-tap-row-meta { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .13em; color: var(--sp-muted-2); }
.sp-tap-row.is-now .sp-tap-row-meta { color: var(--sp-amber); }
.sp-tap-row.is-off .sp-tap-row-meta { color: #c3b7a1; }
.sp-tap-row-name { font-family: 'Newsreader', serif; font-size: 22px; color: var(--sp-ink); line-height: 1.05; margin-top: 3px; }
.sp-tap-row.is-off .sp-tap-row-name { color: var(--sp-disabled-text); }
.sp-tap-row-abv { font-family: 'Newsreader', serif; font-size: 19px; color: var(--sp-ink); line-height: 1; text-align: right; }
.sp-tap-row.is-off .sp-tap-row-abv { color: #c3b7a1; }
.sp-tap-row-tag { font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .1em; color: var(--sp-muted-3); margin-top: 4px; text-align: right; }
.sp-tap-row.is-now .sp-tap-row-tag { color: var(--sp-amber); }
.sp-tap-row.is-off .sp-tap-row-tag { color: #c3b7a1; }

.sp-empty { color: var(--sp-muted); font-size: 15px; text-align: center; }

/* ============================================================
   Re-skin for reused modules (account-setup.js, password-rules.js)
   so the "Save My Info" panel and its live checklist match this
   design system without needing any JS changes — both only depend
   on class names/data-hooks, not on app.css specifically.
   ============================================================ */
.sp-screen .app-account-setup { margin: 28px 0 24px; }
/* Card-wrapped, matching the rank card's bordered-tile look, rather than a
   bare pill button floating between cards. Padding/border live on
   -toggle-inner (the actual grid item the 0fr/1fr collapse trick resizes)
   so the card still collapses cleanly when the panel opens -- putting it
   on -toggle-wrap (the grid container) would leave a fixed-height box
   behind even at grid-template-rows:0fr. */
.sp-screen .app-account-setup-toggle-inner {
  border: 1px solid var(--sp-border-soft);
  border-radius: 20px;
  background: var(--sp-cream-card);
  padding: 18px;
  text-align: center;
}
.sp-screen .app-link-ghost.btn.btn-primary,
.sp-screen [data-account-setup-toggle] {
  appearance: none; border: none; cursor: pointer; width: 100%; padding: 14px; border-radius: 100px;
  background: var(--sp-amber); color: #fff;
  font-family: 'Instrument Sans', sans-serif; font-size: 15px; font-weight: 600;
  box-shadow: 0 8px 22px rgba(196,122,34,.24);
}
.sp-screen .app-account-setup-teaser {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--sp-text-2);
  margin-top: 10px;
}
.sp-screen .app-account-setup-panel-inner { padding-top: 14px; }
.sp-screen .app-panel {
  border-radius: 20px; background: var(--sp-cream-card); border: 1px solid var(--sp-border-soft);
  padding: 18px; text-align: left;
}
.sp-screen .app-panel-title { font-family: 'Newsreader', serif; font-size: 19px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--sp-ink); }
.sp-screen .app-account-setup .app-hint { font-family: 'Instrument Sans', sans-serif; font-size: 13px; color: var(--sp-text-2); }
.sp-screen .app-account-setup .app-field label { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--sp-muted); }
.sp-screen .app-account-setup .app-input-line { border-bottom-color: var(--sp-border); }
.sp-screen .app-account-setup .app-input-line input { font-family: 'Instrument Sans', sans-serif; color: var(--sp-ink); font-size: 16px; }
.sp-screen .app-account-setup .app-input-icon { color: var(--sp-muted); }
.sp-screen .app-account-setup [data-account-submit] {
  appearance: none; border: none; cursor: pointer; width: 100%; padding: 16px; border-radius: 100px;
  background: var(--sp-amber); color: #fff; font-family: 'Instrument Sans', sans-serif; font-size: 15px; font-weight: 600;
  box-shadow: 0 8px 22px rgba(196,122,34,.24);
}
.sp-screen .app-account-setup [data-account-submit][disabled] { background: var(--sp-disabled-bg); color: var(--sp-disabled-text); box-shadow: none; }
.sp-screen .app-pw-checklist li { color: var(--sp-muted); font-family: 'Instrument Sans', sans-serif; font-size: 12.5px; font-weight: 500; }
.sp-screen .app-pw-checklist li.is-met { color: var(--sp-ink); }
.sp-screen .app-pw-check-icon { background: rgba(42,32,26,.08); }
.sp-screen .app-pw-checklist li.is-met .app-pw-check-icon { background: #4a7f5c; }
.sp-screen .app-account-setup-done { background: rgba(74,127,92,.12); border-color: rgba(74,127,92,.3); border-radius: 14px; text-align: center; }
.sp-screen .app-account-setup-done .app-hint { color: #33553f; font-family: 'Instrument Sans', sans-serif; font-size: 13px; }

@media (max-width: 380px) {
  .sp-screen { padding: 36px 18px 26px; }
}
