/* ============================================================
   COACH KOFFI — 60-DAY RESET · FIGHT NIGHT
   Palette: charcoal #0b0b0d / signal red #ff3b1f / bone #f4f1ea.
   Type: Anton (display) + Inter (body). Dark, loud, no decoration.
   ============================================================ */
:root {
  --ink: #0b0b0d;
  --red: #ff3b1f;
  --bone: #f4f1ea;
  --muted: #8e8e93;
  --line: #2a2a2e;
  --card: #141417;
  --stripe: repeating-linear-gradient(-45deg, #ff3b1f 0 14px, #0b0b0d 14px 28px);
  --bw: 3px;
}

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

html { scroll-behavior: auto; }

body {
  font-family: "Inter", Helvetica, Arial, sans-serif;
  background: var(--ink);
  color: var(--bone);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film grain over everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 999; pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--red); color: var(--ink); }
a { color: var(--red); }

.anton { font-family: "Anton", "Arial Black", Impact, sans-serif; }

/* ---------- TOP BAR ---------- */
.topbar {
  background: var(--ink); color: var(--bone);
  border-bottom: var(--bw) solid var(--red);
  position: sticky; top: 0; z-index: 100;
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; letter-spacing: 1.5px;
}
.brand { font-family: "Anton", "Arial Black", sans-serif; font-size: 20px; letter-spacing: 1px; }
.brand-num { color: var(--red); }
.topbar-mid { color: var(--muted); }
.topbar-xp { border: 1px solid var(--red); color: var(--red); padding: 4px 10px; white-space: nowrap; font-weight: 800; }
.logout-btn {
  background: transparent; color: var(--bone); border: 1px solid var(--line);
  font-family: ui-monospace, monospace; font-size: 11px; letter-spacing: 1.5px;
  padding: 6px 12px; cursor: pointer;
}
.logout-btn:hover { border-color: var(--red); color: var(--red); }

/* ---------- NAV ---------- */
.mainnav {
  display: flex; border-bottom: var(--bw) solid var(--line);
  background: var(--ink); position: sticky; top: 45px; z-index: 90;
  overflow-x: auto;
}
.mainnav button {
  flex: 1 0 auto; background: var(--ink); color: var(--bone);
  border: none; border-right: 2px solid var(--line);
  font-family: "Anton", "Arial Black", sans-serif; font-size: 15px; letter-spacing: 1px;
  padding: 14px 18px; cursor: pointer; white-space: nowrap;
}
.mainnav button:last-child { border-right: none; }
.mainnav button .n-idx {
  font-family: ui-monospace, monospace; font-size: 10px; color: var(--muted);
  display: block; letter-spacing: 2px; margin-bottom: 2px;
}
.mainnav button:hover { background: var(--card); color: var(--red); }
.mainnav button.active { background: var(--red); color: var(--ink); }
.mainnav button.active .n-idx { color: var(--ink); }

/* ---------- LAYOUT ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }
.view { display: none; padding-top: 36px; }
.view.active { display: block; }

.kicker {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; letter-spacing: 2px; color: var(--red);
  border: 2px solid var(--red);
  padding: 5px 12px; margin-bottom: 18px; background: transparent;
  text-transform: uppercase; font-weight: 800;
}
.rule { height: 3px; background: var(--stripe); margin: 32px 0; }

h2.h-big, .mega {
  font-family: "Anton", "Arial Black", Impact, sans-serif;
  text-transform: uppercase; line-height: 0.95; letter-spacing: 0;
  color: var(--bone);
}
.mega { font-size: clamp(64px, 13vw, 170px); margin: 10px 0 20px; }
h2.h-big { font-size: clamp(40px, 7vw, 84px); margin-bottom: 14px; }
h3 { font-family: "Anton", "Arial Black", sans-serif; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.lede { font-size: 17px; max-width: 62ch; margin-bottom: 36px; font-weight: 600; }
.muted { color: var(--muted); }
.big-quote {
  font-family: "Anton", sans-serif; font-size: clamp(24px, 4vw, 40px);
  line-height: 1.15; text-transform: uppercase; color: var(--bone);
  border-left: 6px solid var(--red); padding-left: 20px; margin: 28px 0;
}

/* ---------- HERO ---------- */
.hero-block {
  border: var(--bw) solid var(--line); padding: 40px 32px; margin-bottom: 0;
  background: var(--card);
  background-image: repeating-linear-gradient(0deg, transparent, transparent 26px, rgba(255,59,31,0.03) 26px, rgba(255,59,31,0.03) 28px);
}
.hero-sub { font-family: "Anton", sans-serif; font-size: clamp(15px, 2.4vw, 22px); margin: 6px 0 28px; max-width: 40ch; text-transform: uppercase; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-block; background: var(--red); color: var(--ink);
  border: var(--bw) solid var(--red);
  font-family: "Anton", "Arial Black", sans-serif; font-size: 16px; letter-spacing: 1px;
  padding: 14px 26px; cursor: pointer; text-transform: uppercase; text-decoration: none;
}
.btn:hover { background: var(--bone); border-color: var(--bone); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-inv { background: transparent; color: var(--red); border-color: var(--red); }
.btn-inv:hover { background: var(--red); color: var(--ink); }
.btn-big { font-size: 20px; padding: 18px 34px; width: 100%; text-align: center; }
.link-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-family: ui-monospace, monospace; font-size: 12px; letter-spacing: 1.5px;
  text-decoration: underline; margin-top: 14px; display: block;
}
.link-btn:hover { color: var(--red); }

