/* =========================================================
   Rundown — Coaches Corner: corner.css
   Binds docs/21: 70% cream / 20% forest / 8% gold. Bebas
   all-caps headers, Inter body, JetBrains Mono timers with
   tabular-nums. Gold reserved for the focus chip, the active
   run block ring, and the "plan built" flash (under the 10%
   ceiling). Tokens come from ../tokens.css.
   ========================================================= */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--rd-body);
  background: var(--rd-cream);
  color: var(--rd-near-black);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- nav chrome (brand §7.7) ----------
   index.html sets viewport-fit=cover, so this bar draws to the physical
   top of the glass. Measured by phone-layout-gate 2026-08-05: the brand
   lockup, Sound on and The Game all sat inside the 47px status-bar band
   at 390x844 - under the clock, the 5G indicator and the battery. The
   bar still bleeds behind the notch (that is the point of cover); only
   its CONTENT is pushed clear. */
.chrome {
  background: var(--rd-cream);
  border-bottom: 1px solid var(--rd-cream-2);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: calc(12px + env(safe-area-inset-top, 0px))
           calc(20px + env(safe-area-inset-right, 0px))
           12px
           calc(20px + env(safe-area-inset-left, 0px));
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--rd-forest);
  text-decoration: none;
}
.chrome-spacer { margin-left: auto; }
.chrome-btn {
  font-family: var(--rd-body);
  font-size: 13px;
  color: var(--rd-forest);
  background: var(--rd-cream);
  border: 1.5px solid var(--rd-forest);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
}
.chrome-btn:hover { background: var(--rd-cream-2); }

main {
  max-width: 720px; margin: 0 auto;
  /* landscape puts the display cutout in a side gutter; without this the
     plan text and the chip rows run under it (measured at 844x390) */
  padding: 24px calc(18px + env(safe-area-inset-right, 0px))
           calc(80px + env(safe-area-inset-bottom, 0px))
           calc(18px + env(safe-area-inset-left, 0px));
}

/* ---------- headings ---------- */
.eyebrow {
  font-family: var(--rd-body);
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--rd-cool-gray); margin: 0 0 6px;
}
h1 {
  font-family: var(--rd-display); font-weight: 400;
  font-size: 48px; line-height: 1.0; letter-spacing: 0.02em;
  color: var(--rd-forest); margin: 0 0 8px;
}
h2 {
  font-family: var(--rd-display); font-weight: 400;
  font-size: 28px; letter-spacing: 0.02em; color: var(--rd-forest); margin: 0 0 10px;
}
.lede { font-size: 18px; font-weight: 500; color: var(--rd-near-black); margin: 0 0 24px; }
.muted { color: var(--rd-cool-gray); }

/* ---------- cards ---------- */
.card {
  background: var(--rd-cream);
  border: 1.5px solid var(--rd-forest);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}
.card-strip {
  background: var(--rd-forest);
  color: var(--rd-cream);
  font-family: var(--rd-mono);
  font-size: 11px; letter-spacing: 0.06em;
  padding: 7px 14px; border-radius: 8px 8px 0 0; margin: -20px -20px 16px;
}

/* ---------- Team Read ---------- */
.readboard { list-style: none; margin: 0 0 10px; padding: 0; }
.readrow {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px; background: var(--rd-cream-2); margin-bottom: 8px;
  border: 1.5px solid transparent; cursor: pointer;
}
.readrow.selected { border-color: var(--rd-gold); background: var(--rd-cream); }
.readrow-cat {
  font-family: var(--rd-display); font-size: 22px; letter-spacing: 0.02em;
  color: var(--rd-forest); line-height: 1; flex: 1;
}
.readrow-receipt { font-size: 12px; color: var(--rd-cool-gray); flex: 2; }
.readrow-num { font-family: var(--rd-mono); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--rd-forest); }
.source-note { font-size: 12px; color: var(--rd-cool-gray); margin: 4px 0 0; }

/* ---------- constraint chips ---------- */
.constraint-group { margin-bottom: 16px; }
.constraint-label {
  font-family: var(--rd-body); font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--rd-cool-gray); margin: 0 0 8px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--rd-body); font-size: 14px; font-weight: 600;
  background: var(--rd-cream-2); color: var(--rd-near-black);
  border: 1.5px solid transparent; border-radius: 999px; padding: 8px 14px;
  cursor: pointer; user-select: none;
}
.chip.on { background: var(--rd-forest); color: var(--rd-cream); border-color: var(--rd-forest); }
/* focus chips carry the sanctioned gold accent */
.chip.focus-chip.on { background: var(--rd-forest); color: var(--rd-cream); border-color: var(--rd-gold); box-shadow: inset 0 -3px 0 var(--rd-gold); }

