/* Look: reference 17 (XFIT Kids). Navy, coral and pink on a lavender canvas. */
:root {
  --canvas: #eaeaf6;
  --surface: #ffffff;
  --surface-2: #f4f4fb;
  --ink: #12163a;
  --muted: #5a5f80;
  --line: #dcdcef;
  --navy: #0f276d;
  --navy-2: #1b3a8f;
  --coral: #f0564c;       /* fills and marks */
  --coral-strong: #d63c31; /* buttons and text on white (4.6:1) */
  --pink: #ffa49f;
  --pink-soft: #ffe3e0;
  --good: #1f8a4c;
  --radius: 22px;
  --shadow: 0 1px 0 rgba(15, 39, 109, .06), 0 8px 24px -14px rgba(15, 39, 109, .25);
  --display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --body: 'Figtree', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.45 var(--body);
  min-height: 100vh;
}
body.modal-open { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.1; }
:focus-visible { outline: 3px solid var(--coral-strong); outline-offset: 2px; }
svg { display: block; }

.loading { display: grid; place-items: center; min-height: 80vh; font-family: var(--display); font-size: 1.4rem; color: var(--navy); }

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2));
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.25rem; margin-right: auto; }
.team-name { font-family: var(--body, inherit); font-weight: 600; font-size: .85rem; color: var(--muted); padding-left: 10px; border-left: 2px solid var(--line); }
.gate { max-width: 560px; margin: 8vh auto 0; padding: 0 16px; }
.gate .hero p { margin: 0 0 14px; }
.foot .link-btn { font-size: inherit; margin-left: 6px; }
a.brand { color: inherit; text-decoration: none; }
.start-card h1 { margin: 0 0 8px; font-size: 1.6rem; line-height: 1.15; color: var(--navy); }
.start-card .hero-sub { margin: 0 0 6px; color: var(--muted); }
.start-card .form { margin-top: 8px; }
.start-card .form .muted.small { margin: -4px 0 4px; }
.link-field { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.link-field:focus-within { border-color: var(--navy); background: #fff; }
.link-prefix { display: flex; align-items: center; padding: 0 4px 0 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.link-field input { border: 0 !important; background: transparent !important; min-width: 0; flex: 1; padding-left: 0 !important; }
.plan-card h2, .invite-card h2 { margin: 0 0 6px; font-size: 1.05rem; }
.plan-card p, .invite-card p { margin: 0 0 8px; }
.plan-card.ended { border-left: 5px solid var(--coral); }
.invite-card { border-left: 5px solid var(--navy); }
.invite-link { font-weight: 600; word-break: break-all; color: var(--navy); }
.plan-opts { display: grid; gap: 10px; }
.plan-opt { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.plan-opt.is-picked { border-color: var(--navy); background: #fff; }
.plan-opt input { width: 20px; height: 20px; accent-color: var(--navy); flex: none; }
.plan-opt span { display: grid; gap: 2px; }
.plan-opt small { color: var(--muted); }
.plan-practice { background: #fff4d6; color: #6b4b00; border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: .9rem; }
.plan-card .pill { margin-top: 4px; }
.plan-card a { color: var(--navy); font-weight: 600; }
.logo { width: 34px; height: 34px; }
.round-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12);
  font-size: .9rem; white-space: nowrap;
}
.round-chip svg { width: 16px; height: 16px; color: var(--pink); }
.round-chip b { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--pink); }
.me-btn { display: flex; align-items: center; gap: 8px; border: 0; background: rgba(255, 255, 255, .12); border-radius: 999px; padding: 4px 14px 4px 4px; color: #fff; font-weight: 600; }

/* ---------- Layout ---------- */
.layout {
  display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  max-width: 1180px; margin: 0 auto; padding: 20px 16px 8px; align-items: start;
}
.col { display: grid; gap: 20px; min-width: 0; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 16px 16px 32px; }

.card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { font-size: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { color: var(--muted); padding: 12px 0; margin: 0; }

/* ---------- Avatars ---------- */
.av { display: inline-block; flex: none; border-radius: 50%; overflow: hidden; position: relative; }
.av svg { width: 100%; height: 100%; }
.av-sm { width: 40px; height: 40px; }
.av-md { width: 56px; height: 56px; }
.av-lg { width: 76px; height: 76px; }
.av-xl { width: 112px; height: 112px; }

/* ---------- Buttons ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 700; font-size: 1rem;
}
.pill svg { width: 18px; height: 18px; }
.pill-coral { background: var(--coral-strong); color: #fff; }
.pill-coral:hover:not(:disabled) { background: #c23328; }
.pill-dark { background: #fff; color: var(--navy); }
.pill-light { background: var(--surface-2); color: var(--navy); border: 1px solid var(--line); }
.pill-big { padding: 16px 28px; font-size: 1.15rem; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--navy); }
.icon-btn svg { width: 20px; height: 20px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.link-btn svg { width: 18px; height: 18px; }
.link-btn.danger { color: var(--coral-strong); }

/* ---------- Hero ---------- */
.hero { background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.hero::after { /* a big soft pink disc in the corner */
  content: ''; position: absolute; right: -70px; top: -70px; width: 200px; height: 200px; border-radius: 50%;
  background: var(--pink); opacity: .16; pointer-events: none;
}
.hero h1 { font-size: 1.9rem; font-weight: 800; }
.hero-sub { margin: 8px 0 18px; color: #d6dcf5; }
.hero-top { display: flex; align-items: center; gap: 16px; }
.hero-top .av { box-shadow: 0 0 0 4px rgba(255, 255, 255, .15); }
.hero-status { margin-top: 6px; color: #d6dcf5; }
.hero-status.done { display: flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; }
.hero-status.done svg { width: 20px; height: 20px; color: #7ee0a4; flex: none; }
.hero-action { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0 6px; }
.hero-action .pill-big { flex: 1 1 200px; }
.stepper { display: flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .1); border-radius: 999px; padding: 4px; }
.stepper .icon-btn { background: rgba(255, 255, 255, .14); color: #fff; }
.stepper output { min-width: 96px; text-align: center; color: #d6dcf5; }
.stepper output b { font-family: var(--display); font-size: 1.35rem; color: #fff; }
.hero .link-btn { color: #d6dcf5; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 0; }
.hero-stats div { background: rgba(255, 255, 255, .08); border-radius: 14px; padding: 10px 12px; }
.hero-stats dt { font-size: .78rem; color: #c3cbef; }
.hero-stats dd { margin: 2px 0 0; font-family: var(--display); font-weight: 800; font-size: 1.5rem; display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.streak svg { width: 20px; height: 20px; color: var(--pink); }

.roster-h { font-size: 1rem; font-family: var(--body); font-weight: 600; color: #d6dcf5; margin-bottom: 10px; }
.roster { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.roster-btn { display: grid; justify-items: center; gap: 6px; width: 84px; padding: 10px 4px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .08); color: #fff; font-size: .85rem; font-weight: 600; }
.roster-btn:hover { background: rgba(255, 255, 255, .16); }
.roster-btn span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- This hour ---------- */
.count-pill { background: var(--pink-soft); color: var(--navy); border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.progress span { display: block; height: 100%; background: var(--coral); border-radius: 999px; transition: width .4s; }
.hour-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.hour-grid button { position: relative; display: grid; justify-items: center; gap: 4px; width: 100%; padding: 6px 2px; border: 0; background: none; border-radius: 12px; }
.hour-grid button:hover { background: var(--surface-2); }
.hour-grid .av { width: 48px; height: 48px; }
.hour-grid .is-waiting .av { filter: grayscale(1); opacity: .45; }
.hour-grid .is-done .av { box-shadow: 0 0 0 3px var(--good); }
.tick { position: absolute; top: 2px; right: calc(50% - 30px); width: 20px; height: 20px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; border: 2px solid #fff; }
.tick svg { width: 12px; height: 12px; }
.hour-name { font-size: .78rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.is-done .hour-name { color: var(--ink); font-weight: 600; }

/* ---------- Fun facts ---------- */
.fact-card { background: var(--pink); color: var(--navy); }
.fact-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.fact-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; }
.fact-chip svg { width: 22px; height: 22px; }
.pill-navy { background: var(--navy); color: #fff; }
.pill-navy:hover { background: var(--navy-2); }
.fact-next { padding: 8px 14px; font-size: .85rem; }
.fact-lead { margin: 0 0 4px; font-weight: 600; }
.fact-text { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.35rem; line-height: 1.25; }
.fact-note { margin: 12px 0 0; font-size: .75rem; }

/* ---------- Home screen + reminders ---------- */
.nudge-card .card-head { margin-bottom: 10px; }
.nudge-card h2 { font-size: 1.1rem; }
.nudge-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.nudge-actions .pill { flex: 1 1 180px; }
.install h2 { margin-bottom: 14px; }
.steps { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 10px; }
.inline-icon { display: inline-block; width: 20px; height: 20px; vertical-align: -4px; color: #1a73e8; }
kbd { font: 600 .85rem var(--body); background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
.reminders { border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; margin: 0; display: grid; gap: 10px; }
.reminders legend { font-weight: 700; padding: 0 6px; }
.reminders p { margin: 0; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }
.field select { font: inherit; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); width: 100%; }

/* ---------- Leaderboard ---------- */
.tabs { display: flex; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.tab { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.tab.active { background: var(--ink); color: #fff; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; margin-bottom: 16px; }
.podium:has(> :only-child) { grid-template-columns: minmax(0, 220px); justify-content: center; }
.podium:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: center; }
.podium-card {
  position: relative; display: grid; justify-items: center; gap: 2px;
  border: 0; border-radius: 20px; padding: 18px 8px 14px; color: #fff; min-width: 0;
}
.podium-card .av { box-shadow: 0 0 0 4px rgba(255, 255, 255, .35); margin-bottom: 6px; }
.place-1 { background: var(--navy); padding-top: 30px; }
.place-2 { background: var(--coral-strong); }
.place-3 { background: var(--pink); color: var(--navy); }
.crown { position: absolute; top: 8px; width: 28px; height: 28px; color: #ffc001; }
.podium-rank { font-size: .8rem; font-weight: 700; opacity: .85; }
.podium-name { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-family: var(--display); font-weight: 800; font-size: 1.6rem; font-variant-numeric: tabular-nums; }

.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.board-list button {
  display: grid; grid-template-columns: 28px 40px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 14px; text-align: left;
}
.board-list button:hover { background: var(--surface-2); }
.board-list .is-me button { background: var(--pink-soft); }
.board-list .is-zero { opacity: .55; }
.rank { font-family: var(--display); font-weight: 800; font-size: 1.1rem; color: var(--navy); text-align: center; }
.who { display: grid; gap: 6px; min-width: 0; }
.name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name em { font-style: normal; font-size: .75rem; font-weight: 700; background: var(--navy); color: #fff; border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: 1px; }
.bar { display: block; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--coral); border-radius: 999px; }
.score { display: grid; justify-items: end; line-height: 1.1; }
.score b { font-family: var(--display); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.score small { color: var(--muted); font-size: .75rem; }
.streak-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--pink-soft); color: var(--coral-strong); border-radius: 999px; padding: 2px 8px 2px 6px; font-weight: 700; font-size: .8rem; }
.streak-chip svg { width: 14px; height: 14px; }
.streak-chip.big { font-size: .95rem; padding: 4px 12px 4px 8px; margin-top: 6px; }
.streak-chip.big svg { width: 18px; height: 18px; }

/* ---------- Stats ---------- */
.mini-h { font-family: var(--body); font-size: .85rem; font-weight: 600; color: var(--muted); margin: 6px 0 8px; }
.hour-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(30px, 1fr)); gap: 4px; }
.hc { height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: .78rem; font-weight: 600; }
.hc-hit { background: var(--coral); color: #fff; }
.hc-miss { background: var(--surface-2); color: var(--muted); }
.hc-now { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.hc-later { background: #fff; color: #9a9db8; box-shadow: inset 0 0 0 1.5px var(--line); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin: 8px 0 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 150px; align-items: end; }
.bar-col { position: relative; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; height: 100%; gap: 4px; outline-offset: 2px; border-radius: 8px; }
.bar-col .bar-fill { align-self: end; width: min(100%, 34px); background: var(--navy); border-radius: 6px 6px 2px 2px; }
.bar-col.is-today .bar-fill { background: var(--coral); }
.bar-val { font-size: .78rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; min-height: 1em; }
.bar-day { font-size: .78rem; color: var(--muted); }
.bar-col.is-today .bar-day { color: var(--ink); font-weight: 700; }
.bar-col:hover::after, .bar-col:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: .78rem; padding: 4px 8px; border-radius: 8px; white-space: nowrap; z-index: 2;
}

/* ---------- Modal ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(18, 22, 58, .55); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.sheet { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 26px; padding: 24px; animation: rise .2s; }
.sheet .card { box-shadow: none; padding: 0; margin-top: 18px; }
.sheet-close { position: absolute; top: 14px; right: 14px; }
.sheet h2 { font-size: 1.5rem; padding-right: 48px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

.player-head { display: flex; align-items: center; gap: 16px; }
.player-head p { margin: 4px 0 0; }

.signin { display: grid; justify-items: center; text-align: center; gap: 4px; }
.signin h2 { padding: 0; margin-top: 10px; }
.pin-dots { display: flex; gap: 14px; margin: 14px 0 4px; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--navy); }
.pin-dot.on { background: var(--navy); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; margin: 6px 0 12px; }
.pin-key { height: 60px; border-radius: 18px; border: 0; background: var(--surface-2); font-family: var(--display); font-size: 1.5rem; font-weight: 600; color: var(--navy); }
.pin-key:hover:not(:disabled) { background: var(--line); }
.form-error { color: var(--coral-strong); font-weight: 600; min-height: 1.4em; margin: 4px 0; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: .9rem; }
.field input { font: inherit; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); width: 100%; }
.field input:focus { border-color: var(--navy); outline: none; background: #fff; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.change-pin { border-top: 1px solid var(--line); padding-top: 12px; }
.change-pin summary { cursor: pointer; font-weight: 600; }
.change-pin .field-row { margin: 12px 0; }

.builder { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; background: var(--surface-2); border-radius: 18px; padding: 14px; }
.builder-preview { display: grid; gap: 10px; align-content: start; justify-items: center; }
.builder-preview > svg { width: 128px; height: 128px; }
.builder-preview .pill { padding: 8px 14px; font-size: .9rem; }
.builder-rows { display: grid; gap: 10px; min-width: 0; }
.builder-label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--line); padding: 0; }
.swatch.on { box-shadow: 0 0 0 3px var(--navy); }
.opt { width: 42px; height: 42px; border-radius: 50%; padding: 0; border: 2px solid transparent; background: none; overflow: hidden; }
.opt svg { width: 100%; height: 100%; }
.opt.on { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy); }

/* ---------- Celebration + toast ---------- */
#celebrate { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; pointer-events: none; }
#celebrate.show { display: grid; }
.celebrate-card { display: grid; justify-items: center; gap: 6px; background: var(--navy); color: #fff; padding: 26px 34px; border-radius: 28px; box-shadow: 0 24px 60px -20px rgba(15, 39, 109, .6); animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.celebrate-avatar { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; }
.celebrate-avatar .avatar-body { transform-origin: 60px 120px; animation: squat .45s ease-in-out 4; }
.celebrate-num { font-family: var(--display); font-weight: 800; font-size: 2.6rem; color: var(--pink); line-height: 1; margin-top: 6px; }
.celebrate-text { font-weight: 600; }
.celebrate-card { max-width: min(340px, calc(100vw - 32px)); text-align: center; }
.celebrate-fact { margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .18); font-size: .9rem; color: #d6dcf5; line-height: 1.4; }
.celebrate-fact b { color: #fff; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes squat { 50% { transform: translateY(14px) scaleY(.88); } }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); z-index: 70; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; opacity: 0; transition: .2s; pointer-events: none; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--coral-strong); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Phones ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  /* One column: put the leaderboard straight after "this hour". */
  .layout > .col { display: contents; }
  .layout .hero { order: 1; }
  .layout .recap-card { order: 2; }
  .layout .nudge-card { order: 3; }
  .layout .hour-card { order: 4; }
  .layout .latest-card { order: 5; }
  .layout .goal-card { order: 6; }
  .layout .board { order: 7; }
  .layout .fact-card { order: 8; }
  .layout .stats-card { order: 9; }
}
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .top { gap: 8px; }
  .brand span { display: none; }
  .me-btn { padding: 3px; }
  .card { padding: 16px; border-radius: 20px; }
  .hero h1 { font-size: 1.6rem; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-action .stepper { flex: 1 1 100%; justify-content: space-between; }
  .card-head { align-items: flex-start; }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 6px 4px; }
  .podium { gap: 6px; }
  .podium-card .av { width: 56px; height: 56px; }
  .podium-score { font-size: 1.3rem; }
  .board-list button { grid-template-columns: 22px 40px minmax(0, 1fr) auto; gap: 10px; padding: 8px 6px; }
  .board-list .meta { display: none; }
  .sheet { padding: 18px; border-radius: 22px; }
  .builder { grid-template-columns: minmax(0, 1fr); }
  .builder-preview { grid-template-columns: auto auto; align-items: center; justify-content: center; }
  .builder-preview > svg { width: 96px; height: 96px; }
  .field-row { grid-template-columns: 1fr; }
  .hour-strip { grid-template-columns: repeat(auto-fit, minmax(24px, 1fr)); gap: 3px; }
  .hc { height: 34px; border-radius: 8px; font-size: .74rem; }
  .podium-name { white-space: normal; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
}
.reminders .field-row { grid-template-columns: 1fr 1fr; }

/* ---------- Sharing to the team chat ---------- */
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; }
.pill-share { background: rgba(255, 255, 255, .14); color: #fff; padding: 9px 16px; font-size: .92rem; }
.pill-share:hover { background: rgba(255, 255, 255, .22); }
.copy-board { font-family: var(--body); font-size: .85rem; color: var(--muted); margin-left: 6px; vertical-align: 2px; padding: 2px 0; }
.copy-board svg { width: 15px; height: 15px; }
.share textarea { width: 100%; font: .95rem/1.45 var(--body); padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); resize: vertical; margin: 10px 0 12px; }

/* Celebration pop-up: clickable, with copy/share */
#celebrate .celebrate-card { pointer-events: auto; }
.celebrate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.celebrate-actions .pill { padding: 10px 18px; font-size: .95rem; }
.celebrate-done { color: #d6dcf5; font-size: .9rem; padding: 4px 8px; }
.celebrate-card { border: 3px solid var(--pink); }

/* PIN resets */
.admin-card { border: 2px solid var(--coral); }
.reset-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.reset-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface-2); border-radius: 14px; padding: 8px 10px; }
.reset-list .who { display: grid; flex: 1 1 140px; min-width: 0; }
.reset-list .pill { padding: 8px 14px; font-size: .9rem; }
.signin .link-btn { color: var(--navy); font-size: .9rem; }
@media (max-width: 860px) { .layout .admin-card { order: 0; } }

/* ---------- Badges ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.badges-card .link-btn { color: var(--navy); font-size: .9rem; margin-top: 10px; }
.badge-grid { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px 8px; }
.badge { display: grid; justify-items: center; align-content: start; gap: 2px; text-align: center; padding: 6px 2px; }
.badge .medal { width: 58px; height: 58px; margin-bottom: 4px; }
.badge-name { font-weight: 700; font-size: .88rem; line-height: 1.2; color: var(--navy); }
.badge-how { font-size: .76rem; line-height: 1.3; color: var(--muted); }
.badge.is-locked .badge-name { color: var(--muted); }

.medal-ring { fill: var(--pink); }
.medal-face { fill: var(--navy); }
.medal-ink { color: #fff; }
.medal-streak .medal-ring { fill: var(--pink); }
.medal-streak .medal-face { fill: var(--coral-strong); }
.medal-time .medal-ring { fill: var(--navy); }
.medal-time .medal-face { fill: var(--pink); }
.medal-time .medal-ink { color: var(--navy); }
.medal-team .medal-ring { fill: var(--coral); }
.medal-team .medal-face { fill: #c9d1f2; }
.medal-team .medal-ink { color: var(--navy); }
.badge-num-bg { fill: #fff; stroke: var(--navy); stroke-width: 1.5; }
.badge-num { fill: var(--navy); }
.medal-locked .medal-ring { fill: var(--line); }
.medal-locked .medal-face { fill: var(--surface-2); }
.medal-locked .medal-ink { color: #b4b7cf; }
.medal-locked .badge-num-bg { stroke: #b4b7cf; }
.medal-locked .badge-num { fill: #9a9dba; }
.medal-lock-bg { fill: var(--muted); }
.medal-lock { color: #fff; }

.player-badges { margin-top: 16px; }
.player-badges .mini-h .muted { font-family: var(--body); font-weight: 500; font-size: .85rem; margin-left: 4px; }

.celebrate-badges { display: grid; gap: 8px; width: 100%; margin-top: 8px; }
.celebrate-badge { display: flex; align-items: center; gap: 12px; text-align: left; background: rgba(255, 255, 255, .1); border-radius: 16px; padding: 8px 12px 8px 8px; animation: pop .4s .25s both cubic-bezier(.3, 1.6, .5, 1); }
.celebrate-badge .medal { width: 48px; height: 48px; flex: none; }
.celebrate-badge span { display: grid; line-height: 1.25; }
.celebrate-badge small { color: var(--pink); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.celebrate-badge b { font-family: var(--display); font-size: 1.05rem; }
.celebrate-badge em { font-style: normal; font-size: .82rem; color: #d6dcf5; }
.celebrate-badges > small { color: #d6dcf5; }
@media (max-width: 860px) { .layout .badges-card { order: 10; } }
@media (max-width: 560px) { .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .badge .medal { width: 52px; height: 52px; } }

/* ---------- Team goal ---------- */
.goal-card h2 { display: flex; align-items: center; gap: 8px; }
.goal-card h2 svg { width: 22px; height: 22px; color: var(--coral-strong); }
.goal-card .link-btn { color: var(--navy); font-size: .9rem; }
.goal-num { margin: 4px 0 10px; color: var(--muted); }
.goal-num b { font-family: var(--display); font-size: 2rem; color: var(--navy); margin-right: 4px; }
.goal-card .progress { height: 14px; margin-bottom: 10px; }
.goal-pace { margin: 0; font-weight: 600; color: var(--navy); }
.goal-card .muted.small { margin: 6px 0 0; }
.goal-card.is-reached { background: var(--navy); color: #fff; }
.goal-card.is-reached h2 svg, .goal-card.is-reached .goal-num b { color: var(--pink); }
.goal-card.is-reached .goal-num, .goal-card.is-reached .goal-pace, .goal-card.is-reached .muted, .goal-card.is-reached .link-btn { color: #fff; }
.goal-card.is-reached .progress { background: rgba(255, 255, 255, .15); }
.goal-card.is-reached .progress span { background: var(--pink); }
.celebrate-goal { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--coral-strong); border-radius: 16px; padding: 10px 14px; margin-top: 8px; font-size: .92rem; animation: pop .4s .2s both cubic-bezier(.3, 1.6, .5, 1); }
.celebrate-goal svg { width: 28px; height: 28px; flex: none; }

/* ---------- Last week's recap ---------- */
.recap-card { border: 2px solid var(--pink); }
.recap-champ { display: flex; align-items: center; gap: 14px; background: var(--pink-soft); border-radius: 18px; padding: 12px 14px; }
.recap-av { position: relative; }
.recap-av .crown { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; color: #f5b400; }
.recap-champ div { display: grid; line-height: 1.25; }
.recap-champ small { color: var(--coral-strong); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
.recap-champ b { font-family: var(--display); font-size: 1.4rem; color: var(--navy); }
.recap-champ span { color: var(--muted); font-size: .9rem; }
.recap-rest { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; padding-left: 22px; color: var(--muted); }
.recap-rest b { color: var(--ink); }
.recap-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.recap-stats div { background: var(--surface-2); border-radius: 14px; padding: 8px 10px; }
.recap-stats dt { font-size: .75rem; color: var(--muted); }
.recap-stats dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--navy); display: flex; align-items: center; gap: 4px; }
.recap-stats dd svg { width: 18px; height: 18px; color: var(--good); }
.recap-high { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: .92rem; }
.recap-high b { color: var(--navy); }
.recap-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; }
.recap-actions .pill { padding: 10px 18px; font-size: .95rem; }
.recap-actions svg, .pill-navy svg { width: 18px; height: 18px; }
.recap-actions .link-btn { color: var(--muted); font-size: .9rem; }
@media (max-width: 560px) { .recap-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- High-fives ---------- */
.latest-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.latest-list li { display: flex; align-items: center; gap: 8px; }
.latest-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; border: 0; background: none; padding: 6px 4px; border-radius: 14px; text-align: left; }
.latest-who:hover { background: var(--surface-2); }
.latest-who > span:last-child { display: grid; min-width: 0; line-height: 1.25; }
.latest-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest-who b em { font-style: normal; font-size: .72rem; font-weight: 700; background: var(--navy); color: #fff; border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.latest-who small { color: var(--muted); font-size: .82rem; }
.hf-btn { display: inline-flex; align-items: center; gap: 4px; min-width: 44px; height: 40px; justify-content: center; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--navy); font-weight: 700; font-size: .9rem; flex: none; }
.hf-btn svg { width: 20px; height: 20px; }
button.hf-btn:hover { border-color: var(--coral); }
.hf-btn.on { background: var(--coral-strong); border-color: var(--coral-strong); color: #fff; }
.hf-btn.on svg { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.hf-btn.is-static { border-color: transparent; background: var(--pink-soft); color: var(--coral-strong); }
.hero-hf { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .92rem; color: var(--pink); font-weight: 600; }
.hero-hf svg { width: 18px; height: 18px; flex: none; }

/* Share card sheet: a picture preview, then Share / Copy image / Save image / Copy text */
.share-card h2 { margin: 0 0 12px; }
.card-preview { display: grid; place-items: center; min-height: 220px; background: var(--canvas); border-radius: 16px; padding: 10px; margin-bottom: 14px; }
.card-preview img { display: block; width: 100%; max-width: 300px; height: auto; border-radius: 12px; box-shadow: 0 6px 18px rgba(15, 39, 109, .18); }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.share-actions .pill { flex: 1 1 140px; justify-content: center; text-decoration: none; }
.share-actions .pill-big { flex-basis: 100%; }
.share-actions svg, .pill-coral svg { width: 18px; height: 18px; }
.share-actions .pill { white-space: nowrap; }

/* Contact form */
.field textarea { font: inherit; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); width: 100%; resize: vertical; min-height: 120px; }
.field textarea:focus, .field select:focus { border-color: var(--navy); outline: none; background: #fff; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* A checkbox with a bold label and a hint under it (Team settings) */
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--coral-strong); flex: none; }
.check-row span { display: grid; gap: 2px; }
.check-row small { font-size: .85rem; line-height: 1.35; }

/* Staging copy label */
.test-site { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 90; background: #ffc93c; color: var(--navy); font: 700 .8rem/1 var(--body); padding: 7px 12px; border-radius: 999px; box-shadow: 0 2px 8px rgba(15, 39, 109, .2); pointer-events: none; }
