/* ==========================================================================
   AERA PARTY — styles  (mono + neon-green, Space Grotesk / Inter)
   Mobile-first: every guest is on a phone.
   ========================================================================== */

:root {
  --bg:        #0a0a0a;
  --surface:   #141414;
  --surface-2: #1e1e1e;
  --line:      #2a2a2a;
  --text:      #f4f4f4;
  --text-dim:  #9a9a9a;
  --neon:      #c6ff00;
  --neon-dim:  #8fbf00;
  --danger:    #ff4d4d;
  --gold:      #ffcf5c;
  --radius:    16px;
  --radius-sm: 10px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 16px calc(88px + env(safe-area-inset-bottom));
}

/* ---- Typography --------------------------------------------------------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
.muted { color: var(--text-dim); }
.mono { font-variant-numeric: tabular-nums; }
.upper { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; }

/* ---- Top bar ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 12px;
  background: linear-gradient(var(--bg) 78%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  letter-spacing: 0.22em; color: var(--bg);
  background: var(--neon); padding: 5px 9px 4px; border-radius: 8px;
}
.brand small { display: block; color: var(--text-dim); font-size: 0.68rem; letter-spacing: 0.08em; }
.coupon-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: 0.9rem;
}
.coupon-chip b { color: var(--neon); font-family: var(--font-display); }

/* ---- Cards -------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.card.tint { background: linear-gradient(160deg, rgba(198,255,0,0.08), var(--surface)); border-color: rgba(198,255,0,0.25); }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  padding: 15px 18px; border-radius: var(--radius-sm);
  background: var(--neon); color: #0a0a0a; transition: transform .08s ease, opacity .15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid rgba(255,77,77,0.4); }
.btn.sm { width: auto; padding: 9px 14px; font-size: 0.85rem; }

/* ---- Inputs ------------------------------------------------------------- */
.field { width: 100%; padding: 15px 16px; font-size: 1.05rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-body); }
.field:focus { outline: none; border-color: var(--neon); }

/* ---- Bottom nav --------------------------------------------------------- */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; max-width: 520px; margin: 0 auto;
  background: rgba(20,20,20,0.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav button {
  flex: 1; background: none; border: none; color: var(--text-dim);
  padding: 11px 4px; font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
  font-family: var(--font-body);
}
.nav button .ico { font-size: 1.25rem; line-height: 1; }
.nav button.active { color: var(--neon); }

/* ---- Bingo grid --------------------------------------------------------- */
.bingo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bingo-cell {
  position: relative; aspect-ratio: 1; border-radius: 12px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 8px; display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 0.62rem; line-height: 1.2; color: var(--text-dim); transition: all .15s;
}
.bingo-cell .cam { position: absolute; top: 5px; right: 6px; font-size: 0.7rem; opacity: 0.5; }
.bingo-cell.done {
  background: linear-gradient(150deg, var(--neon), var(--neon-dim));
  color: #0a0a0a; font-weight: 600; border-color: var(--neon);
}
.bingo-cell.done .cam { opacity: 0; }
.bingo-cell.done::after { content: "✓"; position: absolute; top: 4px; left: 7px; font-weight: 700; }
.row-badge { display:flex; align-items:center; gap:8px; margin: 10px 0 4px; }
.row-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.row-badge .dot.win { background: var(--gold); }

/* ---- Team badge --------------------------------------------------------- */
.team-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
}
.big-num { font-family: var(--font-display); font-size: 4rem; font-weight: 700; color: var(--neon); line-height: 1; }

/* ---- Misc --------------------------------------------------------------- */
.hidden { display: none !important; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; }
.pill { font-size: 0.7rem; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-dim); }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  background: var(--neon); color: #0a0a0a; padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-family: var(--font-display); opacity: 0; transition: all .25s;
  z-index: 50; pointer-events: none; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Modal (check-in popup) --------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
  animation: fadeIn .2s ease;
}
.modal {
  width: 100%; max-width: 440px; margin: auto;
  background: var(--surface); border: 1px solid rgba(198,255,0,0.3);
  border-radius: var(--radius); padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: popIn .25s cubic-bezier(.2,.9,.3,1.2);
}
.modal h2 { font-size: 1.4rem; }
.role-label { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.01em; }
.modal-div { height: 1px; background: var(--line); margin: 4px 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }

/* ---- Host message bubbles ----------------------------------------------- */
.bubbles { display: flex; flex-direction: column; gap: 9px; }
.bubble {
  align-self: flex-start; max-width: 90%;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px; padding: 11px 14px;
  font-size: 0.95rem; line-height: 1.42; animation: popIn .25s ease both;
}
.bubble:nth-child(2) { animation-delay: .05s; }
.bubble:nth-child(3) { animation-delay: .1s; }
.bubble:nth-child(4) { animation-delay: .15s; }
.signoff { text-align: right; font-family: var(--font-display); font-weight: 700; color: var(--neon); margin: 2px 4px 0 0; }

/* ---- Photo gallery (host) ----------------------------------------------- */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.photo-tile { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.photo-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photo-tile .cap { font-size: 0.7rem; color: var(--text-dim); padding: 6px 8px; }

/* ---- Stat tiles (dashboard) --------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat .n { font-family: var(--font-display); font-size: 2rem; font-weight: 700; }
.stat .l { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.list .item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.list .item:last-child { border-bottom: none; }