.stepper { display: inline-flex; align-items: center; gap: 14px; }
.stepper button {
  width: 38px; height: 38px; border-radius: 8px; border: 1.5px solid var(--rd-forest);
  background: var(--rd-cream); color: var(--rd-forest); font-size: 22px; line-height: 1; cursor: pointer;
  font-family: var(--rd-display);
}
.stepper .val { font-family: var(--rd-mono); font-weight: 700; font-size: 24px; min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--rd-display); font-size: 20px; letter-spacing: 0.04em;
  background: var(--rd-forest); color: var(--rd-cream);
  border: 1.5px solid var(--rd-forest); border-bottom: 3px solid var(--rd-gold);
  border-radius: 8px; padding: 12px 22px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--rd-forest-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.big { width: 100%; font-size: 26px; padding: 16px; }
.btn-ghost { background: var(--rd-cream); color: var(--rd-forest); border-bottom: 1.5px solid var(--rd-forest); }
.btn-ghost:hover { background: var(--rd-cream-2); }
.btn-sm { font-size: 15px; padding: 7px 12px; border-bottom-width: 2px; }

/* ---------- plan view ---------- */
.plan-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.plan-total { font-family: var(--rd-mono); font-weight: 700; font-size: 15px; color: var(--rd-forest); font-variant-numeric: tabular-nums; }