/* ---------- PANELS / CARDS ---------- */
.panel {
  border: var(--bw) solid var(--line); background: var(--card);
  padding: 28px; margin-bottom: 20px;
}
.panel.wide { grid-column: 1 / -1; }
.panel.stat { text-align: center; }
.panel.locked { opacity: 0.75; border-style: dashed; }
.idx {
  font-family: "Anton", sans-serif; font-size: 40px; color: var(--red);
  line-height: 1; margin-bottom: 8px;
}
.tag {
  display: inline-block; font-family: ui-monospace, monospace; font-size: 10px;
  letter-spacing: 2px; background: var(--red); color: var(--ink);
  padding: 3px 10px; margin-left: 10px; vertical-align: middle; font-weight: 800;
}
.cues { list-style: none; margin: 12px 0; }
.cues li { padding: 8px 0 8px 22px; border-top: 1px solid var(--line); position: relative; }
.cues li::before { content: "▸"; color: var(--red); position: absolute; left: 4px; font-weight: 800; }

/* ---------- GRIDS ---------- */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 18px; margin-bottom: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; margin: 20px 0; }
.day-cell {
  aspect-ratio: 1; border: 2px solid var(--line); background: var(--card);
  color: var(--bone); font-family: "Anton", sans-serif; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.day-cell:hover { border-color: var(--red); }
.day-cell.done { background: var(--red); color: var(--ink); border-color: var(--red); }
.day-cell.today { outline: 2px solid var(--bone); outline-offset: 2px; }
.day-cell.rest { opacity: 0.45; }
.day-meta { text-align: center; margin-top: 4px; }
.day-name { font-family: ui-monospace, monospace; font-size: 10px; color: var(--muted); letter-spacing: 1px; }

/* ---------- FORMS ---------- */
.fld {
  width: 100%; background: var(--ink); border: 2px solid var(--line); color: var(--bone);
  font-family: "Inter", sans-serif; font-size: 16px; padding: 12px 14px; margin: 6px 0 16px;
}
.fld:focus { outline: none; border-color: var(--red); }
.fld-label {
  display: block; font-family: ui-monospace, monospace; font-size: 11px;
  letter-spacing: 2px; color: var(--muted); margin-top: 8px;
}
textarea.fld { resize: vertical; }
.search-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.search-row .fld { margin-bottom: 0; }

/* ---------- TABLES ---------- */
.table-wrap { overflow-x: auto; margin: 16px 0; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table th {
  font-family: ui-monospace, monospace; font-size: 11px; letter-spacing: 2px;
  text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--red); color: var(--red);
}
.spec-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); }

