/* The Agent League — Backyard Sports theme */
/* Style dictionary source of truth: /STYLE.md */

:root {
  --cream:       #F4E9D0;
  --cream-warm:  #EFDDB8;
  --slate:       #2F3E3A;
  --mustard:     #E8B23B;
  --mustard-lt:  #F2CB6B;
  --brick:       #C24A34;
  --forest:      #3F7A4B;
  --forest-dk:   #2E5A38;
  --chalkblue:   #7BAECF;
  --ink:         #2A1F17;
  --kraft:       #B08655;
  --kraft-dk:    #8A6740;
  --shadow-chunky: 0 4px 0 var(--ink);
  --shadow-lift:   0 6px 0 var(--ink);
  --radius:      14px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(176,134,85,0.10) 0, transparent 55%),
    radial-gradient(circle at 92% 88%, rgba(63,122,75,0.08) 0, transparent 55%);
  color: var(--ink);
  font-family: 'Fredoka', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
}

.display, h1, h2 { font-family: 'Titan One', 'Fredoka', sans-serif; font-weight: 400; letter-spacing: 0.01em; }
h1 { font-size: 3rem; line-height: 1.05; margin: 0 0 0.6rem; }
h2 { font-size: 2rem; line-height: 1.1; margin: 1.4rem 0 0.6rem; }
h3 { font-family: 'Fredoka'; font-weight: 700; font-size: 1.375rem; line-height: 1.2; margin: 0 0 0.4rem; }
p  { margin: 0.5rem 0; }
.caption { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--kraft-dk); font-weight: 500; }

/* ---------- Header + wizard ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  background: var(--cream);
  border-bottom: 3px solid var(--ink);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 14px;
}
.header .logo {
  font-family: 'Titan One'; font-size: 1.6rem; color: var(--brick);
  transform: rotate(-2deg); padding: 4px 10px;
  background: var(--mustard); border: 3px solid var(--ink);
  border-radius: 8px; box-shadow: 3px 3px 0 var(--ink);
  white-space: nowrap;
}
.header .steps { flex: 1; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.step-dot {
  font-family: 'Titan One'; font-size: 0.95rem; width: 32px; height: 32px;
  border: 3px solid var(--ink); border-radius: 50%; background: var(--cream);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); position: relative;
}
.step-dot.done { background: var(--forest); color: var(--cream); }
.step-dot.active { background: var(--mustard); box-shadow: 0 3px 0 var(--ink); transform: translateY(-2px); }

/* Compact coach card in header (mini version). */
.coach-mini {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; background: var(--cream-warm);
  border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
}
.coach-mini .avatar {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--chalkblue); border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Titan One'; font-size: 1.4rem; color: var(--ink);
  overflow: hidden; flex-shrink: 0;
}
.coach-mini .avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.coach-mini .meta { font-size: 0.85rem; line-height: 1.15; }
.coach-mini .team { font-weight: 700; }
.coach-mini .credits { font-family: 'Titan One'; color: var(--brick); font-size: 1rem; }

/* ---------- Main layout ---------- */
.wrap { max-width: 960px; margin: 0 auto; padding: 28px 20px 120px; }
.hero {
  padding: 32px 28px; margin-bottom: 24px;
  background: var(--cream-warm); border: 3px solid var(--ink);
  border-radius: 20px; box-shadow: var(--shadow-lift);
  position: relative; overflow: hidden;
}
.hero .kicker {
  display: inline-block; padding: 4px 12px; background: var(--brick); color: var(--cream);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem;
  border: 3px solid var(--ink); border-radius: 6px; transform: rotate(-2deg);
  box-shadow: 2px 2px 0 var(--ink);
}
.hero h1 { transform: rotate(-1deg); color: var(--ink); margin-top: 12px; }
.hero p.lead { font-size: 1.15rem; max-width: 560px; }

/* ---------- Cards ---------- */
.card {
  padding: 20px 22px; margin: 18px 0;
  background: #fff; border: 3px solid var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-chunky);
}
.card.slate {
  background: var(--slate); color: var(--cream);
  border-color: var(--ink);
  background-image: repeating-linear-gradient(
    45deg, rgba(255,255,255,0.02) 0 2px, transparent 2px 8px
  );
}
.card.slate h2, .card.slate h3 { color: var(--cream); }
.card.paper {
  background: var(--cream); border-color: var(--kraft);
  background-image: repeating-linear-gradient(
    0deg, rgba(176,134,85,0.06) 0 1px, transparent 1px 28px
  );
}