.block {
  background: var(--rd-cream); border: 1.5px solid var(--rd-forest); border-radius: 10px;
  margin-bottom: 12px; overflow: hidden;
}
.block-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--rd-forest); color: var(--rd-cream);
}
.block-phase {
  font-family: var(--rd-body); font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; opacity: 0.8;
}
.block-title { font-family: var(--rd-display); font-size: 24px; letter-spacing: 0.02em; line-height: 1; }
.block-min { margin-left: auto; font-family: var(--rd-mono); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.block-body { padding: 12px 14px; font-size: 14px; }
.block-body ul { margin: 6px 0 0; padding-left: 18px; }
.block-body li { margin-bottom: 4px; }
.rotation-line {
  font-family: var(--rd-mono); font-size: 13px; color: var(--rd-forest);
  background: var(--rd-cream-2); border-radius: 6px; padding: 6px 10px; margin: 0 0 10px;
  font-variant-numeric: tabular-nums;
}
.station {
  border: 1px solid var(--rd-border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--rd-cream);
}
.station-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.station-name { font-weight: 600; color: var(--rd-forest); }
.station-tag {
  /* 10px -> 11px: the phone legibility floor (L-FONT, 2026-08-05) */
  font-family: var(--rd-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; background: var(--rd-cream-2); color: var(--rd-cool-gray);
}
.station-tag.coached { background: var(--rd-forest); color: var(--rd-cream); }
.station-players { margin-left: auto; font-family: var(--rd-mono); font-size: 12px; color: var(--rd-cool-gray); }
.swap-row { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.swap-btn {
  font-family: var(--rd-body); font-size: 12px; background: var(--rd-cream-2); color: var(--rd-forest);
  border: 1px solid var(--rd-border); border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.swap-btn:hover { border-color: var(--rd-forest); }
.anim-slot {
  margin-top: 8px; border: 1px dashed var(--rd-border); border-radius: 6px;
  padding: 10px; font-size: 11px; color: var(--rd-cool-gray); text-align: center;
  font-family: var(--rd-mono); letter-spacing: 0.03em;
}

/* ---------- coach-terse drill cards ---------- */
.drill-name { margin: 6px 0 2px; font-weight: 700; color: var(--rd-forest); }
.drill-name .drill-cat { font-weight: 500; color: var(--rd-cool-gray); font-size: 12px; }
/* No truncation here on purpose: an over-budget line WRAPS visibly and
   the copy-budget check fails — clipped coaching copy is never OK. */
.drill-what { margin: 4px 0 2px; }
.drill-point { margin: 0 0 4px; font-weight: 600; color: var(--rd-forest); }
.repeat-tag {
  display: inline-block; font-family: var(--rd-mono); font-size: 10px; letter-spacing: 0.04em;
  text-transform: uppercase; background: var(--rd-forest); color: var(--rd-cream);
  border-radius: 4px; padding: 2px 6px; margin: 4px 0 2px;
}
.drill-more { margin: 2px 0 0; }
.drill-more summary {
  cursor: pointer; font-size: 12px; font-weight: 600; color: var(--rd-cool-gray);
  list-style-position: inside;
}
.drill-more summary:hover { color: var(--rd-forest); }
.drill-more[open] summary { margin-bottom: 4px; }
.drill-more .drill-setup { margin: 4px 0 8px; }

/* ---------- flags ---------- */
.flags { margin: 4px 0 16px; }
.flag {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 13px; padding: 10px 12px; border-radius: 8px; margin-bottom: 8px;
  background: var(--rd-cream-2); border-left: 4px solid var(--rd-cool-gray);
}
.flag.warn { border-left-color: var(--rd-gold-2); }
.flag.info { border-left-color: var(--rd-forest); }

/* ---------- close-the-loop ---------- */
.loop-card { background: var(--rd-forest); color: var(--rd-cream); border-color: var(--rd-forest); }
.loop-card h2 { color: var(--rd-cream); }
.loop-card .btn { background: var(--rd-gold); color: var(--rd-forest); border-color: var(--rd-gold); border-bottom-color: var(--rd-gold-2); }

/* ---------- plan-built flash (reduced-motion aware) ---------- */
@keyframes rd-flash { 0% { box-shadow: 0 0 0 3px var(--rd-gold); } 100% { box-shadow: 0 0 0 0 transparent; } }
.just-built { animation: rd-flash 0.5s ease-out 1; }
@media (prefers-reduced-motion: reduce) { .just-built { animation: none; } }

/* ============ WHITEBOARD RUN MODE ============ */
.run-mode {
  position: fixed; inset: 0; z-index: 100;
  background: var(--rd-forest); color: var(--rd-cream);
  display: none; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.run-mode.active { display: flex; }
.run-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.run-progress { font-family: var(--rd-mono); font-size: 13px; color: var(--rd-gold); letter-spacing: 0.05em; }
.run-exit {
  margin-left: auto; background: transparent; color: var(--rd-cream); border: 1.5px solid rgba(245,241,232,0.4);
  border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
/* min-height:0 is load-bearing. Without it this flex item refuses to
   shrink below its content, the column overruns the fixed .run-mode
   box, and the run controls fall off the bottom of the screen: clipped
   in portrait, gone entirely in landscape (measured 2026-08-05,
   phone-layout-gate L-OOB, 390x844 and 844x390). The block points
   scroll inside the body instead; Back / Pause / Next stay pinned. */
.run-body {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; align-items: center;
  /* "safe" so that when the block points overflow, the column starts at
     the top instead of centring and putting the first point above the
     scroll origin where it cannot be reached */
  justify-content: safe center;
  text-align: center; padding: 12px 20px 18px;
}
.run-phase {
  font-family: var(--rd-body); font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--rd-gold); margin-bottom: 6px;
}
.run-title {
  font-family: var(--rd-display); font-size: clamp(40px, 12vw, 96px); line-height: 0.95;
  letter-spacing: 0.02em; color: var(--rd-cream); margin: 0 0 4px; text-transform: uppercase;
}
.run-sub { font-family: var(--rd-body); font-size: clamp(15px, 4vw, 22px); color: rgba(245,241,232,0.85); margin: 0 0 16px; }

.ring-wrap { position: relative; width: min(58vw, 260px); height: min(58vw, 260px); margin: 8px 0 18px; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(245,241,232,0.18); stroke-width: 10; }
.ring-fill { fill: none; stroke: var(--rd-gold); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.9s linear; }
@media (prefers-reduced-motion: reduce) { .ring-fill { transition: none; } }
.ring-clock {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--rd-mono); font-weight: 700; font-size: clamp(42px, 14vw, 84px);
  color: var(--rd-cream); font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.ring-clock.low { color: var(--rd-gold); }

.run-points { max-width: 560px; text-align: left; margin: 0 auto; }
.run-points li { font-size: clamp(15px, 4vw, 20px); margin-bottom: 8px; color: rgba(245,241,232,0.92); }

/* .run-mode already pads the home-indicator inset on the whole layer;
   adding it again here charged the bottom of a 390px landscape screen
   twice for the same 21px. Flat padding, single count. */
.run-controls { display: flex; gap: 10px; padding: 16px 18px; flex-shrink: 0; }
.run-btn {
  flex: 1; font-family: var(--rd-display); font-size: 24px; letter-spacing: 0.03em;
  background: var(--rd-cream); color: var(--rd-forest); border: none; border-radius: 10px; padding: 16px; cursor: pointer;
}
.run-btn.pause { background: rgba(245,241,232,0.16); color: var(--rd-cream); }
.run-btn.gold { background: var(--rd-gold); color: var(--rd-forest); }
.run-hint { text-align: center; font-size: 12px; color: rgba(245,241,232,0.55); padding: 0 18px 8px; font-family: var(--rd-mono); }
.offline-badge {
  display: none; font-family: var(--rd-mono); font-size: 11px; color: var(--rd-gold);
  border: 1px solid rgba(244,196,48,0.5); border-radius: 4px; padding: 2px 6px; letter-spacing: 0.04em;
}
.offline-badge.show { display: inline-block; }

.hidden { display: none !important; }

@media (max-width: 520px) {
  h1 { font-size: 38px; }
  main { padding: 18px 14px 72px; }
  .card { padding: 16px; }
  .card-strip { margin: -16px -16px 14px; }
}

/* ---------- print: clipboard one-pager (docs/65 §2.5) ---------- */
@media print {
  .chrome, .run-mode, .constraint-group, .btn, .swap-row, .anim-slot, .chip-row, .loop-card, .no-print { display: none !important; }
  body { background: #fff; }
  .block, .card { break-inside: avoid; border-color: #000; }
  .block-head { background: #fff !important; color: #000 !important; border-bottom: 1.5px solid #000; }
  .block-min, .block-title { color: #000 !important; }
}