/* ---------- TABS / PICKERS ---------- */
.tab-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.track-btn, .tbtn {
  background: transparent; border: 2px solid var(--line); color: var(--bone);
  font-family: "Anton", sans-serif; font-size: 14px; letter-spacing: 1px;
  padding: 10px 18px; cursor: pointer; text-transform: uppercase;
}
.track-btn:hover, .tbtn:hover { border-color: var(--red); color: var(--red); }
.track-btn.active, .tbtn.active { background: var(--red); border-color: var(--red); color: var(--ink); }
.tbtn-stop { border-color: var(--red); color: var(--red); }
.phase-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 20px 0; }
.phase-name { font-family: "Anton", sans-serif; font-size: 22px; }
.track-pick { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.ob-pick { cursor: pointer; text-align: left; width: 100%; color: var(--bone); font-family: inherit; font-size: inherit; }
.ob-pick:hover { border-color: var(--red); }
.ob-pick.active { border-color: var(--red); background: #1d0f0c; }
.ob-dots { display: flex; gap: 8px; margin-bottom: 24px; }
.ob-dots span { width: 34px; height: 6px; background: var(--line); }
.ob-dots span.on { background: var(--red); }
.ob-nav { display: flex; gap: 12px; margin-top: 24px; }

/* ---------- WORKOUT DAY ---------- */
.wo-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; }
.wo-title { font-family: "Anton", sans-serif; font-size: clamp(48px, 8vw, 96px); line-height: 0.95; }
.wo-focus { font-family: ui-monospace, monospace; font-size: 13px; letter-spacing: 2px; color: var(--red); margin-top: 8px; }
.wo-note { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 60ch; }
.ex-card { border: var(--bw) solid var(--line); background: var(--card); margin-bottom: 18px; }
.ex-head { display: flex; align-items: baseline; gap: 14px; padding: 18px 18px 0; }
.ex-idx { font-family: "Anton", sans-serif; font-size: 28px; color: var(--red); }
.ex-head h4 { font-family: "Anton", sans-serif; font-size: 20px; letter-spacing: 0.5px; flex: 1; }
.ex-info {
  background: transparent; border: 2px solid var(--line); color: var(--bone);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 16px; flex: none;
}
.ex-info:hover { border-color: var(--red); color: var(--red); }
.ex-spec { padding: 6px 18px 12px; font-family: ui-monospace, monospace; font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; padding: 0 18px 18px; }
.set-cell { display: flex; gap: 8px; align-items: center; }
.set-box {
  width: 44px; height: 44px; background: var(--ink); border: 2px solid var(--line);
  color: var(--bone); font-family: "Anton", sans-serif; font-size: 16px; cursor: pointer; flex: none;
}
.set-box.done { background: var(--red); border-color: var(--red); color: var(--ink); }
.wt-input {
  width: 100%; background: var(--ink); border: 2px solid var(--line); color: var(--bone);
  font-size: 15px; padding: 10px; font-family: ui-monospace, monospace;
}
.wt-input:focus { outline: none; border-color: var(--red); }
.ot-line {
  margin: 0 18px 16px; padding: 12px 14px; border-left: 4px solid var(--red);
  background: #1d0f0c; font-size: 14px;
}

/* ---------- TIMER ---------- */
.timer-box { border: var(--bw) solid var(--line); background: var(--card); padding: 20px; margin: 20px 0; text-align: center; }
.timer-read { font-family: "Anton", sans-serif; font-size: 56px; color: var(--bone); }
.timer-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* ---------- CHECK-IN / RITUAL ---------- */
.log-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.xp-bar { height: 10px; background: var(--line); margin: 8px 0; }
.xp-fill { height: 100%; background: var(--stripe); }

/* ---------- MODALS ---------- */
.modal-ov {
  position: fixed; inset: 0; z-index: 500; background: rgba(11,11,13,0.88);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: var(--card); border: var(--bw) solid var(--red);
  max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 32px;
}
.modal-card h3 { font-size: 26px; margin: 8px 0 12px; }

/* ---------- AUTH GATE ---------- */
.auth-gate {
  position: fixed; inset: 0; z-index: 600; background: rgba(11,11,13,0.94);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.auth-gate.show { display: flex; }
.auth-card {
  background: var(--card); border: var(--bw) solid var(--red);
  max-width: 480px; width: 100%; padding: 36px; position: relative;
  max-height: 92vh; overflow-y: auto;
}
.auth-close {
  position: absolute; top: 12px; right: 12px; background: none; border: none;
  color: var(--muted); font-size: 20px; cursor: pointer;
}
.auth-close:hover { color: var(--red); }
.auth-err { color: var(--red); font-size: 13px; min-height: 20px; margin: 8px 0; font-weight: 700; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--red); color: var(--ink); font-family: "Anton", sans-serif;
  font-size: 16px; letter-spacing: 1px; padding: 14px 28px; z-index: 700;
  display: none; text-transform: uppercase; max-width: 92vw; text-align: center;
}
.toast.show { display: block; }

/* ---------- FOOTER ---------- */
.footer { border-top: var(--bw) solid var(--line); margin-top: 60px; }
.footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 24px 20px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-family: ui-monospace, monospace; font-size: 11px; letter-spacing: 2px; color: var(--muted);
}

/* ---------- MARKETING ---------- */
.marquee { overflow: hidden; border-top: 3px solid var(--red); border-bottom: 3px solid var(--red); margin: 32px 0; }
.marquee-inner {
  display: inline-block; white-space: nowrap; padding: 12px 0;
  font-family: "Anton", sans-serif; font-size: 22px; letter-spacing: 2px; color: var(--red);
  animation: marq 22s linear infinite;
}
@keyframes marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.primer { border: var(--bw) solid var(--line); background: var(--card); padding: 28px; margin-bottom: 16px; }
.primer-body { margin-top: 12px; }
.ref-code {
  font-family: ui-monospace, monospace; font-size: 28px; letter-spacing: 4px;
  color: var(--red); border: 2px dashed var(--red); padding: 12px 20px;
  display: inline-block; margin: 12px 0;
}