/* ---------- Buttons ---------- */
button, .btn {
  font-family: 'Fredoka'; font-weight: 700; font-size: 1rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 14px 22px; border: 3px solid var(--ink); border-radius: var(--radius);
  cursor: pointer; background: var(--mustard); color: var(--ink);
  box-shadow: var(--shadow-chunky);
  transition: transform 80ms ease-out, box-shadow 80ms ease-out;
  user-select: none;
}
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
button:active, .btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
button.sec { background: var(--cream); border-color: var(--kraft); }
button.danger { background: var(--brick); color: var(--cream); }
button.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--brick); }
button.ghost:active { transform: translateY(1px); }
button:disabled, .btn:disabled { opacity: 0.4; cursor: not-allowed; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }

/* ---------- Inputs ---------- */
input[type=text], input[type=tel], textarea {
  width: 100%; padding: 14px 16px;
  font-family: 'Fredoka'; font-size: 1.05rem; color: var(--ink);
  background: #fff; border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: 0 2px 0 var(--ink);
}
textarea { min-height: 200px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus { outline: none; box-shadow: 0 2px 0 var(--ink), 0 0 0 4px var(--mustard-lt); }
label { display: block; font-weight: 700; margin: 12px 0 6px; }
label .req { color: var(--brick); }

/* ---------- Coach picker grid ---------- */
.coach-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; margin: 16px 0;
}
.coach-tile {
  padding: 14px 10px; text-align: center; cursor: pointer;
  background: var(--cream); border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: var(--shadow-chunky);
  transition: transform 100ms ease-out, background 100ms;
}
.coach-tile:hover { transform: translateY(-2px); }
.coach-tile.selected { background: var(--mustard); }
.coach-tile .portrait {
  width: 100%; aspect-ratio: 1; margin-bottom: 8px;
  background: var(--chalkblue); border: 3px solid var(--ink); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Titan One'; font-size: 2.4rem; color: var(--ink);
}
.coach-tile.selected .portrait { background: var(--mustard-lt); }
.coach-tile .name { font-weight: 700; }

