/* ============================================================
   LUMSTATS — layout & components (colours/fonts live in theme.css)
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 700; line-height: 1.15; }
a { color: var(--primary-deep); }
button { font-family: inherit; cursor: pointer; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---- Nav ---- */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 246, 247, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--mist);
}
.nav-inner { display: flex; align-items: center; gap: 24px; padding: 14px 24px; max-width: 1080px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.nav-links { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.nav-links a {
  font-size: .95rem; font-weight: 700; color: var(--ink-soft); text-decoration: none;
  padding: 8px 14px; border-radius: 99px; transition: all .2s;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-soft); }
.nav-links a.on { color: #fff; background: var(--grad); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--grad); color: #fff; border: none; text-decoration: none;
  font-size: 1rem; font-weight: 800; padding: 13px 26px; border-radius: 99px;
  box-shadow: var(--shadow); transition: transform .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: var(--card); color: var(--primary-deep); border: 2px solid var(--mist); box-shadow: none; }
.btn.big { font-size: 1.15rem; padding: 16px 34px; }
.btn.small { font-size: .92rem; padding: 10px 20px; }
.btn.full { width: 100%; }

/* ---- Flash messages ---- */
.flash {
  max-width: 1080px; margin: 18px auto 0; padding: 14px 22px; border-radius: 14px;
  font-weight: 700;
}
.flash.success { background: #E4F2EB; color: #2E6B52; }
.flash.error   { background: #FBE3E0; color: var(--danger); }

/* ---- Homepage video ---- */
.video-hero { background: var(--grad-soft); padding: 28px 0 0; }
.video-player {
  display: block; width: 100%; max-width: 860px; margin: 0 auto;
  border-radius: var(--radius); box-shadow: var(--shadow); background: #000;
}
.video-placeholder {
  max-width: 860px; margin: 0 auto; padding: 60px 24px; text-align: center;
  background: var(--card); border: 2px dashed var(--mist); border-radius: var(--radius);
  color: var(--ink-soft); font-weight: 700;
}
@media (max-width: 800px) {
  .video-hero { padding-top: 16px; }
}

/* ---- Hero / page head ---- */
.hero { background: var(--grad-soft); padding: 80px 0 30px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.eyebrow {
  display: inline-block; background: var(--card); color: var(--primary-deep);
  font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  padding: 7px 16px; border-radius: 99px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--primary-deep); }
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.page-head { background: var(--grad-soft); padding: 56px 0 40px; }
.page-head h1 { font-size: 2.4rem; margin-bottom: 8px; }
.page-head p { color: var(--ink-soft); font-size: 1.08rem; }

/* ---- Hum card / wave ---- */
.hum-card { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: 28px; text-align: center; }
.hum-card .timer { font-family: var(--font-display); font-size: 3rem; font-weight: 700; color: var(--primary-deep); }
.hum-card .label { color: var(--ink-soft); font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.wavebars { display: flex; align-items: center; justify-content: center; gap: 5px; height: 64px; margin: 18px 0; }
.wavebars span { width: 7px; border-radius: 99px; background: var(--grad); animation: hum 1.4s ease-in-out infinite; }
.wavebars span:nth-child(1){height:18px;animation-delay:0s}
.wavebars span:nth-child(2){height:34px;animation-delay:.1s}
.wavebars span:nth-child(3){height:52px;animation-delay:.2s}
.wavebars span:nth-child(4){height:40px;animation-delay:.3s}
.wavebars span:nth-child(5){height:60px;animation-delay:.4s}
.wavebars span:nth-child(6){height:44px;animation-delay:.5s}
.wavebars span:nth-child(7){height:56px;animation-delay:.6s}
.wavebars span:nth-child(8){height:32px;animation-delay:.7s}
.wavebars span:nth-child(9){height:46px;animation-delay:.8s}
.wavebars span:nth-child(10){height:22px;animation-delay:.9s}
@keyframes hum { 0%,100%{transform:scaleY(.55)} 50%{transform:scaleY(1)} }

/* ---- Stats strip ---- */
.stats-strip { display: flex; gap: 18px; flex-wrap: wrap; padding: 34px 0 60px; }
.stat { flex: 1; min-width: 180px; background: var(--card); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); }
.stat .num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--primary-deep); }
.stat .cap { color: var(--ink-soft); font-weight: 700; font-size: .85rem; }

/* ---- Sections / steps ---- */
.section { padding: 64px 0; }
.section.tint { background: var(--bg-soft); }
.section h2 { font-size: 2.1rem; margin-bottom: 10px; }
.section .sub { color: var(--ink-soft); font-size: 1.08rem; max-width: 60ch; margin-bottom: 40px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { background: var(--card); border-radius: var(--radius); padding: 30px 26px; box-shadow: var(--shadow); }
.step .n {
  width: 46px; height: 46px; border-radius: 50%; background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 16px;
}
.step h3 { font-size: 1.25rem; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: .98rem; }

/* ---- Chips ---- */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.chip {
  border: 2px solid var(--mist); background: var(--card); color: var(--ink-soft);
  font-weight: 800; font-size: .92rem; padding: 9px 20px; border-radius: 99px;
  text-decoration: none; transition: all .2s;
}
.chip.on, .chip:hover { background: var(--grad); color: #fff; border-color: transparent; }

/* ---- Leaderboard filters ---- */
.board-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.board-filters select, .board-filters input[type="search"] {
  border: 2px solid var(--mist); border-radius: 99px; padding: 10px 18px;
  font-family: inherit; font-size: .95rem; font-weight: 700;
  background: var(--card); color: var(--ink); outline: none;
}
.board-filters select:focus, .board-filters input[type="search"]:focus { border-color: var(--primary); }
.board-filters input[type="search"] { min-width: 220px; }

/* ---- Leaderboard table ---- */
.board { padding: 44px 0 70px; }
.board-table { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: grid; grid-template-columns: 70px 2fr .8fr .6fr; gap: 12px; align-items: center; padding: 16px 26px; border-bottom: 1px solid var(--bg-soft); }
.row.head { background: var(--bg-soft); font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.row:last-child { border-bottom: none; }
.rank { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--ink-soft); }
.who { font-weight: 800; }
.who small { display: block; font-weight: 600; color: var(--ink-soft); }
.dur { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--primary-deep); }
.pts { font-weight: 800; color: var(--success); }
.empty-note { padding: 40px; text-align: center; color: var(--ink-soft); font-weight: 600; }
.board-table.alltime .row { grid-template-columns: 70px 2fr .8fr .6fr 52px; }
.play-btn {
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: var(--grad); color: #fff; font-size: 1rem;
  box-shadow: var(--shadow); transition: transform .15s;
}
.play-btn:hover { transform: scale(1.08); }
.play-btn.playing { background: var(--ink); }

/* ---- Forms / panels ---- */
.record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 44px 0 70px; align-items: start; }
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; padding: 50px 0 80px; align-items: start; }
.auth-wrap.single { grid-template-columns: minmax(0, 520px); justify-content: center; }
.panel { background: var(--card); border-radius: 26px; box-shadow: var(--shadow); padding: 32px; }
.panel h3 { font-size: 1.3rem; margin-bottom: 6px; }
.panel .hint { color: var(--ink-soft); font-size: .92rem; margin-bottom: 22px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 800; font-size: .85rem; letter-spacing: .04em; margin-bottom: 8px; }
.field input, .field select {
  width: 100%; border: 2px solid var(--mist); border-radius: 14px; padding: 13px 16px;
  font-family: inherit; font-size: 1rem; background: var(--bg); color: var(--ink); outline: none;
}
.field input:focus, .field select:focus { border-color: var(--primary); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  background: none; border: none; font-size: 1.25rem; line-height: 1;
  padding: 8px; border-radius: 10px; opacity: .55; transition: opacity .2s;
}
.pw-toggle:hover, .pw-toggle.on { opacity: 1; }
.field .note { font-size: .82rem; color: var(--ink-soft); margin-top: 6px; }

