/* Fonts */
@import url("https://fonts.googleapis.com/css2?family=Archivo+Narrow:ital,wght@0,400;0,600;0,700;0,800;0,900;1,700&family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600;700&display=swap");

/* Theme — Stadium (default) */
:root {
  --bg: #f3f0e8;
  --surface: #ffffff;
  --surface-alt: #ebe6da;
  --ink: #16140f;
  --ink2: #5b554a;
  --ink3: #8d8678;
  --line: rgba(20, 16, 8, 0.1);
  --accent: #e6173f;
  --font-display: "Archivo Narrow", "Archivo", system-ui, sans-serif;
  --font-ui: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --green: #25d366;
  --green-light: #d4f5e2;
  --green-dark: #1a9e4e;
  --nav-height: 64px;
}

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

html,
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* Constrain to phone width */
body {
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  min-height: 100dvh;
}

.min-h-dvh {
  min-height: 100dvh;
}

.pb-nav {
  padding-bottom: calc(var(--nav-height));
}

/* Scrollable page content — leaves room for bottom nav */
.page {
  padding: 28px 28px calc(var(--nav-height) + 16px) 28px;
  min-height: 100dvh;
}

.page--no-nav {
  padding-bottom: 0;
}

/* ── Typography helpers ── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink3);
}

h1.display {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 36px;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
}

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px env(safe-area-inset-bottom);
  z-index: 100;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--ink3);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 10px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.nav-tab svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.7;
}
.nav-tab.active {
  color: var(--accent);
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

/* ── Buttons ── */
.btn-primary {
  appearance: none;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  padding: 14px;
  border-radius: 12px;
  width: 100%;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 6px 14px -6px var(--accent);
  transition: opacity 0.15s;
}

.btn-primary:disabled {
  background: var(--surface-alt);
  color: var(--ink3);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-ghost {
  appearance: none;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 12px;
}

.btn-text {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  padding: 8px;
}

/* ── Form fields ── */
.field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink3);
  margin-bottom: 6px;
  display: block;
}

.field-input {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
}

.field-input input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--ink);
  padding: 12px 0;
}

/* ── Sticker card ── */
.sticker-card {
  position: relative;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 1px 3px rgba(0, 0, 0, 0.1);
}

.sticker-card--dim {
  filter: grayscale(100%) brightness(0.96) contrast(0.85);
  opacity: 0.32;
}

.sticker-card__number {
  position: absolute;
  top: 6%;
  left: 6%;
  font-family: var(--font-display);
  font-weight: 800;
  color: #fff;
  mix-blend-mode: screen;
  opacity: 0.9;
  line-height: 1;
}

.sticker-card__mono {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.sticker-card__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticker-card__shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.22) 45%,
    transparent 60%
  );
  mix-blend-mode: overlay;
}

.dupe-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--surface);
  line-height: 1;
}

.empty-slot {
  border-radius: 6px;
  border: 1px dashed var(--line);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: var(--font-mono);
  color: var(--ink3);
  flex-shrink: 0;
}

::-webkit-scrollbar {
  width: 0px;
  background: transparent; /* make scrollbar transparent */
}

/* ── Progress bar ── */
.progress-bar {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ── Avatar ── */
.avatar-link {
  text-decoration: none;
}

.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  flex-shrink: 0;
}

/* ── Chip / tab segmented control ── */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-alt);
  border-radius: 10px;
}

.tab-bar__tab {
  flex: 1;
  appearance: none;
  display: flex;
  justify-content: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--ink2);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 0;
  border-radius: 7px;
}

.tab-bar__tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ── Filter chips ── */
.chip {
  appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--ink2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
}

.chip.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ── Section header row ── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-header a,
.section-header button {
  appearance: none;
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}

/* ── Match row ── */
.match-row {
  appearance: none;
  text-align: left;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  color: var(--ink);
  font-family: var(--font-ui);
  text-decoration: none;
}

/* ── Flash toast ── */
.flash-container {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 420px;
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  width: 100%;
  box-sizing: border-box;
  pointer-events: all;
  animation: toast-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.flash.toast-out {
  animation: toast-out 0.2s ease-in forwards;
}

.flash--alert {
  background: var(--accent);
  color: #fff;
}

.flash__dismiss {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes dialog-pop {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

/* ── WhatsApp green ── */
.btn-whatsapp {
  appearance: none;
  border: none;
  cursor: pointer;
  background: #25d366;
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  padding: 14px;
  border-radius: 12px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── Sticker grid ── */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* ── Utility ── */
.flex {
  display: flex;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 12px;
}
.gap-4 {
  gap: 16px;
}
.flex-1 {
  flex: 1;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.overflow-x-auto {
  overflow-x: auto;
}
.text-accent {
  color: var(--accent);
}
.text-ink2 {
  color: var(--ink2);
}
.text-ink3 {
  color: var(--ink3);
}
.font-mono {
  font-family: var(--font-mono);
}
.font-display {
  font-family: var(--font-display);
}
.mt-1 {
  margin-top: 4px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 16px;
}
.mt-6 {
  margin-top: 24px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-4 {
  margin-bottom: 16px;
}
.p-4 {
  padding: 16px;
}
.px-6 {
  padding-left: 24px;
  padding-right: 24px;
}
.py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}
.w-full {
  width: 100%;
}
.relative {
  position: relative;
}

dialog::backdrop {
  background: rgba(10, 8, 4, 0.55);
  backdrop-filter: blur(6px);
}

dialog[open] {
  animation: dialog-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Guest bottom-sheet modal ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: background 0.28s ease;
  pointer-events: none;
}

.modal--visible {
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.modal__sheet {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 36px;
  width: 100%;
  max-width: 480px;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal__sheet--up {
  transform: translateY(0);
}

/* ── Public profile section accordion ── */
details.section-details > summary { -webkit-appearance: none; }
details.section-details[open] .chevron { transform: rotate(180deg); }
.chevron { transition: transform 0.15s ease; flex-shrink: 0; }