/* ---------- Loadout slots ---------- */
.loadout-cat { margin-top: 22px; }
.loadout-cat h3 { border-bottom: 3px dashed var(--kraft); padding-bottom: 6px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.slot {
  padding: 14px; background: var(--cream); border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: var(--shadow-chunky); position: relative; cursor: pointer;
  transition: transform 100ms ease-out;
}
.slot:hover { transform: translateY(-2px); }
.slot.owned { background: var(--mustard); transform: translateX(6px); }
.slot.owned::after {
  content: 'IN THE BAG'; position: absolute; top: 8px; right: -14px;
  background: var(--brick); color: var(--cream); font-weight: 700; font-size: 0.7rem;
  padding: 3px 10px; border: 2px solid var(--ink); border-radius: 4px;
  transform: rotate(-6deg); box-shadow: 2px 2px 0 var(--ink); letter-spacing: 0.1em;
}
.slot.locked { opacity: 0.4; cursor: not-allowed; }
.slot .price { font-family: 'Titan One'; font-size: 1.3rem; color: var(--brick); }
.slot .desc { font-size: 0.9rem; color: var(--ink); opacity: 0.85; margin: 6px 0; }
.slot .title { font-weight: 700; font-size: 1.05rem; }

.model-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.tier {
  padding: 14px; text-align: center; cursor: pointer;
  background: var(--cream); border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: var(--shadow-chunky); position: relative;
}
.tier.selected { background: var(--forest); color: var(--cream); }
.tier .title { font-weight: 700; }
.tier .price { font-family: 'Titan One'; font-size: 1.3rem; color: var(--brick); margin-top: 4px; }
.tier.selected .price { color: var(--mustard-lt); }

/* ---------- Credit meter ---------- */
.credit-hud {
  padding: 16px 20px; margin: 18px 0;
  background: var(--slate); color: var(--cream);
  border: 3px solid var(--ink); border-radius: var(--radius);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.credit-hud .amt { font-family: 'Titan One'; font-size: 2.5rem; }
.credit-hud .amt .spent { color: var(--brick); }
.credit-hud .amt .left { color: var(--mustard-lt); }

/* ---------- Playbook binder ---------- */
.binder {
  display: grid; grid-template-columns: 200px 1fr; gap: 12px;
  min-height: 500px;
}
.binder-tabs {
  display: flex; flex-direction: column; gap: 4px;
  padding-right: 4px;
}
.binder-tabs .tab {
  padding: 12px 14px; background: var(--kraft); color: var(--cream);
  border: 3px solid var(--ink); border-right: none;
  border-radius: 12px 0 0 12px; cursor: pointer;
  font-weight: 700; font-size: 0.9rem;
  transition: transform 120ms ease-out;
}
.binder-tabs .tab:hover { transform: translateX(-2px); }
.binder-tabs .tab.active { background: var(--mustard); color: var(--ink); transform: translateX(8px); }
.binder-tabs .tab .flag { display: inline-block; margin-left: 6px; background: var(--brick); color: var(--cream);
  border-radius: 8px; padding: 1px 6px; font-size: 0.75rem; }
.binder-page {
  padding: 22px 26px 22px 44px; background: var(--cream);
  border: 3px solid var(--ink); border-radius: 0 14px 14px 14px;
  box-shadow: var(--shadow-chunky);
  background-image: repeating-linear-gradient(0deg, rgba(176,134,85,0.10) 0 1px, transparent 1px 28px);
  position: relative;
}
.binder-page::before {
  content: '';
  position: absolute; left: 14px; top: 22px; bottom: 22px; width: 3px;
  background: repeating-linear-gradient(0deg, var(--kraft) 0 8px, transparent 8px 24px);
}
.binder-page textarea {
  border: none; background: transparent; box-shadow: none; padding: 0;
  font-family: 'Fredoka'; font-weight: 500; font-size: 1.125rem; line-height: 1.65;
  min-height: 440px;
}
.binder-page textarea:focus { box-shadow: none; }
.binder-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px;
  font-size: 0.85rem; color: var(--kraft-dk); }
.stamp {
  display: none; padding: 4px 14px; font-family: 'Titan One'; font-size: 1.1rem;
  color: var(--brick); border: 3px solid var(--brick); border-radius: 6px;
  transform: rotate(-8deg); background: rgba(194,74,52,0.05);
}
.stamp.show { display: inline-block; }

@media (max-width: 700px) {
  .binder { grid-template-columns: 1fr; }
  .binder-tabs { flex-direction: row; overflow-x: auto; padding: 0 0 8px; }
  .binder-tabs .tab { border-radius: 12px; border-right: 3px solid var(--ink); white-space: nowrap; }
  .binder-tabs .tab.active { transform: translateY(-2px); }
  .binder-page { border-radius: 14px; padding-left: 32px; }
  .header .steps { display: none; }
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 2.2rem; }
}

/* ---------- Chalkboard callout ---------- */
.chalkboard {
  padding: 24px 28px; margin: 20px 0;
  background: var(--slate); color: var(--cream);
  border: 4px solid var(--ink); border-radius: 16px;
  box-shadow: var(--shadow-lift);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 3px, transparent 3px 10px);
}
.chalkboard .star { display: inline-block; color: var(--mustard); font-size: 1.4rem; margin-right: 8px; }
.chalkboard h3 { color: var(--cream); }

/* ---------- Toast / feedback ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  padding: 12px 22px; background: var(--slate); color: var(--cream);
  border: 3px solid var(--ink); border-radius: 30px; box-shadow: var(--shadow-chunky);
  font-weight: 700; opacity: 0; transition: opacity 200ms;
  z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--brick); }
.toast.ok  { background: var(--forest); }

/* ---------- Polish pass (2026-08-12) ---------- */