/* ---- Tap-to-add name chips ---- */
.name-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.name-chips .chip { font-size: .85rem; padding: 7px 14px; }

/* ---- Saved group chips ---- */
.group-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.gchip {
  border: 2px solid var(--mist); background: var(--bg); border-radius: 16px;
  padding: 12px 18px; font-weight: 800; color: var(--ink); text-align: left; transition: all .2s;
}
.gchip small { display: block; font-weight: 600; color: var(--ink-soft); font-size: .8rem; }
.gchip.on { border-color: var(--primary); background: var(--accent-soft); }

/* ---- Hum timer ---- */
.timer-box { text-align: center; padding: 8px 0; }
.timer-box .btn { margin-bottom: 20px; }
.timer-ring {
  width: 260px; height: 260px; margin: 0 auto; border-radius: 50%;
  background: var(--grad); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.timer-ring .inner {
  width: 222px; height: 222px; border-radius: 50%; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.timer-ring .t { font-family: var(--font-display); font-size: 2.9rem; font-weight: 700; color: var(--primary-deep); }
.timer-ring small { color: var(--ink-soft); font-weight: 700; }

/* ---- Hum recorder ---- */
.rec-steps { margin: 0 0 18px 22px; color: var(--ink-soft); font-weight: 600; }
.rec-steps li { margin-bottom: 4px; }
.btn.rec-on { background: var(--danger); animation: recpulse 1.6s ease-in-out infinite; }
@keyframes recpulse { 0%,100%{box-shadow:0 0 0 0 rgba(192,57,43,.35)} 50%{box-shadow:0 0 0 14px rgba(192,57,43,0)} }
.rec-status { text-align: center; font-weight: 700; min-height: 1.4em; margin-top: 10px; color: var(--ink-soft); }
.rec-result { text-align: center; padding: 18px 0 6px; }
.rec-result-time { font-family: var(--font-display); font-size: 3rem; font-weight: 700; color: var(--primary-deep); }
.rec-result p { color: var(--ink-soft); font-weight: 700; margin: 8px 0 18px; }
.rec-result .btn { margin: 0 6px 8px; }
.rec-fallback { margin-top: 22px; border-top: 1px solid var(--bg-soft); padding-top: 14px; }
.rec-fallback summary { color: var(--ink-soft); font-weight: 700; cursor: pointer; font-size: .9rem; }

/* ---- Winner picker ---- */
.winner-pick { margin-bottom: 22px; border-bottom: 1px solid var(--bg-soft); padding-bottom: 18px; text-align: center; }
.winner-pick h3 { margin-bottom: 4px; }
.winner-chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.winner-chips .chip { font-size: 1rem; padding: 12px 22px; }
.winner-chips .chip.on { background: var(--grad); color: #fff; border-color: transparent; }

/* ---- Upload zone / pills ---- */
.upload-zone {
  border: 2px dashed var(--mist); border-radius: 18px; padding: 22px; text-align: center;
  color: var(--ink-soft); font-weight: 700; background: var(--bg); margin-bottom: 20px;
}
.upload-zone .ic { font-size: 1.8rem; display: block; margin-bottom: 6px; }
.pill-note {
  display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft);
  color: var(--primary-deep); font-weight: 800; font-size: .88rem; padding: 8px 16px; border-radius: 99px;
}

/* ---- Points card ---- */
.points-card { background: var(--grad); color: #fff; border-radius: 28px; padding: 36px; box-shadow: var(--shadow); }
.points-card .big { font-family: var(--font-display); font-size: 3.2rem; font-weight: 700; }
.points-card p { opacity: .92; font-weight: 600; }
.points-card .barbg { background: rgba(255,255,255,.3); border-radius: 99px; height: 12px; margin: 18px 0 8px; }
.points-card .bar { background: #fff; border-radius: 99px; height: 12px; }

/* ---- Fun stats chart (benefits page) ---- */
.fun-chart { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 28px; }
.fun-bar { margin-bottom: 18px; }
.fun-bar:last-child { margin-bottom: 0; }
.fun-label { font-weight: 800; font-size: .95rem; margin-bottom: 6px; }
.fun-track { background: var(--bg-soft); border-radius: 99px; height: 34px; overflow: hidden; }
.fun-fill {
  background: var(--grad); color: #fff; height: 100%; border-radius: 99px;
  display: flex; align-items: center; justify-content: flex-end; padding-right: 14px;
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  min-width: 70px;
}
.fun-chart:not(.inview) .fun-fill { width: 0 !important; min-width: 0; overflow: hidden; }
.fun-chart.inview .fun-fill { animation: fungrow 1.2s cubic-bezier(.2,.8,.2,1) both; }
.fun-fill.down { background: var(--accent); }
@keyframes fungrow { from { width: 0; } }
.fun-caveat { margin-top: 18px; color: var(--ink-soft); font-size: .78rem; font-style: italic; }
.burger-wrap { position: absolute; top: 0; right: 24px; }
.burger {
  width: 46px; height: 46px; border-radius: 14px; border: 2px solid var(--mist);
  background: var(--card); color: var(--ink); font-size: 1.25rem;
  box-shadow: var(--shadow);
}
.burger-menu {
  position: absolute; right: 0; top: 54px; z-index: 70; min-width: 210px;
  background: var(--card); border-radius: 16px; box-shadow: 0 14px 40px rgba(0,0,0,.16);
  padding: 8px; border: 1px solid var(--mist);
}
.burger-menu a {
  display: block; padding: 12px 16px; border-radius: 10px;
  font-weight: 800; color: var(--ink); text-decoration: none;
}
.burger-menu a:hover { background: var(--bg-soft); }

/* ---- Footer ---- */
footer { background: var(--ink); color: var(--bg-soft); padding: 44px 0; }
footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
footer small { opacity: .7; }
footer .logo { color: #fff; }

/* ---- Mobile bottom tab bar (hidden on desktop) ---- */
.tabbar { display: none; }

/* ============================================================
   MOBILE — the primary target. App-like layout under 800px.
   ============================================================ */
@media (max-width: 800px) {
  /* Top bar: logo + points only; navigation moves to the bottom tab bar */
  .nav-links, .nav-inner > .btn { display: none; }
  .nav-inner { padding: 10px 16px; }
  .logo { font-size: 1.3rem; }

  /* Bottom tab bar — fixed, thumb-friendly */
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: var(--card); border-top: 1px solid var(--mist);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgba(0,0,0,.06);
  }
  .tabbar a {
    flex: 1; display: flex; align-items: center; justify-content: center;
    font-size: .95rem; font-weight: 800; color: var(--ink-soft); text-decoration: none;
    padding: 14px 0; border-radius: 14px;
  }
  .tabbar a.on { color: var(--primary-deep); background: var(--accent-soft); }
  body { padding-bottom: 84px; }
  footer { margin-bottom: 0; padding-bottom: 100px; }

  /* Layout: everything stacks */
  .wrap { padding: 0 18px; }
  .hero { padding: 40px 0 16px; }
  .hero-grid, .record-grid, .auth-wrap { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .hero p.lead { font-size: 1.05rem; }
  .hero-cta .btn { flex: 1 1 100%; }
  .steps { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
  .page-head { padding: 32px 0 26px; }
  .page-head h1 { font-size: 1.8rem; }
  .stats-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 24px 18px 36px; }
  .stat { min-width: 0; padding: 16px 18px; }
  .stat .num { font-size: 1.5rem; }
  .panel { padding: 22px 18px; border-radius: 20px; }

  /* Leaderboard: rank · lummers · hum */
  .row { grid-template-columns: 44px 1.5fr .9fr; gap: 10px; padding: 14px 16px; }
  .board-table.alltime .row { grid-template-columns: 44px 1.5fr .9fr 46px; }
  .row .pts { display: none; }
  .dur { text-align: right; font-size: 1.05rem; }
  .row.head { font-size: .7rem; }
  .row.head div:last-of-type { text-align: right; }

  /* Leaderboard filters stack on mobile */
  .board-filters select, .board-filters input[type="search"] { width: 100%; min-width: 0; font-size: 16px; }
  .board-filters .btn { width: 100%; }

  /* Forms & buttons: touch-friendly */
  .btn { padding: 14px 24px; }
  .btn.big { width: 100%; }
  .field input, .field select { font-size: 16px; padding: 14px 16px; } /* 16px stops iOS auto-zoom */
  .chips .chip, .gchip { padding: 11px 18px; }
  .gchip { flex: 1 1 45%; }
  .timer-ring { width: 230px; height: 230px; }
  .timer-ring .inner { width: 196px; height: 196px; }
  .timer-ring .t { font-size: 2.5rem; }
  .rec-result-time { font-size: 2.4rem; }
  .rec-result .btn { width: 100%; margin: 0 0 10px; }
  .flash { margin: 12px 18px 0; }

  footer .wrap { flex-direction: column; text-align: center; gap: 8px; }
}

/* Very narrow phones */
@media (max-width: 380px) {
  .hero h1 { font-size: 1.9rem; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .tabbar a { font-size: .68rem; }
}