/* ---------- MISC ---------- */
.fuel-frame { width: 100%; border: 0; min-height: 75vh; background: #0b0b0d; display: block; }
details.primer summary { cursor: pointer; font-family: "Anton", sans-serif; font-size: 18px; text-transform: uppercase; }
details.primer summary:hover { color: var(--red); }
iframe { max-width: 100%; }

@media (max-width: 640px) {
  .topbar-inner { font-size: 10px; padding: 8px 12px; }
  .mainnav button { font-size: 12px; padding: 12px 10px; }
  main { padding: 0 12px 60px; }
  .panel { padding: 20px; }
  .hero-block { padding: 28px 20px; }
  .btn-big { font-size: 17px; padding: 16px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-inner { animation: none; }
}

/* ---------- WORKOUT PICKER — flip cards ---------- */
#woGrid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { #woGrid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { #woGrid { grid-template-columns: repeat(4, 1fr); } }
.flip { perspective: 1000px; min-height: 220px; cursor: pointer; }
.flip:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.flip-inner { position: relative; width: 100%; height: 100%; min-height: 220px; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; transition: transform .5s cubic-bezier(.25,.8,.35,1); }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--card); border: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; overflow: hidden; }
.flip-face::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--stripe); }
.flip-front { align-items: center; justify-content: center; text-align: center; }
.flip-emoji { font-size: 32px; line-height: 1; margin-bottom: 8px; }
.flip-front h3 { font-size: 16px; letter-spacing: .03em; line-height: 1.2; }
.flip-tag { color: var(--muted); font-size: 12px; margin-top: 6px; }
.flip-lvl { margin-top: 10px; font-size: 10px; font-weight: 800; letter-spacing: .16em; color: var(--red); border: 1px solid var(--red); padding: 5px 10px; text-transform: uppercase; white-space: nowrap; }
.flip-hint { margin-top: auto; padding-top: 12px; font-size: 10px; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; }
.flip-back { transform: rotateY(180deg); }
.flip-why { font-size: 13px; color: var(--muted); font-style: italic; line-height: 1.55; margin: 2px 0 10px; }
.flip-specs { font-size: 11px; color: var(--muted); line-height: 1.7; }
.flip-specs b { color: var(--bone); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.flip-view { margin-top: auto; min-height: 44px; display: flex; align-items: center; font-family: "Anton", sans-serif; font-size: 13px; letter-spacing: .18em; color: var(--red); text-transform: uppercase; }
@media (prefers-reduced-motion: reduce) { .flip-inner { transition: none; } }
@media (max-width: 640px) {
  .flip { min-height: 216px; }
  .flip-inner { min-height: 216px; }
  .flip-front h3 { font-size: 14px; }
  .flip-emoji { font-size: 28px; }
}

/* ---------- LANE CARDS ---------- */
.lane-grid { display: grid; gap: 10px; grid-template-columns: 1fr; margin-top: 6px; }
@media (min-width: 720px) { .lane-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .lane-grid { grid-template-columns: 1fr 1fr 1fr; } }
.lane-card { border: 2px solid var(--line); padding: 16px; cursor: pointer; background: var(--card); min-height: 48px; text-align: left; color: var(--bone); font-family: inherit; }
.lane-card b { display: block; font-size: 16px; }
.lane-card span { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.lane-card .lane-detail { display: none; font-size: 13px; color: var(--bone); font-style: normal; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); line-height: 1.55; }
.lane-card.sel { border-color: var(--red); background: #1a1210; }
.lane-card.sel .lane-detail { display: block; }
.lane-card:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ---------- CEREMONY MODALS (rank-ups, streak milestones) ---------- */
.ceremony-card { text-align: center; padding: 52px 26px; }
.ceremony-card .cer-emoji { font-size: 56px; }
.ceremony-card h2 { font-size: clamp(38px, 8vw, 64px); margin: 14px 0 10px; font-family: "Anton", sans-serif; }
.ceremony-card h2 .red { color: var(--red); }
.ceremony-card p { color: var(--muted); font-size: 16px; max-width: 440px; margin: 0 auto 24px; }

/* ---------- MISC (lock-in) ---------- */
.linklike { background: none; border: none; color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; text-decoration: underline; padding: 12px 6px; min-height: 44px; font-family: "Inter", sans-serif; }
.linklike:hover { color: var(--red); }
.checkline { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; font-size: 14px; }
.checkline input { width: 22px; height: 22px; accent-color: var(--red); }

/* FluentFuel fullscreen expand (fc-expand) — unbranded chrome */
iframe.ff-fuel-expanded{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;z-index:99990!important;border:0!important;border-radius:0!important;}
#ff-fuel-collapse{position:fixed;top:10px;right:10px;z-index:99999;width:48px;height:48px;border-radius:50%;border:0;background:rgba(20,20,20,.85);color:#fff;font-size:20px;line-height:1;cursor:pointer;}