/* Coach tile: bright per-coach accents + click bounce */
.coach-tile { transition: transform 120ms cubic-bezier(.4,1.6,.6,1), background 150ms; }
.coach-tile[data-key="coach-1"] .portrait { background: #F2CB6B; }
.coach-tile[data-key="coach-2"] .portrait { background: #7BAECF; }
.coach-tile[data-key="coach-3"] .portrait { background: #E8B23B; color: var(--slate); }
.coach-tile[data-key="coach-4"] .portrait { background: #C24A34; color: var(--cream); }
.coach-tile[data-key="coach-5"] .portrait { background: #3F7A4B; color: var(--cream); }
.coach-tile[data-key="coach-6"] .portrait { background: #B08655; color: var(--cream); }
.coach-tile[data-key="coach-7"] .portrait { background: #2F3E3A; color: var(--mustard-lt); }
.coach-tile[data-key="coach-8"] .portrait { background: #EFDDB8; }
.coach-tile.click-bounce { animation: coachBounce 320ms cubic-bezier(.4,1.6,.6,1); }
@keyframes coachBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06) translateY(-2px); }
  100% { transform: scale(1); }
}
.coach-tile.selected .portrait {
  outline: 4px solid var(--mustard);
  outline-offset: -2px;
}

/* Loadout slot: purchase pulse */
.slot.just-bought {
  animation: slotPop 380ms cubic-bezier(.4,1.6,.6,1);
}
@keyframes slotPop {
  0%   { transform: translateX(6px) scale(1); }
  35%  { transform: translateX(10px) scale(1.05); box-shadow: 0 10px 0 var(--ink), 0 0 0 6px var(--mustard-lt); }
  100% { transform: translateX(6px) scale(1); }
}
.tier.selected { animation: tierSelect 240ms ease-out; }
@keyframes tierSelect {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Credit hud: tabular numbers + subtle pulse when changing */
.credit-hud .amt { font-variant-numeric: tabular-nums; }
.credit-hud.changed { animation: hudPulse 400ms ease-out; }
@keyframes hudPulse {
  0%   { box-shadow: var(--shadow-chunky), 0 0 0 0 rgba(232,178,59,0); }
  50%  { box-shadow: var(--shadow-chunky), 0 0 0 6px rgba(232,178,59,0.3); }
  100% { box-shadow: var(--shadow-chunky), 0 0 0 0 rgba(232,178,59,0); }
}

/* Bouncing-football spinner */
.spinner {
  display: inline-block;
  font-size: 2rem;
  animation: footballBounce 900ms ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes footballBounce {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50%      { transform: translateY(-14px) rotate(8deg); }
}

/* Playbook tab: filled dot indicator */
.binder-tabs .tab { position: relative; padding-left: 26px; }
.binder-tabs .tab::before {
  content: '';
  position: absolute; left: 10px; top: 50%;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--kraft-dk); transform: translateY(-50%);
  transition: background 150ms;
}
.binder-tabs .tab.filled::before { background: var(--mustard); box-shadow: 0 0 0 2px var(--cream); }
.binder-tabs .tab.active.filled::before { background: var(--ink); }

/* Inline field error */
.field-err {
  color: var(--brick); font-size: 0.85rem; font-weight: 500;
  margin-top: 4px; min-height: 1.2em;
}

/* Live coach preview in header */
.coach-mini { transition: transform 200ms ease-out; }
.coach-mini.updated { animation: hudPulse 350ms ease-out; }

/* Small next-step hint under wizard */
.next-hint {
  text-align: center; font-size: 0.9rem; color: var(--kraft-dk);
  margin-top: 22px; padding: 10px;
}
.next-hint b { color: var(--brick); }

/* Coach's Coach-of-the-Day: subtle sparkle on the selected tile */
.coach-tile.selected {
  position: relative;
}
.coach-tile.selected::after {
  content: '★';
  position: absolute; top: -8px; right: -8px;
  width: 28px; height: 28px; line-height: 28px; text-align: center;
  background: var(--brick); color: var(--cream);
  border: 3px solid var(--ink); border-radius: 50%;
  font-family: 'Titan One'; font-size: 0.95rem;
  transform: rotate(-8deg);
  box-shadow: 2px 2px 0 var(--ink);
}

/* Character count progress bar */
.charbar {
  display: block; height: 4px; border-radius: 3px;
  background: var(--kraft); overflow: hidden; margin-top: 6px;
}
.charbar > span {
  display: block; height: 100%;
  background: var(--forest);
  transition: width 200ms ease-out, background 200ms;
}
.charbar.warn > span { background: var(--mustard); }
.charbar.full > span { background: var(--brick); }

/* ---------- Round 2 fixes (2026-08-12) ---------- */

/* Tier / model card: unfundable state was missing */
.tier.locked { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.tier.locked:hover { transform: none; }

/* Info button (i) on model tiles */
.tier { position: relative; }
.info-btn {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--cream); color: var(--ink);
  border: 2px solid var(--ink);
  font-family: 'Titan One'; font-size: 0.85rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  box-shadow: 2px 2px 0 var(--ink);
}
.tier.selected .info-btn { background: var(--mustard-lt); }
.info-btn:hover { transform: translateY(-1px); }

/* Modal — used for model info, playbook help, rules overview */
.modal-bg {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(42,31,23,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 180ms;
}
.modal-bg.on { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--cream); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: var(--shadow-lift);
  max-width: 520px; width: 100%; max-height: 85vh; overflow-y: auto;
  padding: 24px 26px;
  transform: translateY(20px) scale(0.98); transition: transform 220ms cubic-bezier(.4,1.6,.6,1);
}
.modal-bg.on .modal { transform: translateY(0) scale(1); }
.modal h3 { font-family: 'Titan One'; font-size: 1.6rem; margin: 0 0 10px; }
.modal p { margin: 0.6em 0; line-height: 1.55; }
.modal .close {
  float: right; margin-top: -10px; margin-right: -10px;
  padding: 6px 12px; font-size: 0.8rem;
}

/* Taken-coach state */
.coach-tile.taken {
  opacity: 0.35; cursor: not-allowed; position: relative;
}
.coach-tile.taken:hover { transform: none; }
.coach-tile.taken::before {
  content: attr(data-taken-by);
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-6deg);
  background: var(--brick); color: var(--cream);
  padding: 4px 12px; border: 2px solid var(--ink);
  border-radius: 6px; font-family: 'Titan One'; font-size: 0.85rem;
  white-space: nowrap; box-shadow: 2px 2px 0 var(--ink); z-index: 2;
}

/* Team name picker grid */
.name-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; margin: 14px 0;
}
.name-tile {
  padding: 12px 14px; cursor: pointer; text-align: center;
  background: var(--cream); border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: var(--shadow-chunky);
  font-family: 'Titan One'; font-size: 1.05rem; letter-spacing: 0.02em;
  transition: transform 100ms;
}
.name-tile:hover { transform: translateY(-2px); }
.name-tile.selected { background: var(--mustard); }
.name-tile.taken { opacity: 0.3; cursor: not-allowed; text-decoration: line-through; }
.name-tile.taken:hover { transform: none; }

/* Portrait image support */
.coach-tile .portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }

/* Playbook: tools sidebar / info panel */
.playbook-help {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 14px;
  background: var(--cream-warm); border: 3px solid var(--kraft);
  border-radius: 12px;
}
.playbook-help .icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 8px;
  background: var(--mustard); border: 3px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Titan One'; font-size: 1.4rem;
}
.playbook-help p { margin: 0; font-size: 0.92rem; }
.playbook-help .learn { font-weight: 700; color: var(--brick); cursor: pointer; text-decoration: underline; }

.tool-chip-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 0; margin-bottom: 8px;
  font-size: 0.85rem;
}
.tool-chip {
  padding: 3px 10px; background: var(--forest); color: var(--cream);
  border: 2px solid var(--ink); border-radius: 6px; font-weight: 500;
  font-family: 'Fredoka';
}
.tool-chip.free { background: var(--kraft); }

/* Rules overview intro card */
.intro-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* Cascade warning banner */
.cascade-banner {
  padding: 14px 16px; margin: 14px 0;
  background: var(--brick); color: var(--cream);
  border: 3px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-chunky);
  font-weight: 500;
}
.cascade-banner b { display: block; font-family: 'Titan One'; font-size: 1.1rem; margin-bottom: 4px; }

/* ---------- Round 3 additions ---------- */

/* Multi-textarea playbook editor: fixed H2 headers + one editable panel per section */
.section-block {
  margin-bottom: 18px; padding-bottom: 4px;
  border-bottom: 1px dashed var(--kraft);
}
.section-block:last-child { border-bottom: 0; }
.section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0 4px; font-family: 'Titan One'; font-size: 1.15rem; color: var(--ink);
}
.section-header .lock {
  font-size: 0.7rem; font-family: 'Fredoka'; font-weight: 500;
  color: var(--kraft-dk); background: var(--cream-warm);
  padding: 2px 8px; border-radius: 4px; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--kraft);
}
.section-block textarea {
  min-height: 100px; font-size: 1.02rem; line-height: 1.55;
  font-family: 'Fredoka'; font-weight: 500;
  padding: 10px 12px; background: transparent;
  border: 2px solid var(--kraft); border-radius: 8px;
  color: var(--ink); box-shadow: none; resize: vertical;
  background-image: repeating-linear-gradient(0deg, rgba(176,134,85,0.08) 0 1px, transparent 1px 28px);
}
.section-block textarea:focus {
  outline: none; border-color: var(--mustard); box-shadow: 0 0 0 3px var(--mustard-lt);
}

/* Example / harness link buttons in the binder header */
.binder-actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 8px;
}
.binder-actions .link {
  font-family: 'Fredoka'; font-weight: 700; font-size: 0.82rem;
  padding: 5px 10px; background: var(--cream-warm); color: var(--brick);
  border: 2px solid var(--kraft); border-radius: 6px; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.05em;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 80ms ease-out;
}
.binder-actions .link:hover { transform: translateY(-1px); }
.binder-actions .link:active { transform: translateY(2px); box-shadow: 0 0 0 var(--ink); }

/* Example modal content */
.example-md {
  background: var(--cream); padding: 14px; border: 2px solid var(--kraft); border-radius: 8px;
  font-family: 'Fredoka'; font-size: 0.95rem; line-height: 1.55;
  white-space: pre-wrap; max-height: 60vh; overflow-y: auto;
  background-image: repeating-linear-gradient(0deg, rgba(176,134,85,0.08) 0 1px, transparent 1px 26px);
}
.harness-md {
  background: var(--slate); color: var(--cream);
  padding: 14px; border: 2px solid var(--ink); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem; line-height: 1.55;
  white-space: pre-wrap; max-height: 60vh; overflow-y: auto;
}

/* Better chip styles — platform-labeled */
.tool-chip {
  padding: 4px 10px; background: var(--forest); color: var(--cream);
  border: 2px solid var(--ink); border-radius: 6px; font-weight: 500;
  font-family: 'Fredoka'; font-size: 0.85rem;
  display: inline-flex; align-items: center; gap: 4px;
}
.tool-chip.free { background: var(--kraft); }
.tool-chip .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--mustard);
  display: inline-block;
}
.tool-chip.free .dot { background: var(--cream); opacity: 0.7; }

/* Harness list on Field / Playbook */
.harness-list { list-style: none; padding: 0; margin: 8px 0 0; }
.harness-list li {
  padding: 8px 12px; margin-bottom: 6px;
  background: var(--cream-warm); border: 2px solid var(--kraft); border-radius: 8px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.harness-list li b { font-family: 'Titan One'; font-weight: 400; font-size: 1rem; }

/* ---------- Round 3c: mobile + PWA install prompt ---------- */

/* Header adjustments for tight mobile widths */
@media (max-width: 640px) {
  .header { padding: 10px 12px; gap: 8px; }
  .header .logo { font-size: 1.25rem; padding: 3px 8px; }
  .coach-mini { padding: 5px 9px; gap: 8px; }
  .coach-mini .avatar { width: 34px; height: 34px; font-size: 1.1rem; }
  .coach-mini .meta { font-size: 0.78rem; max-width: 130px; }
  .coach-mini .team {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 130px; display: block;
  }
  .coach-mini .credits { font-size: 0.9rem; }
}

/* Main wrap: reduce padding on phones so content isn't squeezed */
@media (max-width: 640px) {
  .wrap { padding: 18px 12px 100px; }
  .hero { padding: 20px 16px; margin-bottom: 16px; border-radius: 14px; }
  .hero h1 { font-size: 2rem; }
  .hero p.lead { font-size: 1rem; }
  .card { padding: 14px 14px; margin: 12px 0; }
  h2 { font-size: 1.5rem; }
}

/* Grid density on phones */
@media (max-width: 640px) {
  .coach-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .coach-tile { padding: 10px 8px; }
  .coach-tile .name { font-size: 0.85rem; }
  .coach-tile div[style*="font-size:0.72rem"] { font-size: 0.68rem !important; }
  .name-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .name-tile { padding: 10px 8px; font-size: 0.9rem; }
  .slot-grid { grid-template-columns: 1fr; gap: 10px; }
  .model-tiers { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tier { padding: 10px; }
  .credit-hud { padding: 12px 14px; gap: 8px; }
  .credit-hud .amt { font-size: 1.8rem; }
}

/* Buttons: bigger touch targets on phones */
@media (max-width: 640px) {
  button, .btn { padding: 12px 16px; font-size: 0.92rem; }
  .binder-actions .link { padding: 8px 12px; font-size: 0.8rem; }
}

/* Playbook binder on phones: full-width tabs, tighter page */
@media (max-width: 640px) {
  .binder-page { padding: 16px 14px 14px 26px; }
  .binder-page textarea, .section-block textarea {
    font-size: 1rem;
    min-height: 80px;
  }
  .section-header { font-size: 1rem; }
  .binder-tabs .tab { padding: 10px 10px 10px 24px; font-size: 0.82rem; }
  .binder-tabs .tab::before { left: 8px; width: 6px; height: 6px; }
}

/* Modal on phones: fill available width */
@media (max-width: 640px) {
  .modal { padding: 18px 18px 20px; max-height: 92vh; border-radius: 14px; }
  .modal h3 { font-size: 1.35rem; }
  .modal p { font-size: 0.92rem; }
}

/* Chalkboard tighter on phones */
@media (max-width: 640px) {
  .chalkboard { padding: 18px 18px; }
}

/* Field-summary coach header on phones */
@media (max-width: 640px) {
  .card.paper > div[style*="display:flex"] {
    flex-wrap: wrap;
  }
}

/* PWA install prompt banner */
.install-banner {
  position: fixed; bottom: 12px; left: 12px; right: 12px;
  z-index: 90;
  padding: 12px 14px;
  background: var(--slate); color: var(--cream);
  border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: var(--shadow-lift);
  font-size: 0.92rem; line-height: 1.4;
  display: flex; align-items: center; gap: 12px;
  transform: translateY(120%);
  transition: transform 300ms cubic-bezier(.4,1.6,.6,1);
}
.install-banner.on { transform: translateY(0); }
.install-banner .msg { flex: 1; }
.install-banner b { color: var(--mustard-lt); }
.install-banner button {
  padding: 8px 12px; font-size: 0.78rem;
  flex-shrink: 0;
}
.install-banner .dismiss {
  background: transparent; border-color: transparent; box-shadow: none;
  color: var(--cream); padding: 6px 10px;
}

/* Commissioner page uses same base styles + a big data table */
.commish-nav {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0;
}
.commish-nav .tab-link {
  padding: 10px 14px; background: var(--cream); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 10px;
  font-family: 'Fredoka'; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  cursor: pointer; box-shadow: var(--shadow-chunky);
  transition: transform 80ms;
}
.commish-nav .tab-link:hover { transform: translateY(-1px); }
.commish-nav .tab-link.active { background: var(--mustard); }
.data-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: #fff; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow-chunky);
  font-family: 'Fredoka'; font-size: 0.88rem;
}
.data-table th, .data-table td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--kraft);
  vertical-align: top;
}
.data-table th { background: var(--cream-warm); font-family: 'Titan One'; font-weight: 400; font-size: 0.8rem; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table code { background: var(--cream); padding: 1px 4px; border-radius: 3px; font-size: 0.78rem; }
.pill {
  display: inline-block; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 4px;
  font-size: 0.72rem; font-weight: 700; margin-right: 4px;
  background: var(--cream);
}
.pill.on { background: var(--forest); color: var(--cream); }
.pill.warn { background: var(--brick); color: var(--cream); }
.pill.muted { background: var(--cream-warm); }
