/* Fonts loaded via <link> in HTML for better performance */

:root {
  --bg:         #4a7040;       /* fallback if image fails */
  --paper:      #fdfcf5;       /* notebook white */
  --paper-dark: #f0ead8;       /* slightly aged page */
  --ink:        #1a1630;       /* deep pen ink */
  --muted:      #6a7a8a;       /* pencil gray */
  --line:       #c8b898;       /* aged paper edge */
  --rule:       rgba(100,140,210,.16);   /* notebook blue ruling lines */
  --margin-red: rgba(195,30,30,.22);     /* red margin line */
  --navy:       #0d2240;
  --red:        #c41519;
  --gold:       #c98a20;
  --grass:      #2a6020;
  --sky:        #1e7abc;
  --soft:       #edf3e8;       /* light spring green tint */
  --shadow:     0 12px 36px rgba(20,40,15,.22), 0 3px 8px rgba(0,0,0,.1);
  --ring-dark:  #5a4020;
  --ring-light: #c09050;
}

* { box-sizing: border-box; }

/* ─── Base ─────────────────────────────────────────── */

html { overflow-x: hidden; }

.seo-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  overflow-x: hidden;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(225, 248, 210, .28), rgba(225, 248, 210, .28)),
    url('assets/baseballBG.png');
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}

/* Subtle grain over everything */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: .028;
}

button, input, select { font-family: 'Oswald', 'Impact', 'Arial Narrow', sans-serif; }
button { cursor: pointer; }
h1, h2, h3 { font-family: 'Oswald', 'Impact', sans-serif; font-weight: 700; margin-top: 0; }
p { margin-top: 0; }

.hidden { display: none !important; }

/* ─── Scoreboard brand mark ─────────────────────────── */

.brand-mark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .38rem;
  padding: .65rem 1rem .75rem;
  background: #1c3820;
  border: 5px solid #7a5828;
  border-bottom-color: #4a3010;
  border-radius: 6px;
  box-shadow:
    inset 0 4px 14px rgba(0,0,0,.6),
    inset 0 -1px 4px rgba(255,255,255,.04),
    0 10px 30px rgba(0,0,0,.45),
    0 3px 0 #3e2508,
    0 6px 0 rgba(0,0,0,.25);
}

.sb-tagline {
  color: rgba(240, 215, 140, .88);
  font-family: 'Oswald', sans-serif;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-align: center;
}

.sb-label {
  color: rgba(240, 215, 140, .55);
  font-family: 'Oswald', sans-serif;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-align: center;
}

.sb-digits {
  display: flex;
  align-items: center;
  gap: 3px;
}

.sb-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 53px;
  height: 64px;
  background: linear-gradient(180deg, #091510 0%, #0c1c14 100%);
  border: 1.5px solid #1a3220;
  border-radius: 3px;
  color: #f2e8b8;
  font-family: 'Bebas Neue', 'Impact', monospace;
  font-size: 3.45rem;
  line-height: 1;
  box-shadow:
    inset 0 4px 10px rgba(0,0,0,.7),
    inset 0 -1px 3px rgba(255,255,255,.05);
  text-shadow: 0 0 18px rgba(242, 232, 160, .5);
}

.sb-sep {
  color: rgba(240, 215, 140, .55);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.22rem;
  line-height: 1;
  margin: 0 1px;
}

/* Small (game header) variant */
.brand-mark.small {
  flex-direction: column;
  gap: .25rem;
  padding: .4rem .65rem .45rem;
  border-width: 3px;
  border-bottom-width: 2px;
  border-bottom-color: #4a3010;
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,.55),
    0 5px 16px rgba(0,0,0,.35),
    0 2px 0 #3e2508;
}

.brand-mark.small .sb-digits {
  gap: 2px;
}

.brand-mark.small .sb-tile {
  width: 30px;
  height: 37px;
  font-size: 1.9rem;
}

.brand-mark.small .sb-sep {
  font-size: 1.7rem;
}

.sb-domain {
  color: rgba(240, 215, 140, .65);
  font-family: 'Oswald', sans-serif;
  font-size: .48rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}

/* ─── Main logo ─────────────────────────────────────── */

.main-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-logo img {
  width: clamp(240px, min(54vw, 44svh), 640px);
  max-height: 48svh;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,.45));
}

.header-logo-img {
  height: 72px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}

/* ─── Home Screen ───────────────────────────────────── */

.home-screen {
  position: relative;
  height: 100svh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(.25rem, 1.2svh, .8rem);
  overflow: hidden;
  padding: clamp(.65rem, 3svh, 2rem) 1rem;
  text-align: center;
}



.mode-panel {
  width: min(1300px, 100%);
  margin-top: clamp(1.5rem, 7svh, 5rem);
}

.mode-panel h2 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.55rem);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: .2rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  opacity: .7;
}

.mode-panel > p {
  color: #3a4a30;
  margin-bottom: clamp(.3rem, 1.2svh, .75rem);
  font-style: italic;
  font-size: .92rem;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: clamp(.5rem, 3vw, 1.5rem);
  justify-content: center;
  align-items: center;
}

/* ─── Mode cards ────────────────────────────────────── */

.mode-card {
  display: flex;
  justify-content: center;
  cursor: pointer;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.28)) drop-shadow(0 2px 5px rgba(0,0,0,.14));
  transition: filter .18s ease;
}

.mode-ball {
  width: clamp(80px, min(20vw, 40svh), 300px);
  height: clamp(80px, min(20vw, 40svh), 300px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .18s ease;
}

.mode-ball img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.mode-card:hover {
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.38)) drop-shadow(0 3px 8px rgba(0,0,0,.18));
}

.mode-card:hover .mode-ball {
  transform: scale(1.06);
}

.mode-card-classic .mode-ball {
  width: clamp(80px, min(20vw, 40svh), 300px);
  height: clamp(80px, min(20vw, 40svh), 300px);
}

.mode-card-dream {
  cursor: default;
  pointer-events: none;
  opacity: .88;
}

.mode-card-dream .mode-ball {
  width: clamp(80px, min(20vw, 40svh), 300px);
  height: clamp(80px, min(20vw, 40svh), 300px);
}

.daily-challenge-mark {
  width: clamp(120px, min(20vw, 22svh), 280px);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 5px solid var(--navy);
  border-bottom-color: var(--red);
  border-radius: 50%;
  background: var(--paper);
  color: var(--navy);
  box-shadow:
    inset 0 0 0 4px rgba(201, 138, 32, .28),
    0 8px 20px rgba(0, 0, 0, .22);
  transition: transform .18s ease;
}

.daily-mode-card:hover .daily-challenge-mark {
  transform: scale(1.06);
}

.daily-challenge-mark span,
.daily-challenge-mark em {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(.7rem, 1.4vw, 1rem);
  font-style: normal;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
}

.daily-challenge-mark strong {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: clamp(2.4rem, 5.4vw, 5rem);
  font-weight: 400;
  line-height: .9;
  color: var(--red);
}


/* Daily "already played" state — label turns green; no opacity dim (button stays fully active) */
.mode-card-daily.daily-played .mobile-mode-info strong {
  color: var(--grass);
}

/* ─── Shared card / panel base ──────────────────────── */

.panel, .record-card, .player-card, .slot-card, .roll-card, .tip-box, .result-box {
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

/* ─── Game Screen / Header ──────────────────────────── */

.game-screen { min-height: 0; }

/* ─── APD logo in players-panel-head ────────────────── */

.players-panel-head {
  display: flex;
  align-items: center;
  gap: .3rem 1rem;
  flex-wrap: wrap;
}

.players-head-content { flex: 1; min-width: 0; }

.players-head-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  opacity: .88;
  transition: opacity .15s;
}

.players-head-logo:hover,
.players-head-logo:focus-visible { opacity: 1; }

.players-head-logo img {
  height: clamp(80px, 9vw, 140px);
  width: auto;
  display: block;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,.28));
}

/* ─── Roll Banner ───────────────────────────────────── */

.roll-banner {
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
}

.roll-banner-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: .65rem clamp(1rem, 3vw, 2rem);
  gap: 1rem;
}

.roll-banner-team {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Team-summary tiles inside the navy banner */
.roll-banner-team .team-summary {
  display: flex;
  gap: .4rem;
  margin: 0;
  align-items: stretch;
}

.roll-banner-team .team-summary > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .5rem 1rem;
  min-width: 72px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(201, 138, 32, .3);
  border-radius: 5px;
}

.roll-banner-team .team-summary > div.score-tile {
  position: relative;
  cursor: help;
  outline: 0;
}

.roll-banner-team .team-summary > div.score-tile:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 138, 32, .35);
}

.roll-banner-team .team-summary > div.score-tile::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 40;
  width: min(290px, calc(100vw - 1.5rem));
  padding: .65rem .7rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 4px;
  background: #071528;
  color: var(--paper);
  box-shadow: 0 16px 36px rgba(0,0,0,.28);
  font-family: 'Lora', Georgia, serif;
  font-size: .75rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  text-align: center;
  text-transform: none;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity .14s, transform .14s;
}

.roll-banner-team .team-summary > div.score-tile:hover::after,
.roll-banner-team .team-summary > div.score-tile:focus::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.roll-banner-team .team-summary span {
  font-family: 'Oswald', sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}

.roll-banner-team .team-summary strong {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  color: rgba(242, 232, 184, .9);
}

/* Filled count tile — slightly brighter to stand out */
.roll-banner-team .team-summary .banner-filled {
  background: rgba(255, 255, 255, .13);
  border-color: rgba(201, 138, 32, .55);
  margin-left: .35rem;
  min-width: 66px;
}

.roll-banner-team .team-summary .banner-filled span {
  color: rgba(255, 255, 255, .65);
}

.roll-banner-team .team-summary .banner-filled strong {
  color: var(--gold);
  font-size: 1.75rem;
}

.roll-banner-left {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.roll-banner-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
}

.roll-banner-left .primary-btn,
.roll-banner-left .ghost-btn,
.roll-banner-right .ghost-btn {
  width: auto;
  min-width: 110px;
  font-size: .82rem;
  padding: .55rem .9rem;
  min-height: 38px;
  white-space: nowrap;
}

.roll-banner-right .ghost-btn {
  background: transparent;
  border-color: rgba(255, 255, 255, .25);
  color: rgba(255, 255, 255, .85);
}

.roll-banner-left .reroll-btn {
  min-width: 86px;
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .28);
  color: rgba(255, 255, 255, .92);
  white-space: nowrap;
}

.roll-banner-right .ghost-btn:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .45);
}

/* ─── Game Inline Controls ─── */

.game-inline-controls {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--navy);
  padding: .35rem .7rem;
  border-radius: 4px;
  margin-top: .25rem;
}

.gic-left {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.gic-center {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-width: 0;
}

/* Filter pills inside the navy bar — single row */
.gic-center .quick-filters {
  flex: 1;
  display: flex;
  flex-wrap: nowrap;
  gap: .4rem;
  align-items: center;
  justify-content: center;
  padding: .15rem 0;
}

.gic-center .quick-filters button {
  min-height: 40px;
  padding: .3rem 1rem;
  font-size: .85rem;
  border-color: rgba(255,255,255,.28);
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.08);
  white-space: nowrap;
}
.gic-center .quick-filters button.active {
  background: rgba(201,138,32,.25);
  border-color: rgba(201,138,32,.7);
  color: #fff;
}

.gic-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
}

/* Image-based desktop control buttons */
.gic-img-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .12s, transform .1s;
}
.gic-img-btn img {
  height: 42px;
  width: auto;
  display: block;
  object-fit: contain;
}
#bannerHtpBtn img {
  height: 56px;
}
.gic-img-btn:hover { opacity: .85; transform: scale(1.03); }
.gic-img-btn:active { opacity: .7; transform: scale(.97); }
.gic-img-btn.hidden { display: none; }

/* Start Game primary button sizing */
.gic-left .primary-btn {
  width: auto;
  min-width: 100px;
  font-size: .82rem;
  padding: .45rem .9rem;
  min-height: 36px;
  white-space: nowrap;
}

/* ─── Eyebrow / labels ──────────────────────────────── */

.eyebrow, .small-label {
  color: var(--red);
  font-family: 'Oswald', sans-serif;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .13em;
  margin: 0 0 .35rem;
  text-transform: uppercase;
}

/* ─── Record card ───────────────────────────────────── */

.record-card {
  min-width: 150px;
  padding: 1rem;
  text-align: center;
  border: 2px solid var(--line);
  background: var(--paper);
}

.record-card strong {
  display: block;
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 2.6rem;
  font-weight: 400;
  line-height: 1;
  color: var(--navy);
}

/* ─── Layout ────────────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 1rem;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 1rem clamp(1rem, 3vw, 2rem) 2rem;
  align-items: stretch;
}

/* ─── Notebook panels ───────────────────────────────── */

.panel {
  position: relative;
  padding: 1rem;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
  background-image:
    repeating-linear-gradient(
      transparent 0,
      transparent 27px,
      var(--rule) 27px,
      var(--rule) 28.5px
    );
  background-color: var(--paper);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-title-row h2 {
  font-size: 1.4rem;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--navy);
  margin-bottom: 0;
}

/* ─── Left panel button row ─────────────────────────── */

.draft-btn-row {
  display: flex;
  margin-bottom: 1rem;
}
.draft-btn-row .primary-btn { flex: 1; }

/* ─── Players panel header — rolled team name ───────── */

.players-panel-head {
  margin-bottom: .4rem;
  border-bottom: 2px solid var(--gold);
  padding-bottom: .3rem;
}

.players-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .18rem;
}

.players-eyebrow {
  font-family: 'Oswald', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
}

.rolled-team-name {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: clamp(2.4rem, 5.5vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  color: var(--navy);
  letter-spacing: .04em;
  margin: 0;
}

.rolled-team-name.ws-roll-title {
  color: #102750;
}

/* Team name + re-roll button row in the players panel header */
.team-name-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.header-reroll-btn {
  flex-shrink: 0;
  height: 8.25rem;
  width: 8.25rem;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  -webkit-tap-highlight-color: transparent;
}
.header-reroll-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: filter .2s;
}
.header-reroll-btn:hover img {
  animation: reroll-spin-loop .65s linear infinite;
}
.header-reroll-btn:active img { transform: scale(.9); }
.header-reroll-btn.hidden { display: none; }

/* Used state — stays visible in the stack, just greyed and inert */
.header-reroll-btn.reroll-used {
  cursor: not-allowed;
  pointer-events: none;
}
.header-reroll-btn.reroll-used img {
  filter: grayscale(1);
  opacity: .35;
  animation: none !important;
}

@keyframes reroll-spin-loop {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.roll-ws-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: .35rem;
  padding: .13rem .36rem .1rem;
  border: 1px solid var(--gold);
  border-radius: 3px;
  background: var(--navy);
  color: var(--paper);
  font-family: 'Oswald', sans-serif;
  font-size: clamp(.62rem, 1.15vw, .82rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 2px 0 rgba(192,160,122,.4);
}

.roll-year {
  color: var(--gold);
}

.rolled-team-era {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: .55;
  margin-top: -.1rem;
  margin-bottom: .2rem;
}

.roster-help-text {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
  margin: .15rem 0 .3rem;
  min-height: 1.1em;
}
.roster-help-text:empty { display: none; }

/* ─── Filters ───────────────────────────────────────── */

#positionFilter { display: none; }

.players-filter-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .6rem;
  min-width: 0;
}


.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  flex: 0 0 auto;
}

.quick-filters button {
  min-height: 36px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: .38rem .88rem;
  color: var(--navy);
  background: var(--paper);
  font-family: 'Oswald', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
}

.quick-filters button.active {
  color: #fff;
  border-color: var(--navy);
  background: var(--navy);
}

label {
  color: var(--muted);
  font-family: 'Oswald', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
}

input, select {
  width: 100%;
  min-height: 42px;
  margin-top: .35rem;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  padding: .65rem .7rem;
  color: var(--ink);
  background: var(--paper);
  font-family: 'Lora', serif;
}

.filters input, .filters select { margin-top: 0; }

/* ─── Buttons ───────────────────────────────────────── */

.primary-btn, .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 4px;
  border: 2px solid transparent;
  padding: .68rem .9rem;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-size: .9rem;
  text-align: center;
  text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease;
}

.primary-btn {
  width: 100%;
  color: #fff;
  background: var(--red);
  border-color: #9a1010;
  box-shadow: 0 5px 0 #8a0e0e, 0 8px 18px rgba(196,21,25,.3);
}

.primary-btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 6px 0 #8a0e0e, 0 10px 22px rgba(196,21,25,.38);
}

.primary-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #8a0e0e, 0 3px 8px rgba(196,21,25,.22);
}

.ghost-btn {
  color: var(--navy);
  background: var(--soft);
  border-color: var(--line);
}

.ghost-btn:hover {
  background: var(--paper-dark);
  border-color: var(--navy);
}

.disabled { opacity: .4; cursor: not-allowed; }

/* ─── Roll card / tip / rules ───────────────────────── */

.roll-card, .tip-box, .rules-box, .result-box {
  margin-top: 1rem;
  padding: 1rem;
  box-shadow: none;
}

.roll-card {
  border-left: 5px solid var(--gold);
  border-color: var(--line);
  border-left-color: var(--gold);
  background: var(--paper);
  border-radius: 3px;
}

.roll-card h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: .35rem;
}

.roll-card p:last-child, .tip-box p:last-child, .result-box p:last-child {
  color: var(--muted);
  line-height: 1.52;
  margin-bottom: 0;
  font-style: italic;
}

.tip-box {
  background: var(--soft);
  border: 1.5px solid var(--line);
  border-radius: 4px;
}

.tip-box strong {
  font-family: 'Oswald', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--navy);
}

.rules-box {
  border: 1.5px solid var(--line);
  border-left: 5px solid var(--sky);
  border-radius: 4px;
  background: var(--paper);
}

.rules-box summary {
  color: var(--navy);
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.rules-content {
  display: grid;
  gap: .8rem;
  margin-top: .9rem;
}

.rules-content section {
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}

.rules-content h3 {
  margin-bottom: .25rem;
  font-family: 'Oswald', sans-serif;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--navy);
}

.rules-content p {
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.5;
  margin-bottom: 0;
  font-style: italic;
}

/* ─── Team summary (lives in roll-banner) ───────────── */

/* ─── Roster list head ──────────────────────────────── */

.roster-list-head {
  margin: .5rem 0 .55rem;
  text-align: center;
}

.lineup-card-logo {
  height: clamp(3rem, 5vh, 4.5rem);
  width: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.18));
}

.roster-list-head h3 {
  margin-bottom: 0;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
}

.roster-list-head span {
  color: var(--red);
  font-family: 'Oswald', sans-serif;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ─── Slot grid ─────────────────────────────────────── */

.slot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
  align-items: start;
}

.lineup-section {
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: none;
}

.lineup-section h4 {
  margin: 0;
  padding: .44rem .62rem;
  color: var(--paper);
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
  font-family: 'Oswald', sans-serif;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.lineup-rows { display: grid; }

.slot-card {
  min-height: 34px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: .45rem;
  padding: .3rem .48rem;
  border: 0;
  border-bottom: 1px solid rgba(192, 160, 122, .4);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.slot-card:last-child { border-bottom: 0; }
.slot-card.filled { background: rgba(42, 96, 32, .07); }
.slot-card.open {
  background:
    linear-gradient(90deg, rgba(201, 138, 32, .16), rgba(201, 138, 32, .04));
}

.slot-pos {
  color: var(--red);
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .04em;
  margin-bottom: 0;
}

.slot-main { min-width: 0; }

.slot-name {
  overflow: hidden;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.slot-card.open .slot-name {
  color: rgba(13, 34, 64, .54);
  font-style: italic;
}

.slot-detail {
  overflow: hidden;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.2;
  margin-top: .05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
}

/* ─── Lineup section header colors ───────────────────── */
.lineup-section.infield-section h4 {
  background: #1a4d2e;
  border-bottom-color: rgba(160, 230, 150, .4);
}
.lineup-section.outfield-section h4 {
  background: #1f5c1a;
  border-bottom-color: rgba(140, 220, 130, .4);
}
.lineup-section.dh-section h4 {
  background: #5c3a10;
  border-bottom-color: rgba(230, 175, 80, .4);
}
.lineup-section.starters-section h4 {
  background: #1a2d6e;
  border-bottom-color: rgba(140, 170, 255, .4);
}
.lineup-section.relief-section h4 {
  background: #7a1414;
  border-bottom-color: rgba(255, 160, 80, .4);
}
.lineup-section.manager-section h4 {
  background: #3d2414;
  border-bottom-color: rgba(220, 165, 70, .4);
}
.slot-relief .slot-pos {
  color: #c9721a;
}

/* ─── Baseball Diamond Layout ───────────────────────── */

.diamond-layout {
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--navy);
  margin-top: .5rem;
}

.diamond-field {
  position: relative;
  aspect-ratio: 400 / 320;
  background:
    radial-gradient(ellipse 60% 55% at 50% 90%, #4a8c38 0%, transparent 100%),
    radial-gradient(ellipse 100% 80% at 50% 100%, #2e6820 0%, #1a4815 55%, #133510 100%);
}

.field-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pos-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 2;
  pointer-events: none;
  transition: opacity .2s;
}

.pos-node[data-slot="LF"]  { left: 16%; top: 22%; }
.pos-node[data-slot="CF"]  { left: 50%; top: 9%;  }
.pos-node[data-slot="RF"]  { left: 84%; top: 22%; }
.pos-node[data-slot="2B"]  { left: 50%; top: 44%; }
.pos-node[data-slot="SS"]  { left: 39%; top: 56%; }
.pos-node[data-slot="1B"]  { left: 65%; top: 64%; }
.pos-node[data-slot="3B"]  { left: 35%; top: 64%; }
.pos-node[data-slot="C"]   { left: 50%; top: 85%; }

.pn-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(13, 34, 64, .82);
  border: 2px solid rgba(255,255,255,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
  transition: background .2s, border-color .2s, box-shadow .2s;
}

.pos-node.filled .pn-circle {
  background: rgba(20, 72, 14, .92);
  border-color: rgba(80, 200, 50, .75);
  box-shadow: 0 0 8px rgba(60,180,30,.45);
}

.pos-node.eligible .pn-circle {
  border-color: var(--gold);
  animation: pulse-gold .9s ease-in-out infinite alternate;
}

.pos-node.ineligible { opacity: .28; }

@keyframes pulse-gold {
  from { box-shadow: 0 0 6px rgba(201,138,32,.5), 0 0 14px rgba(201,138,32,.2); }
  to   { box-shadow: 0 0 14px rgba(201,138,32,.95), 0 0 28px rgba(201,138,32,.55); }
}

.pn-name {
  font-family: 'Oswald', sans-serif;
  font-size: .52rem;
  font-weight: 500;
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 4px rgba(0,0,0,.95);
  max-width: 62px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.1;
  letter-spacing: .02em;
}

/* ─── Dugout Zone ────────────────────────────────────── */

.dugout-zone {
  display: flex;
  background: var(--navy);
  border-top: 2px solid var(--gold);
  padding: .6rem .4rem .5rem;
}

.dugout-group {
  flex: 1;
  padding: 0 .45rem;
  border-right: 1px solid rgba(255,255,255,.1);
  min-width: 0;
}

.dugout-group:last-child { border-right: none; }

.dg-group-label {
  font-family: 'Oswald', sans-serif;
  font-size: .57rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .25rem;
  padding-bottom: .15rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.dg-slot {
  display: flex;
  flex-direction: column;
  padding: .18rem .25rem;
  border-radius: 3px;
  margin-bottom: 2px;
  border-left: 2px solid transparent;
  transition: background .15s, border-color .15s;
}

.dg-slot.filled {
  background: rgba(20, 80, 14, .35);
  border-left-color: rgba(80,200,50,.45);
}

.dg-slot.eligible {
  background: rgba(201,138,32,.18);
  border-left-color: var(--gold);
}

.dg-slot.ineligible { opacity: .35; }

.dg-pos {
  font-family: 'Oswald', sans-serif;
  font-size: .56rem;
  font-weight: 700;
  color: rgba(200,170,100,.88);
  letter-spacing: .04em;
  line-height: 1.1;
}

.dg-name {
  font-family: 'Lora', serif;
  font-size: .67rem;
  color: rgba(255,255,255,.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.dg-detail {
  font-size: .54rem;
  color: rgba(200,210,220,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.scout-mode .dg-detail { display: none; }

/* ─── Loading ───────────────────────────────────────── */

.loading-box {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .95rem;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--soft);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── How to Play dialog ────────────────────────────── */

.htp-box {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.htp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1.25rem .85rem;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 2;
}

.htp-head-brand { display: flex; flex-direction: column; gap: .12rem; }

.htp-head-eyebrow {
  font-family: 'Oswald', sans-serif;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(201,138,32,.6);
  margin: 0;
}

.htp-head h2 {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.85rem;
  font-weight: 400;
  color: var(--paper);
  margin: 0;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1;
}

.htp-head .icon-btn,
.ad-head .icon-btn {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.28);
  color: rgba(255,255,255,.85);
  font-size: 1.15rem;
  flex-shrink: 0;
}
.htp-head .icon-btn:hover,
.ad-head .icon-btn:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.55);
  color: #fff;
}

.htp-body {
  padding: .35rem 0 1rem;
  overflow-y: auto;
  background: var(--paper);
}

/* ── Accordion sections ───────────────────────────────────────── */
.htp-accord {
  border-bottom: 1px solid rgba(0,0,0,.09);
  margin: 0;
}
.htp-accord:last-child { border-bottom: none; }

.htp-accord summary.htp-accord-title {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .78rem 1.35rem;
  font-family: 'Oswald', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  user-select: none;
  gap: .5rem;
  transition: background .12s;
}
.htp-accord summary.htp-accord-title::-webkit-details-marker { display: none; }
.htp-accord summary.htp-accord-title::marker { display: none; }
.htp-accord summary.htp-accord-title:hover { background: rgba(13,34,64,.04); }

.htp-accord-subtitle {
  font-size: .65rem;
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--muted);
  text-transform: none;
}

.htp-accord summary.htp-accord-title::after {
  content: '+';
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  color: var(--muted);
  flex-shrink: 0;
  line-height: 1;
}
.htp-accord[open] > summary.htp-accord-title::after { content: '\2212'; }
.htp-accord[open] > summary.htp-accord-title { color: var(--red); }

.htp-accord-body {
  padding: .1rem 1.35rem 1rem;
}

/* Keep existing content-class styles working inside accordion body */
.htp-section h3 {
  font-family: 'Oswald', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 .6rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--line);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.htp-section p {
  font-family: 'Lora', serif;
  font-size: .9rem;
  line-height: 1.68;
  color: var(--ink);
  margin: 0 0 .4rem;
}
.htp-section p:last-child { margin-bottom: 0; }
.htp-section ul {
  font-family: 'Lora', serif;
  font-size: .9rem;
  line-height: 1.68;
  color: var(--ink);
  margin: 0;
  padding-left: 1.25rem;
}
.htp-section li { margin-bottom: .3rem; }
.htp-section strong { color: var(--navy); }

/* Priority list — draft strategy cards */
.htp-priority-list {
  display: grid;
  gap: .4rem;
  margin: .5rem 0 .7rem;
}

.htp-priority-list div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: .6rem;
  align-items: center;
  padding: .6rem .75rem;
  background: var(--navy);
  border-radius: 5px;
}

.htp-priority-list strong {
  font-family: 'Oswald', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
}

.htp-priority-list span {
  color: rgba(253,252,245,.78);
  font-family: 'Lora', serif;
  font-size: .83rem;
  line-height: 1.45;
}

.htp-badge-key {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: .38rem .55rem;
  align-items: center;
  margin-top: .55rem;
}

.htp-badge-key em {
  color: rgba(253,252,245,.82);
  font-family: 'Lora', serif;
  font-size: .84rem;
  font-style: normal;
  line-height: 1.35;
}

/* ── New icon-based badge key ─────────────────────── */
.htp-badge-key-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .4rem;
  margin-top: .55rem;
}

.htp-badge-row {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  background: var(--navy);
  border-radius: 5px;
  padding: .45rem .65rem;
}

.htp-award-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  margin-top: .1rem;
}

.htp-badge-row div { display: flex; flex-direction: column; gap: .08rem; }
.htp-badge-row strong { font-family: 'Oswald', sans-serif; font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: var(--gold); }
.htp-badge-row em { font-family: 'Lora', serif; font-size: .74rem; color: rgba(253,252,245,.7); font-style: normal; line-height: 1.3; }

/* ── Mode logo in HTP ─────────────────────────────── */
.htp-mode-img-wrap { flex-shrink: 0; }
.htp-mode-img { width: 38px; height: 38px; object-fit: contain; display: block; }

/* ── Leaderboard logo in HTP ──────────────────────── */
.htp-lb-head { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .4rem; }
.htp-lb-logo { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; margin-top: .1rem; }

/* Sim categories grid */
.htp-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .45rem;
  margin: .6rem 0 .7rem;
}

.htp-score-grid div {
  background: var(--paper-dark);
  border: 1.5px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: 4px;
  padding: .55rem .75rem;
}

.htp-score-grid div:nth-child(3) {
  border-left-color: #4a7a60;
}

.htp-score-grid strong {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: .18rem;
}

.htp-score-grid span {
  font-family: 'Lora', serif;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ── HTP slot groups ───────────────────────────────── */
.htp-slot-groups {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin: .55rem 0 .7rem;
}
.htp-slot-group {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: .3rem .5rem;
  align-items: center;
}
.htp-slot-label {
  font-family: 'Oswald', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.htp-slot-strip { display: flex; flex-wrap: wrap; gap: .28rem; }
.htp-slot-chip {
  font-family: 'Oswald', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--navy);
  color: var(--paper);
  padding: .15rem .4rem;
  border-radius: 3px;
}
.htp-slot-chip.pitch { background: var(--red); }
.htp-slot-chip.special { background: var(--gold); color: var(--navy); }
.htp-slot-chip.mgr { background: #4a3a0a; color: var(--gold); }

/* ── HTP threshold grid (162-0 requirements) ───── */
.htp-threshold-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .3rem;
  margin: .5rem 0 .6rem;
}
.htp-threshold-item {
  background: var(--paper-dark);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .38rem .65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .4rem;
}
.htp-threshold-item strong {
  font-family: 'Oswald', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  color: var(--navy);
}
.htp-threshold-item span {
  font-family: 'Oswald', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  color: var(--grass);
}

/* ── HTP debrief preview ───────────────────────── */
.htp-debrief-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .4rem;
  margin: .5rem 0 .6rem;
}
.htp-debrief-card {
  border-radius: 5px;
  padding: .55rem .65rem;
  border: 1.5px solid var(--line);
}
.htp-debrief-card .htp-dc-label {
  font-family: 'Oswald', sans-serif;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: .2rem;
}
.htp-debrief-card .htp-dc-title {
  font-family: 'Oswald', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  color: var(--navy);
  display: block;
  margin-bottom: .18rem;
}
.htp-debrief-card p {
  font-family: 'Lora', serif;
  font-size: .76rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}
.htp-debrief-card.strength { border-color: var(--grass); }
.htp-debrief-card.weakness { border-color: var(--red); }
.htp-debrief-card.focus    { border-color: var(--gold); }

@media (max-width: 500px) {
  .htp-threshold-grid { grid-template-columns: 1fr; }
  .htp-debrief-row { grid-template-columns: 1fr; }
  .htp-slot-group { grid-template-columns: 68px 1fr; }
}

/* Game mode rows */
.htp-modes { display: flex; flex-direction: column; gap: .5rem; }

.htp-mode-row {
  display: flex;
  gap: .65rem;
  align-items: center;
  background: var(--paper-dark);
  border: 1.5px solid var(--line);
  border-radius: 5px;
  padding: .65rem .85rem;
}

.htp-mode-tag {
  font-family: 'Oswald', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .28rem .6rem;
  border-radius: 3px;
  flex-shrink: 0;
  min-width: 78px;
  text-align: center;
}

.htp-mode-classic {
  background: var(--navy);
  color: var(--gold);
}

.htp-mode-hardball {
  background: var(--red);
  color: var(--paper);
}

.htp-mode-daily {
  background: var(--gold);
  color: var(--navy);
}

.htp-mode-dreamteam {
  background: #1e0a4a;
  color: #b8a0e8;
  border: 1.5px solid #4a2a8a;
}

.htp-mode-row span { font-family: 'Lora', serif; font-size: .88rem; color: var(--ink); line-height: 1.5; }

/* ── HTP roster card (14 slots visual) ────────────── */
.htp-roster-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem 1rem;
  background: var(--navy);
  border-radius: 6px;
  padding: .75rem 1rem;
  margin: .55rem 0 .65rem;
}

.htp-rc-col-label {
  font-family: 'Oswald', sans-serif;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(201,138,32,.8);
  margin: 0 0 .35rem;
}

.htp-rc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
}

.htp-rc-chip {
  font-family: 'Oswald', sans-serif;
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: #fff;
  padding: .16rem .44rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* ─── Player grid ───────────────────────────────────── */

.player-grid {
  columns: 2;
  column-gap: .45rem;
}

.player-group {
  break-inside: avoid;
  margin-bottom: .45rem;
  min-width: 0;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: none;
}


.player-group h3 {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .35rem;
  margin: 0;
  padding: .32rem .55rem;
  color: var(--paper);
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
  font-family: 'Oswald', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.player-group h3 span {
  color: rgba(253, 252, 245, .55);
  font-size: .76rem;
}

.player-group-sp h3 {
  background: #1a2d6e;
  border-bottom-color: rgba(140, 170, 255, .4);
}

.player-group-rp h3 {
  background: #7a1414;
  border-bottom-color: rgba(255, 160, 80, .4);
}

.player-list {
  display: grid;
  grid-template-columns: 1fr;
}

.player-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1.5fr);
  align-items: stretch;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(192, 160, 122, .38);
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
  cursor: pointer;
  transition: box-shadow .1s, background .1s;
}

.player-card:last-child { border-bottom: 0; }
.player-card.used { opacity: .38; cursor: default; }

.player-card:not(.used):hover {
  background: rgba(20, 40, 90, .04);
  box-shadow: inset 3px 0 0 0 var(--navy);
}

/* Full-height position strip */
.player-pos {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  background: var(--muted);
  border-right: 1px solid rgba(0,0,0,.12);
  padding: 0;
}

/* Per-position colors */
.player-card.position-c .player-pos      { background: #c41519; }
.player-card.position-ss .player-pos     { background: #1a4f9e; }
.player-card.position-1b .player-pos     { background: #1e7abc; }
.player-card.position-2b .player-pos     { background: #2596c8; }
.player-card.position-3b .player-pos     { background: #0d7a8e; }
.player-card.position-bat .player-pos,
.player-card.position-dh .player-pos     { background: #7a5598; }
.player-card.position-of .player-pos     { background: #2a7028; color: #fff; }
.player-card.position-p .player-pos      { background: #b87010; }
.player-card.position-mgr .player-pos    { background: #6a48b8; }

.player-main { min-width: 0; padding: .28rem .3rem .28rem .45rem; display: flex; align-items: center; }

.player-name-row {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .14rem;
}

.player-name-block { min-width: 0; flex: 1 1 auto; overflow: hidden; }

.player-card-meta { display: none; }

.player-name {
  min-width: 0;
  overflow: hidden;
  font-family: 'Lora', serif;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.player-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  flex-shrink: 0;
}

.award-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.player-num {
  font-family: 'Oswald', sans-serif;
  font-size: .65rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .02em;
  margin-left: .3em;
  white-space: nowrap;
}

.player-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
}

.scout-mode .hidden-stat {
  filter: blur(5px);
  user-select: none;
}

.scout-mode .player-badges {
  display: none;
}

.player-stat-line {
  overflow: hidden;
  font-family: 'Oswald', sans-serif;
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--muted);
  line-height: 1.2;
  padding: .28rem .45rem .28rem .3rem;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.psl-off,
.psl-def {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.psl-off {
  color: #1a5a8e;
}

.psl-def {
  font-size: .64rem;
  color: #2a7a4a;
  letter-spacing: .025em;
}

.scout-mode .slot-card.filled .slot-detail,
.scout-mode .dialog-stats { filter: none; }


/* ─── Dialogs ───────────────────────────────────────── */

/* ─── New-game confirmation dialog ──────────────────── */

.confirm-dialog {
  width: min(360px, calc(100vw - 2rem));
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 20px 56px rgba(0,0,0,.38);
  padding: 0;
}

.confirm-dialog::backdrop {
  background: rgba(13,34,64,.58);
  backdrop-filter: blur(3px);
}

.confirm-dialog-inner {
  padding: 1.75rem 1.5rem 1.5rem;
}

.confirm-dialog h3 {
  margin: 0 0 .45rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: .03em;
  color: var(--navy);
  line-height: 1;
}

.confirm-dialog p {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-family: 'Lora', serif;
  font-size: .9rem;
  line-height: 1.45;
}

.confirm-dialog-actions {
  display: flex;
  gap: .6rem;
  justify-content: center;
  align-items: center;
}

.icon-confirm-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.icon-confirm-btn img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
  transition: transform .15s ease, filter .15s ease;
}
.icon-confirm-btn:hover img { transform: scale(1.1); filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.icon-confirm-btn:active img { transform: scale(.93); }

/* ─── Score tile mobile tap tooltip ─────────────────── */

.roll-banner-team .team-summary > div.score-tile.tooltip-shown::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.assign-dialog, .spin-dialog, .result-dialog, .htp-dialog, .leaderboard-dialog {
  width: min(720px, calc(100vw - 2rem));
  border: 2px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 64px rgba(0,0,0,.35), 0 6px 16px rgba(0,0,0,.18);
  padding: 0;
}

.spin-dialog   { width: min(420px, calc(100vw - 2rem)); }
.result-dialog { width: min(820px, calc(100vw - 1rem)); max-height: calc(100svh - 1rem); overflow: hidden; }
.htp-dialog    { width: min(680px, calc(100vw - 2rem)); padding: 0; }
.leaderboard-dialog { width: min(760px, calc(100vw - 1rem)); padding: 0; }

.assign-dialog::backdrop,
.spin-dialog::backdrop,
.result-dialog::backdrop,
.htp-dialog::backdrop,
.leaderboard-dialog::backdrop {
  background: rgba(10, 20, 8, .72);
  backdrop-filter: blur(4px);
}

.assign-dialog form { padding: 1.25rem; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }

.dialog-head h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--navy);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  color: var(--navy);
  background: var(--soft);
  font-size: 1.15rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .13s, color .13s, border-color .13s;
}

.icon-btn:hover {
  background: var(--navy);
  color: var(--paper);
  border-color: var(--navy);
}

.dialog-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: .5rem;
  margin: 1rem 0;
}

.dialog-stats div {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .65rem;
  background: var(--soft);
  text-align: center;
}

.dialog-stats span {
  display: block;
  color: var(--muted);
  font-family: 'Oswald', sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.dialog-stats strong {
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
}

/* ─── Assign dialog — player identity header ─────── */

.assign-buttons { display: block; overflow: hidden; }

.assign-dialog { max-height: 96vh; overflow: hidden; padding: 0; }
.assign-dialog form {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ad-head {
  background: var(--navy);
  padding: .75rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .75rem;
  align-items: center;
  border-bottom: 3px solid var(--gold);
  flex-shrink: 0;
}

.ad-pos-badge {
  background: var(--gold);
  color: var(--navy);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.9rem;
  line-height: 1;
  min-width: 3.2rem;
  padding: .22rem .55rem .18rem;
  border-radius: 4px;
  text-align: center;
  letter-spacing: .04em;
}

.ad-identity { min-width: 0; }

.ad-name {
  font-family: 'Oswald', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--paper);
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.1;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-meta {
  font-family: 'Lora', serif;
  font-size: .78rem;
  color: rgba(253,252,245,.52);
  margin: .2rem 0 0;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-close {
  flex-shrink: 0;
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.22);
  color: rgba(255,255,255,.75);
}
.ad-close:hover {
  background: rgba(255,255,255,.22);
  color: #fff;
  border-color: rgba(255,255,255,.45);
}

/* ─── Assign dialog — stat cards ──────────────────── */

.assign-dialog .dialog-stats { display: block; margin: 0; flex-shrink: 0; }

.dd-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1.5px solid var(--line);
}

.dd-stat {
  text-align: center;
  padding: .28rem .2rem .22rem;
  border-right: 1px solid var(--line);
  background: var(--paper-dark);
}
.dd-stat:nth-child(3n) { border-right: none; }
.dd-stat:nth-child(n+4) { border-top: 1px solid var(--line); }

.dd-stat span {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: .12rem;
}

.dd-stat strong {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--navy);
  line-height: 1;
  letter-spacing: .01em;
}

.dd-stat-locked {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .2rem;
  padding: .65rem 1rem .6rem;
  background: var(--paper-dark);
  border-bottom: 1.5px solid var(--line);
}
.dd-stat-locked strong {
  font-family: 'Oswald', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.dd-stat-locked span {
  font-family: 'Lora', serif;
  font-size: .72rem;
  color: var(--muted);
  font-style: italic;
}

/* ─── Dialog defense section ────────────────────────── */

.dd-def-section {
  border-bottom: 1.5px solid var(--line);
}

.dd-def-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .22rem .55rem .18rem;
  font-family: 'Oswald', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #2a7a4a;
  background: var(--paper-dark);
  border-top: 1px solid var(--line);
}

.dd-stat-grid-bat .dd-stat span { color: #1a5a8e; }
.dd-stat-grid-def .dd-stat span { color: #c41519; }

/* batting grid: 4 cols so 8 cards = 2 rows */
.dd-stat-grid-bat {
  grid-template-columns: repeat(4, 1fr);
}
.dd-stat-grid-bat .dd-stat:nth-child(3n) { border-right: 1px solid var(--line); }
.dd-stat-grid-bat .dd-stat:nth-child(4n) { border-right: none; }
.dd-stat-grid-bat .dd-stat:nth-child(n+4) { border-top: none; }
.dd-stat-grid-bat .dd-stat:nth-child(n+5) { border-top: 1px solid var(--line); }

.dd-def-label strong {
  font-family: 'Oswald', sans-serif;
  font-size: .84rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: .02em;
}

.dd-stat-grid-def {
  border-bottom: 1.5px solid var(--line);
}

/* ─── Diamond hint + field ─────────────────────────── */

.dd-hint {
  font-family: 'Oswald', sans-serif;
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  padding: .3rem .5rem .25rem;
  background: var(--navy);
  margin: 0;
  flex-shrink: 0;
}

.dd-field {
  position: relative;
  aspect-ratio: 500 / 300;
  max-height: 38vh;
  background:
    radial-gradient(ellipse 65% 45% at 50% 95%, rgba(74,150,52,.9) 0%, transparent 75%),
    radial-gradient(ellipse 100% 70% at 50% 110%, #2e6820 0%, #1a4815 50%, #123010 100%);
  overflow: hidden;
}

.dd-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Position nodes — field positions absolutely overlaid on SVG */
.dd-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: opacity .15s;
}

.dd-node[data-slot="LF"]  { left: 16%; top: 28%; }
.dd-node[data-slot="CF"]  { left: 50%; top: 11%; }
.dd-node[data-slot="RF"]  { left: 84%; top: 28%; }
.dd-node[data-slot="2B"]  { left: 57%; top: 46%; }
.dd-node[data-slot="SS"]  { left: 40%; top: 55%; }
.dd-node[data-slot="1B"]  { left: 68%; top: 65%; }
.dd-node[data-slot="3B"]  { left: 32%; top: 65%; }
.dd-node[data-slot="C"]   { left: 50%; top: 85%; }
.dd-node[data-slot="SP1"] { left: 50%; top: 69%; }

/* Strip nodes — flow in flex row inside bottom strip, not absolutely positioned */
.dd-node.strip {
  position: static;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dd-node.strip .dd-label {
  position: static;
  top: auto;
  left: auto;
  transform: none;
}

/* Slot label below each circle */
.dd-label {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Oswald', sans-serif;
  font-size: .5rem;
  font-weight: 700;
  color: rgba(255,255,255,.55);
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  line-height: 1;
}
.dd-node.eligible .dd-label  { color: rgba(201,138,32,.95); }
.dd-node.filled .dd-label    { color: rgba(80,210,60,.8); }
.dd-node.ineligible .dd-label { display: none; }

/* Circle base */
.dd-circle {
  border-radius: 50%;
  background: rgba(13,34,64,.88);
  border: 2px solid rgba(255,255,255,.38);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .12s;
  width: 40px;
  height: 40px;
  font-size: .72rem;
}

/* States */
.dd-node.eligible { cursor: pointer; }
.dd-node.eligible .dd-circle {
  border: 2.5px solid var(--gold);
  box-shadow: 0 0 10px rgba(201,138,32,.45);
  animation: pulse-gold .85s ease-in-out infinite alternate;
}
.dd-node.eligible:hover .dd-circle {
  background: rgba(201,138,32,.38);
  box-shadow: 0 0 22px rgba(201,138,32,.9), 0 0 6px rgba(255,220,80,.55);
  transform: scale(1.08);
  border-color: #ffd450;
}
.dd-node.filled .dd-circle {
  background: rgba(16,70,10,.92);
  border-color: rgba(70,200,50,.72);
  box-shadow: 0 0 8px rgba(45,175,30,.35);
}
.dd-node.ineligible { opacity: .18; pointer-events: none; }

/* "ok" fit — allowed in a pinch but not the natural slot (e.g. SP in CL) */
.dd-node.ok-fit .dd-circle {
  border: 2.5px solid #c07800;
  box-shadow: 0 0 8px rgba(192,120,0,.35);
}
.dd-node.ok-fit .dd-label { color: rgba(192,120,0,.9); }
.dd-node.ok-fit:hover .dd-circle {
  background: rgba(192,120,0,.25);
  box-shadow: 0 0 16px rgba(192,120,0,.6);
  transform: scale(1.06);
}

/* ─── Bottom strip (pitching rotation + lineup) ──────── */

.dd-wrap {
  display: flex;
  flex-direction: column;
}

.dd-bottom-strip {
  display: flex;
  flex-shrink: 0;
  background: rgba(6,18,40,.92);
  border-top: 2px solid rgba(201,138,32,.3);
  border-radius: 0 0 4px 4px;
}

.dd-strip-section {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: .2rem .3rem .18rem;
  gap: .5rem;
}

.dd-strip-left {
  border-right: 1px solid rgba(255,255,255,.1);
}

.dd-subgroup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .18rem;
}

.dd-subgroup-sep {
  border-left: 1px solid rgba(255,255,255,.15);
  padding-left: .5rem;
}

.dd-strip-label {
  font-family: 'Oswald', sans-serif;
  font-size: .5rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,220,80,.65);
  white-space: nowrap;
  margin: 0;
}

.dd-strip-nodes {
  display: flex;
  gap: .35rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Strip nodes — square pill buttons */
.dd-node.strip .dd-circle {
  width: 48px;
  height: 40px;
  font-size: .72rem;
  border-radius: 5px;
}

/* Silhouette icon inside empty nodes */
.dd-sil {
  width: 18px;
  height: 22px;
  display: block;
  fill: rgba(255,255,255,0.38);
  flex-shrink: 0;
}
.dd-node.eligible .dd-sil { fill: rgba(201,138,32,0.85); }
.dd-node.ok-fit .dd-sil   { fill: rgba(192,120,0,0.8); }
.dd-node.ineligible .dd-sil { fill: rgba(255,255,255,0.15); }

/* ─── Result dialog ─────────────────────────────────── */

.result-dialog-box {
  display: grid;
  gap: .38rem;
  height: 100%;
  max-height: calc(100svh - 1rem);
  overflow: auto;
  padding: .7rem;
}

.result-dialog .dialog-head {
  padding-bottom: .45rem;
  border-bottom: 2px solid var(--line);
}

.result-dialog-logo {
  height: 44px;
  width: auto;
  flex: 0 0 auto;
  opacity: .9;
  align-self: center;
}

.result-dialog .dialog-head { align-items: center; }

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  position: sticky;
  bottom: -.7rem;
  z-index: 3;
  padding: .4rem 0 .15rem;
  background: linear-gradient(180deg, rgba(253,252,245,0), var(--paper) 38%);
}

.result-actions button { min-height: 42px; }

.reroll-icon-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: opacity .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}

.reroll-icon-btn img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}

/* Floating reroll button — desktop only, above pitch clock */
.reroll-float-btn {
  position: fixed;
  bottom: 200px;
  right: 12px;
  z-index: 390;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: opacity .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
}
.reroll-float-btn img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
}
.reroll-float-btn:hover { opacity: .85; transform: scale(1.06); }
.reroll-float-btn:active { opacity: .65; transform: scale(.95); }
.reroll-float-btn.hidden { display: none; }

/* gic-icon-btn hover */
.gic-icon-btn:hover,
.gic-lb-icon-link:hover { opacity: .8; }
.new-game-icon-btn:hover { opacity: .85; }

.reroll-icon-btn:hover { opacity: .8; transform: scale(1.06); }
.reroll-icon-btn:active { opacity: .65; transform: scale(.97); }

.new-game-icon-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: opacity .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}

.new-game-icon-btn img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}

.new-game-icon-btn:hover { opacity: .8; transform: scale(1.06); }
.new-game-icon-btn:active { opacity: .65; transform: scale(.97); }

#shareResultBtn {
  border-color: #9a1010;
  color: var(--paper);
  background: var(--red);
  box-shadow: 0 5px 0 #8a0e0e, 0 8px 18px rgba(196,21,25,.3);
}
#shareResultBtn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 6px 0 #8a0e0e, 0 10px 22px rgba(196,21,25,.38);
}
#shareResultBtn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #8a0e0e, 0 3px 8px rgba(196,21,25,.22);
}


.leaderboard-box {
  display: grid;
  gap: .75rem;
  max-height: min(760px, calc(100svh - 1rem));
  overflow: auto;
  padding: .9rem;
}

.leaderboard-dialog .dialog-head {
  padding-bottom: .65rem;
  border-bottom: 2px solid var(--line);
}

.lb-dialog-title-row { display: flex; align-items: center; gap: .4rem; }
.lb-dialog-logo { height: 2rem; width: auto; display: block; }
.lb-dialog-title-row h2 { margin: 0; }

.lb-tabs {
  display: flex;
  gap: .35rem;
  padding: .5rem .75rem 0;
  border-bottom: 2px solid var(--line);
}
.lb-tab {
  padding: .38rem .85rem;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  font-family: 'Oswald', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.lb-tab:hover { color: var(--navy); }
.lb-tab.active { color: var(--navy); border-bottom-color: var(--gold); }

.leaderboard-form {
  display: grid;
  gap: .35rem;
  padding: .75rem;
  border: 1.5px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 4px;
  background: var(--soft);
}

.leaderboard-form label {
  color: var(--navy);
  font-family: 'Oswald', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.leaderboard-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
}

.leaderboard-form input {
  min-width: 0;
  padding: .68rem .75rem;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--paper);
  font-size: 1rem;
}

.leaderboard-form p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  font-style: italic;
}

.leaderboard-list {
  display: grid;
  gap: .4rem;
}

.leaderboard-empty {
  margin: 0;
  padding: 1rem;
  border: 1.5px dashed var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: rgba(253,252,245,.65);
  font-style: italic;
}

.leaderboard-table {
  display: grid;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1.5fr) 92px 108px;
  gap: .5rem;
  align-items: center;
  padding: .55rem .65rem;
  border-top: 1px solid rgba(200,184,152,.7);
  font-family: 'Oswald', sans-serif;
  font-size: .88rem;
}

.leaderboard-row:first-child { border-top: 0; }

.leaderboard-head {
  color: rgba(253,252,245,.7);
  background: var(--navy);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.leaderboard-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: 'Lora', serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-row-expandable { cursor: pointer; position: relative; }
.lb-row-expandable:hover { background: rgba(13,34,64,.05); }
.lb-row-expandable::after {
  content: "See Roster ▾";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--navy);
  color: var(--paper);
  font-family: 'Oswald', sans-serif;
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .15rem .45rem;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.lb-row-expandable:hover::after { opacity: 1; }
.lb-row-open { background: rgba(13,34,64,.06) !important; }
.lb-row-open::after { content: "Hide ▴"; }
.lb-row-open:hover::after { opacity: 1; }

.lb-roster-panel {
  background: rgba(13,34,64,.03);
  border-top: 1px solid rgba(200,184,152,.5);
  padding: .45rem .7rem .55rem;
}

.lb-rp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .22rem .75rem;
}

.lb-rp-entry {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-width: 0;
}

/* Colored position badge — mirrors draft screen chips */
.lb-rp-badge {
  flex-shrink: 0;
  font-family: 'Oswald', sans-serif;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  background: var(--muted);
  border-radius: 3px;
  padding: .1rem .28rem;
  min-width: 1.9rem;
  text-align: center;
  line-height: 1.5;
}

.lb-rp-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lb-rp-name {
  font-family: 'Oswald', sans-serif;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-rp-meta {
  font-family: 'Oswald', sans-serif;
  font-size: .62rem;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

@media (max-width: 400px) {
  .lb-rp-grid { grid-template-columns: 1fr; }
}

/* ─── Result hero — unified scoreboard bar ────────── */

.result-hero {
  display: flex;
  align-items: stretch;
  border-radius: 5px;
  overflow: hidden;
  border: 1.5px solid var(--navy);
  background: linear-gradient(135deg, var(--navy) 0%, #091830 100%);
}

.result-hero div {
  padding: .55rem .85rem;
  background: transparent;
  border: none;
  border-radius: 0;
}

.result-hero div:first-child {
  flex: 1;
  border-right: 1px solid rgba(255, 255, 255, .12);
  background: transparent;
}

.result-hero div:last-child {
  min-width: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.result-hero span {
  display: block;
  margin-bottom: .14rem;
  color: rgba(253, 252, 245, .5);
  font-family: 'Oswald', sans-serif;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.result-hero strong {
  display: block;
  color: var(--paper);
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 400;
  line-height: .92;
}

/* Rating side — smaller, color by grade */
.result-hero div:last-child strong {
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
}

.result-hero strong.elite { color: #5dcc75; }
.result-hero strong.good  { color: var(--gold); }
.result-hero strong.ok    { color: #7bc4e8; }
.result-hero strong.bad   { color: #e86060; }

.rh-out-of {
  font-style: normal;
  font-size: .8em;
  opacity: .6;
  font-weight: 400;
}

.rh-badge {
  display: inline-block;
  margin-top: .22rem;
  font-family: 'Oswald', sans-serif;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .1rem .38rem;
  border-radius: 3px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(253,252,245,.75);
}

.rh-badge-perfect {
  background: rgba(93,204,117,.15);
  border-color: rgba(93,204,117,.4);
  color: #5dcc75;
}

.rh-badge-star {
  background: rgba(201,138,32,.18);
  border-color: rgba(201,138,32,.4);
  color: var(--gold);
}

/* ─── Result score grid ─────────────────────────────── */

.result-score-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .3rem;
}

.result-score-grid div {
  min-width: 0;
  padding: .28rem .18rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  text-align: center;
}

.result-score-grid div.elite { border-top-color: var(--grass); }
.result-score-grid div.good { border-top-color: var(--gold); }
.result-score-grid div.ok { border-top-color: var(--sky); }
.result-score-grid div.bad { border-top-color: var(--red); }

.result-score-grid span {
  display: block;
  color: var(--muted);
  font-family: 'Oswald', sans-serif;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.result-score-grid strong {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.result-score-grid small {
  display: block;
  margin-top: .05rem;
  color: var(--muted);
  font-size: .54rem;
  line-height: 1.12;
}

/* ─── Postgame feedback ─────────────────────────────── */

.postgame-feedback { display: grid; gap: .55rem; }

.postgame-feedback h3 {
  margin: .1rem 0 0;
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--navy);
}

.postgame-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .4rem;
}

.postgame-card {
  min-width: 0;
  padding: .55rem .6rem;
  border: 1.5px solid var(--line);
  border-top-width: 5px;
  border-radius: 4px;
  background: var(--paper);
}

.postgame-card.good  { border-top-color: var(--grass); }
.postgame-card.warn  { border-top-color: var(--red); }
.postgame-card.focus { border-top-color: var(--gold); }

.postgame-card span {
  display: block;
  color: var(--muted);
  font-family: 'Oswald', sans-serif;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.postgame-card strong {
  display: block;
  margin: .18rem 0 .3rem;
  color: var(--navy);
  font-family: 'Lora', serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.postgame-card p {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.42;
  margin-bottom: 0;
  font-style: italic;
}

.postgame-card ul {
  margin: .25rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}

.postgame-card li { margin-bottom: .18rem; }

/* score badge on strength/weakness cards */
.pgc-score {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-size: .68rem;
  font-weight: 700;
  font-style: normal;
  letter-spacing: .06em;
  padding: .08rem .28rem;
  border-radius: 3px;
  margin: .1rem 0 .3rem;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
}
.pgc-score.elite { color: var(--grass); border-color: var(--grass); }
.pgc-score.good  { color: var(--gold);  border-color: var(--gold); }
.pgc-score.ok    { color: #1a5a8e; }
.pgc-score.bad   { color: var(--red);   border-color: var(--red); }

/* next-build tip paragraph (no strong, just direct text) */
.pgc-tip {
  color: var(--navy);
  font-size: .88rem;
  line-height: 1.38;
  font-weight: 600;
  margin-bottom: .25rem;
}

/* ─── Debrief card header (score on right) ──────────── */

.pgc-header {
  display: flex;
  align-items: stretch;
  gap: .45rem;
  margin-bottom: .3rem;
}

.pgc-text {
  flex: 1;
  min-width: 0;
}

.pgc-text span {
  display: block;
  color: var(--muted);
  font-family: 'Oswald', sans-serif;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: .1rem;
}

.pgc-text strong {
  display: block;
  color: var(--navy);
  font-family: 'Lora', serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.pgc-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 2.8rem;
  padding: .18rem .3rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  text-align: center;
}

.pgc-tier {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--navy);
  line-height: 1.15;
}

.pgc-num {
  display: block;
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
  color: var(--muted);
  opacity: .75;
}

/* override generic .postgame-card span for score block spans */
.pgc-score-block span {
  letter-spacing: normal;
  text-transform: none;
  font-size: unset;
  font-family: inherit;
  color: inherit;
  margin: 0;
}

.pgc-score-block.elite .pgc-tier { color: var(--grass); }
.pgc-score-block.good  .pgc-tier { color: #a07010; }
.pgc-score-block.ok    .pgc-tier { color: #1a5a8e; }
.pgc-score-block.bad   .pgc-tier { color: var(--red); }
.pgc-score-block.elite { border-color: rgba(42,96,32,.35); background: rgba(42,96,32,.06); }
.pgc-score-block.good  { border-color: rgba(201,138,32,.4); background: rgba(201,138,32,.07); }
.pgc-score-block.ok    { border-color: rgba(26,90,142,.3); background: rgba(26,90,142,.05); }
.pgc-score-block.bad   { border-color: rgba(196,21,25,.3); background: rgba(196,21,25,.05); }

/* ─── Result note / formula / insight ──────────────── */

.result-note {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.48;
  margin-bottom: 0;
  font-style: italic;
}

.formula-card {
  padding: .6rem .7rem;
  border: 1.5px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 4px;
  background: rgba(201, 138, 32, .05);
}

.formula-card h3 {
  margin-bottom: .45rem;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--navy);
}

/* score breakdown table inside formula-card */
.formula-breakdown {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0 .6rem;
  margin-bottom: .45rem;
}

.fb-row {
  display: contents;
}

.fb-row span, .fb-row strong {
  padding: .18rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .82rem;
  line-height: 1.2;
}

.fb-row span {
  color: var(--muted);
}

.fb-row .fb-weight {
  color: var(--muted);
  font-size: .7rem;
  text-align: right;
  opacity: .7;
}

.fb-row strong {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  color: var(--navy);
  text-align: right;
}

.fb-row strong.elite { color: var(--grass); }
.fb-row strong.good  { color: var(--gold); }
.fb-row strong.ok    { color: #1a5a8e; }
.fb-row strong.bad   { color: var(--red); }

.fb-row-total span,
.fb-row-total strong {
  border-bottom: none;
  border-top: 2px solid var(--line);
  padding-top: .25rem;
  font-weight: 700;
  color: var(--navy);
  font-size: .9rem;
}

.formula-notes {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.formula-notes li {
  margin-bottom: .2rem;
}
.formula-notes li:last-child { margin-bottom: 0; }

/* ─── Score breakdown card grid ─────────────────────── */

.formula-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .28rem;
  margin-bottom: .45rem;
}

.fcg-cell {
  padding: .3rem .35rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  text-align: center;
}

.fcg-cell.elite { border-top-color: var(--grass); }
.fcg-cell.good  { border-top-color: var(--gold); }
.fcg-cell.ok    { border-top-color: #1a5a8e; }
.fcg-cell.bad   { border-top-color: var(--red); }

.fcg-top {
  font-family: 'Oswald', sans-serif;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .18rem;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .25rem;
}

.fcg-weight {
  opacity: .6;
  font-size: .54rem;
  font-weight: 400;
  letter-spacing: .04em;
}

.fcg-score {
  font-family: 'Oswald', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.fcg-cell.elite .fcg-score { color: var(--grass); }
.fcg-cell.good  .fcg-score { color: #9a6800; }
.fcg-cell.ok    .fcg-score { color: #1a5a8e; }
.fcg-cell.bad   .fcg-score { color: var(--red); }

.fcg-total {
  grid-column: 1 / -1;
  border-top-width: 3px;
  border-top-color: var(--navy);
  background: rgba(13,34,64,.05);
}

.fcg-total .fcg-top { color: var(--navy); }

.fcg-total .fcg-score {
  font-size: 1.5rem;
  color: var(--navy);
}

/* ─── Result roster ─────────────────────────────────── */

.result-roster {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .22rem;
}

.result-roster h3 {
  grid-column: 1 / -1;
  margin-bottom: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--navy);
}

.result-roster-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: .35rem;
  align-items: center;
  min-width: 0;
  padding: .24rem .34rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
}

.result-roster-row strong {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--muted);
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: .15rem .12rem;
  align-self: stretch;
}

/* CL card is the 13th slot — pin it to column 4 so it aligns under SP3 */
.result-roster-primary .result-roster-row:last-child {
  grid-column-start: 4;
}

/* Per-position badge colors — mirrors draft screen player-pos palette */
.rrr-pos-c strong    { background: #c41519; }
.rrr-pos-ss strong   { background: #1a4f9e; }
.rrr-pos-1b strong   { background: #1e7abc; }
.rrr-pos-2b strong   { background: #2596c8; }
.rrr-pos-3b strong   { background: #0d7a8e; }
.rrr-pos-of strong   { background: #2a7028; }
.rrr-pos-dh strong   { background: #7a5598; }
.rrr-pos-util strong { background: #7a5598; }
.rrr-pos-sp strong   { background: #b87010; }
.rrr-pos-cl strong   { background: #8b5e14; }
.rrr-pos-mgr strong  { background: #6a48b8; }

/* Note: .rrr-name has its own rule; this is intentionally removed so .player-badge
   spans are not given overflow:hidden, which was clipping award text at both ends. */

.rrr-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .04rem;
}

.rrr-name {
  font-family: 'Lora', serif;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rrr-year {
  font-family: 'Oswald', sans-serif;
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .03em;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rrr-stat {
  font-family: 'Oswald', sans-serif;
  font-size: .57rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Spin dialog ───────────────────────────────────── */

.spin-dialog {
  width: min(520px, calc(100vw - 2rem));
  padding: 0;
  border: none;
  border-radius: 6px;
  overflow: hidden;
  background: var(--navy);
}

.spin-dialog::backdrop { background: rgba(0,0,0,.72); }

.spin-box {
  padding: 2.2rem 2rem 2.6rem;
  text-align: center;
  background: var(--navy);
  border-top: 4px solid var(--gold);
}

.spin-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: .6rem;
  animation: spinRock 1.6s ease-in-out infinite;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,.5));
}

.spin-box.spin-landed .spin-logo {
  animation: none;
  transform: scale(1.06);
}

@keyframes spinRock {
  0%   { transform: scale(.93) rotate(-7deg); }
  50%  { transform: scale(1.04) rotate(7deg); }
  100% { transform: scale(.93) rotate(-7deg); }
}

.spin-eyebrow {
  font-family: 'Oswald', sans-serif;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin: 0 0 1.2rem;
}

.spin-drum-wrap {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
}

#spinTitle {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: .06em;
  color: rgba(242, 232, 184, .85);
  margin: 0;
  line-height: 1;
  transition: color .2s;
}

#spinTitle.spin-changing {
  animation: spinFlip .09s ease-out both;
}

#spinMeta {
  font-family: 'Oswald', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin: 0;
  min-height: 1.1em;
}

.spin-box.spin-landed #spinTitle {
  color: var(--gold);
  font-size: 3.4rem;
}

.spin-box.spin-landed #spinMeta {
  color: rgba(255,255,255,.6);
}

.spin-skip-btn {
  display: none;
  margin: 1.4rem auto 0;
  padding: .45rem 1.4rem;
  background: transparent;
  border: 1.5px solid var(--gold);
  border-radius: 4px;
  color: var(--gold);
  font-family: 'Oswald', sans-serif;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.spin-skip-btn:hover { background: var(--gold); color: var(--navy); }

.spin-box.spin-landed .spin-skip-btn {
  display: block;
  animation: spinFlip .18s ease-out both;
}

@keyframes spinFlip {
  0%   { opacity: .2; transform: translateY(-6px) scaleY(.88); }
  100% { opacity: 1;  transform: translateY(0)    scaleY(1); }
}

@keyframes slideSpin {
  from { transform: translateX(0); }
  to   { transform: translateX(140%); }
}

/* ─── Inline result box ─────────────────────────────── */

.result-box { border-left: 5px solid var(--grass); }

.result-box h3 {
  color: var(--grass);
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .35rem;
}

.result-box .big-record {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 3.2rem;
  font-weight: 400;
  line-height: 1;
  margin: .4rem 0;
  color: var(--navy);
}

/* ─── Site footer ───────────────────────────────────── */

.site-footer {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  color: #2a3a1e;
  font-size: .8rem;
  line-height: 1.6;
  text-align: center;
  font-style: italic;
  text-shadow: 0 1px 4px rgba(255,255,255,.55);
}

/* Hide site-footer on home screen — .mobile-home-footer inside the section handles links instead */
.home-screen:not(.hidden) ~ .site-footer { display: none; }

.site-footer p { margin-bottom: .45rem; }

.footer-data { font-style: normal; }

.site-footer a {
  color: var(--navy);
  font-weight: 700;
  font-style: normal;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(13, 34, 64, .4);
  font-family: 'Oswald', sans-serif;
  font-size: .78rem;
  letter-spacing: .03em;
  transition: color .15s, text-decoration-color .15s;
}

.site-footer a:hover {
  color: var(--red);
  text-decoration-color: var(--red);
}

.footer-sep {
  margin: 0 .5rem;
  opacity: .5;
}

.footer-legal {
  margin-top: .6rem;
  font-size: .72rem;
  opacity: .7;
}

.footer-coming-soon {
  margin-top: .55rem;
  font-family: 'Oswald', sans-serif;
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(201,138,32,.55);
}

/* ─── Name prompt dialog ────────────────────────────── */

.name-prompt-dialog {
  width: min(420px, calc(100vw - 2rem));
  border: 2px solid var(--gold);
  border-radius: 10px;
  background: var(--navy);
  color: var(--paper);
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 12px 48px rgba(0,0,0,.55);
}

.name-prompt-dialog::backdrop {
  background: rgba(10,20,8,.75);
  backdrop-filter: blur(4px);
}

.name-prompt-eyebrow {
  font-family: 'Oswald', sans-serif;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 .3rem;
}

.name-prompt-record {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: .04em;
  color: var(--paper);
  margin: 0 0 .2rem;
  line-height: 1.1;
}

.name-prompt-sub {
  font-family: 'Lora', serif;
  font-size: .88rem;
  color: rgba(253,252,245,.7);
  margin: 0 0 1.25rem;
  font-style: italic;
}

.name-prompt-form { display: flex; flex-direction: column; gap: .75rem; }

.name-prompt-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: .6rem;
}

.name-prompt-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.name-prompt-field label {
  font-family: 'Oswald', sans-serif;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(253,252,245,.6);
}

.name-prompt-field input {
  padding: .6rem .75rem;
  border: 1.5px solid rgba(253,252,245,.2);
  border-radius: 5px;
  background: rgba(255,255,255,.07);
  color: var(--paper);
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  width: 100%;
}

.name-prompt-field input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255,255,255,.11);
}

.name-prompt-field input::placeholder { color: rgba(253,252,245,.3); }

.name-prompt-error {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: .75rem;
  font-weight: 500;
  color: #ff8080;
  letter-spacing: .03em;
}

.name-prompt-actions {
  display: flex;
  gap: .6rem;
  align-items: center;
  margin-top: .25rem;
}

.name-prompt-actions .primary-btn { flex: 1; }

.name-prompt-actions .ghost-btn {
  background: transparent;
  color: rgba(253,252,245,.75);
  border-color: rgba(253,252,245,.3);
  font-size: .8rem;
  padding: .55rem .9rem;
}

.name-prompt-actions .ghost-btn:hover { color: var(--paper); border-color: rgba(253,252,245,.45); }

/* ─── Privacy page ──────────────────────────────────── */

.privacy-page {
  background-position: center top;
}

.privacy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 .25rem;
}

.privacy-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.privacy-logo-link img {
  display: block;
  width: clamp(180px, 28vw, 320px);
  height: auto;
  filter: drop-shadow(0 5px 16px rgba(0,0,0,.4));
}

.privacy-back-link {
  white-space: nowrap;
}

.privacy-shell {
  width: min(900px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.privacy-hero {
  margin: .75rem 0 1.25rem;
  padding: 1.5rem 0 1rem;
  border-bottom: 3px solid rgba(13,34,64,.2);
}

.privacy-hero .eyebrow {
  font-size: .65rem;
  letter-spacing: .18em;
  margin-bottom: .4rem;
}

.privacy-hero h1 {
  margin-bottom: .3rem;
  color: var(--navy);
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: .92;
  text-transform: uppercase;
}

.privacy-hero-date {
  color: var(--muted);
  font-family: 'Lora', serif;
  font-size: .85rem;
  font-style: italic;
  margin: 0;
}

.privacy-card {
  margin: 0 0 .85rem;
  padding: 1.1rem 1.25rem;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: rgba(245, 236, 211, .94);
  box-shadow: 0 4px 18px rgba(20,40,15,.1);
}

/* The short version card — stands out with navy treatment */
.privacy-card-featured {
  background: var(--navy);
  border-color: var(--gold);
  box-shadow: 0 8px 28px rgba(13,34,64,.35);
}

.privacy-card-featured h2 {
  color: var(--gold) !important;
}

.privacy-card-featured p {
  color: rgba(253,252,245,.82) !important;
  font-size: .92rem !important;
}

.privacy-card h2 {
  margin-bottom: .45rem;
  color: var(--navy);
  font-size: 1.3rem;
  line-height: 1.1;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.privacy-card p,
.privacy-card li {
  color: var(--ink);
  font-family: 'Lora', serif;
  font-size: .92rem;
  line-height: 1.62;
}

.privacy-card p:last-child,
.privacy-card ul:last-child {
  margin-bottom: 0;
}

.privacy-card ul {
  margin: .3rem 0 0;
  padding-left: 1.3rem;
}

.privacy-card li { margin-bottom: .3rem; }

.privacy-card a {
  color: var(--navy);
  font-weight: 700;
}

.privacy-footer {
  padding-top: .25rem;
}

/* ─── Responsive ────────────────────────────────────── */

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .home-screen { min-height: 100svh; }
  .mode-ball { width: clamp(56px, min(20vw, 17svh), 135px); height: clamp(56px, min(20vw, 17svh), 135px); }
  .mode-card-classic .mode-ball { width: clamp(56px, min(20vw, 17svh), 135px); height: clamp(56px, min(20vw, 17svh), 135px); }
  .mode-card-dream .mode-ball { width: clamp(56px, min(20vw, 17svh), 135px); height: clamp(56px, min(20vw, 17svh), 135px); }
  .privacy-header { align-items: flex-start; }
  .privacy-logo-link img { width: clamp(160px, 48vw, 240px); }
  .privacy-back-link { padding: .55rem .7rem; font-size: .7rem; }
  .roll-banner-inner { grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: .5rem; }
  .roll-banner-right { justify-content: flex-start; flex-wrap: wrap; }
  .roll-banner-team .team-summary { flex-wrap: wrap; }
  .rolled-team-name { font-size: clamp(1.55rem, 7.5vw, 2.2rem); }
  .slot-grid, .dialog-stats, .result-score-grid, .postgame-card-grid { grid-template-columns: 1fr 1fr; }
  .result-hero { flex-direction: column; }
  .result-hero div:first-child { border-right: none; border-bottom: 1px solid rgba(255,255,255,.12); }
  .result-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-roster-primary .result-roster-row:last-child { grid-column-start: 1; }
  .leaderboard-row { grid-template-columns: 48px minmax(0, 1fr) 76px 82px; }
}

@media (max-width: 520px) {
  .dialog-stats, .result-score-grid { grid-template-columns: 1fr; }
  /* Keep debrief 2-col even on small phones — 3rd card spans full width */
  .postgame-card-grid { grid-template-columns: 1fr 1fr; }
  .result-roster { grid-template-columns: 1fr; }
  /* Keep result screen roster 2-col even on small phones */
  .result-roster-primary.result-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-actions { grid-template-columns: 1fr; }
  .leaderboard-form > div { grid-template-columns: 1fr; }
  .leaderboard-row {
    grid-template-columns: 42px minmax(0, 1fr) 68px 72px;
    gap: .35rem;
    padding: .48rem .5rem;
    font-size: .8rem;
  }
  .htp-priority-list div { grid-template-columns: 80px minmax(0, 1fr); gap: .35rem; }
  .result-roster-row { grid-template-columns: 50px 1fr; }
  .brand-mark { padding: .5rem .65rem .55rem; }
  .slot-card { grid-template-columns: 48px minmax(0, 1fr); }
}

/* ─────────────────────────────────────────────────────
   Mobile-only elements — never visible on desktop
   ───────────────────────────────────────────────────── */
.mobile-home-brand,
.mobile-mode-info,
.mobile-bottom-nav,
.mobile-lineup-pill,
.mobile-reroll-pill,
.mobile-home-footer,
.rsc-record-block,
.rsc-brand,
.result-mobile-cta,
.rsc-score-grid-mobile { display: none; }

/* .mobile-home-footer is shown on desktop home screen too — desktop styles below */
.mobile-home-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .2rem .75rem;
  margin-top: auto;
  padding-top: .5rem;
  width: 100%;
  flex-shrink: 0;
}

.mobile-home-footer a {
  font-family: 'Oswald', sans-serif;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
  opacity: .75;
}

.mobile-home-footer a:hover { opacity: 1; }

.mobile-home-footer .mhf-sep {
  color: var(--navy);
  opacity: .35;
  font-size: .6rem;
}

.mhf-coming-soon {
  width: 100%;
  margin: .2rem 0 0;
  font-family: 'Oswald', sans-serif;
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: .55;
  text-align: center;
}

.visit-counter {
  width: 100%;
  margin-top: .35rem;
  font-family: 'Oswald', sans-serif;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  pointer-events: none;
  user-select: none;
  min-height: .9rem;
}

@media (min-width: 641px) {
  .mobile-home-brand,
  .mobile-mode-info,
  .mobile-bottom-nav,
  .mobile-lineup-pill,
  .mobile-reroll-pill,
  .rsc-record-block,
  .rsc-brand,
  .result-mobile-cta { display: none !important; }
}

/* ══════════════════════════════════════════════════════
   MOBILE LAYOUT — A Perfect Draft / Baseball 162-0
   Phone-only responsive layer · max-width: 640px
   All desktop styles intact above this block.
   ══════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── HOME SCREEN ──────────────────────────────────── */

  .home-screen {
    height: 100svh;
    max-height: 100svh;
    overflow: hidden;
    padding: clamp(.4rem, 1.5svh, 1rem) 1.25rem clamp(.4rem, 1.5svh, 1rem);
    gap: clamp(.2rem, 1.2svh, .8rem);
    justify-content: flex-start;
  }

  /* Logo gets auto top-margin so the logo+mode-panel group floats centered */
  .main-logo { margin-top: auto; }

  /* Footer back in normal flow — margin-top:auto pushes it to the bottom */
  .mobile-home-footer {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    margin-top: auto;
    padding-bottom: clamp(.3rem, 1svh, .6rem);
  }

  /* Kill the desktop negative margin — pulls logo over cards on small screens */
  .mode-panel {
    margin-top: 0;
    width: min(100%, 520px);
  }

  .mobile-home-brand { display: none; }

  /* Logo: fills most of the screen width like the desktop screenshot */
  .main-logo img {
    width: auto;
    height: auto;
    max-width: clamp(220px, 82vw, 500px);
    max-height: 34svh;
  }

  /* Subtitle text: show it like desktop */
  .mode-panel > p {
    display: block;
    font-size: clamp(.7rem, 3vw, .92rem);
    margin-bottom: clamp(.2rem, 1svh, .5rem);
  }

  /* Mode balls: 2x2 grid on mobile — constrained by both width AND height so short phones don't overflow */
  .mode-ball,
  .mode-card-classic .mode-ball,
  .mode-card-dream .mode-ball {
    width: clamp(90px, min(40vw, 17svh), 200px);
    height: clamp(90px, min(40vw, 17svh), 200px);
  }

  .mode-grid {
    grid-template-columns: repeat(2, auto);
    gap: clamp(.5rem, 3vw, 1.25rem);
  }

  .mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(.2rem, 1svh, .4rem);
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-mode-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .18rem;
    text-align: center;
  }

  .mobile-mode-info strong {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gold);
  }

  .mobile-mode-info span {
    display: none;
  }

  /* ── HOME SCREEN FOOTER LINKS (mobile color overrides) ── */

  .mobile-home-footer { gap: .25rem 1rem; padding-top: clamp(.25rem, 1svh, .75rem); }

  /* Gold mode-name labels under each ball are redundant on mobile — hide them */
  .mobile-mode-info { display: none; }

  .mobile-home-footer a { color: var(--navy); font-weight: 700; opacity: .9; text-shadow: 0 0 8px rgba(255,255,255,.55); }
  .mobile-home-footer a:hover { color: var(--navy); opacity: 1; }
  .mobile-home-footer .mhf-sep { color: var(--navy); opacity: .35; }
  .mhf-coming-soon { color: var(--navy); opacity: .6; text-shadow: 0 0 8px rgba(255,255,255,.55); }
  .visit-counter { color: var(--navy); opacity: .9; text-shadow: 0 0 8px rgba(255,255,255,.55); }

  /* ── GAME INLINE CONTROLS — stats only on mobile, transparent bg ── */

  .game-inline-controls {
    background: transparent;
    border-radius: 0;
    margin-top: .15rem;
    padding: .2rem 0;
  }

  /* Desktop action buttons hidden on mobile — floating pill takes over */
  .gic-left { display: none; }
  .gic-center { display: none; }
  .gic-right { display: none; }
  .header-reroll-btn { display: none !important; }
  .roll-banner-team { flex: 1; }

  .roll-banner-team .team-summary {
    width: 100%;
    justify-content: space-between;
    gap: .25rem;
  }

  /* Tiles on light bg: dark text, soft background */
  .roll-banner-team .team-summary > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: .3rem .1rem;
    min-width: 0;
    background: var(--soft);
    border-color: var(--line);
  }

  .roll-banner-team .team-summary span {
    color: var(--navy);
    opacity: .55;
    font-size: .58rem;
    letter-spacing: .07em;
  }

  .roll-banner-team .team-summary strong {
    color: var(--navy);
  }

  .roll-banner-team .team-summary .banner-filled {
    background: rgba(201, 138, 32, .1);
    border-color: rgba(201, 138, 32, .65);
  }

  .roll-banner-team .team-summary .banner-filled span {
    color: var(--navy);
    opacity: .65;
  }

  .roll-banner-team .team-summary .banner-filled strong {
    color: var(--gold);
  }

  /* Use ID selectors (specificity wins) so these beat .banner-filled strong base rules */
  #battingScore, #pitchScore, #speedScore, #powerScore, #overallScore, #filledCount {
    font-size: 1.65rem;
    line-height: 1;
  }

  /* Year on its own line above team name */
  .roll-year {
    display: block;
    font-size: 1rem;
    line-height: 1.3;
  }

  .rolled-team-name { font-size: clamp(1.55rem, 7.5vw, 2.2rem); }

  /* Hide dev button on mobile */
  #devFillBtn { display: none !important; }

  /* ── FLOATING REROLL PILL (mobile only) ─────────── */

  .mobile-reroll-pill {
    position: fixed;
    bottom: 82px;
    left: 1rem;
    z-index: 890;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .15s, transform .1s;
    filter: drop-shadow(0 2px 8px rgba(16,39,80,.5));
  }

  .mobile-reroll-pill img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    display: block;
  }

  .mobile-reroll-pill:active {
    transform: scale(.93);
    opacity: .75;
  }

  /* ── LAYOUT — SINGLE COLUMN + TAB PANEL SWITCHING ── */

  .layout {
    padding: 0;
    min-height: 0;
  }

  .panel {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  /* Roster panel hidden by default (draft tab is default) */
  .roster-panel {
    display: none;
  }

  /* Lineup tab active */
  body.mobile-tab-lineup .roster-panel  { display: block; }
  body.mobile-tab-lineup .players-panel { display: none; }
  body.mobile-tab-lineup .mobile-reroll-pill { display: none !important; }

  /* Room for fixed bottom nav */
  #gameScreen {
    padding-bottom: 62px;
  }

  /* ── PLAYERS PANEL HEAD ──────────────────────────── */

  .players-panel-head {
    padding: .5rem .75rem .4rem;
    gap: .5rem;
    align-items: stretch;
  }

  /* Logo stretches to fill the full height of the panel head */
  .players-head-logo {
    align-self: stretch;
    align-items: center;
  }

  .players-head-logo img {
    height: 100%;
    max-height: 88px;
    width: auto;
    object-fit: contain;
  }

  .players-head-row {
    margin-bottom: .08rem;
  }

  .rolled-team-name {
    font-size: 1.85rem;
    line-height: 1;
  }

  .players-filter-row {
    padding: .3rem .5rem;
    gap: .3rem;
    flex-wrap: nowrap;
  }

  /* Pills → themed dropdown on mobile */
  .quick-filters { display: none !important; }
  #positionFilter { display: block !important; }

  #positionFilter {
    flex-shrink: 0;
    min-width: 108px;
    background-color: var(--navy);
    color: var(--gold);
    border: 1.5px solid rgba(201,138,32,.5);
    border-radius: 6px;
    padding: .45rem 1.5rem .45rem .65rem;
    font-family: 'Oswald', sans-serif;
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .04em;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23c98a20'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .55rem center;
    background-size: 8px 5px;
  }

  .players-filter-row { align-items: center; }

  /* ── COLLAPSIBLE POSITION GROUPS ─────────────────── */

  .player-group h3 {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
  }

  .player-group h3::after {
    content: '▾';
    font-size: .7rem;
    opacity: .5;
    margin-left: auto;
    flex-shrink: 0;
    line-height: 1;
  }

  .player-group.collapsed h3::after { content: '▸'; }
  .player-group.collapsed .player-list { display: none; }

  /* ── ASSIGN DIALOG — field height fix on tall phones ─ */
  /* Constrain via vw so the field stays proportional to dialog width, not vh */
  .dd-field { max-height: 55vw; }
  /* Make the form scrollable so content above the field doesn't get clipped */
  .assign-dialog form { overflow-y: auto; }

  /* ── PLAYER CARDS — 2-LINE MOBILE LAYOUT ─────────── */

  .player-grid {
    display: block;
    columns: 1;
  }

  .player-col + .player-col {
    margin-top: .45rem;
  }

  .player-card {
    grid-template-columns: 32px 1fr;
    grid-template-rows: auto auto;
    min-height: 58px;
    align-items: start;
  }

  .player-pos {
    grid-row: 1 / 3;
    align-self: stretch;
    font-size: .65rem;
  }

  .player-main {
    grid-column: 2;
    grid-row: 1;
    align-items: flex-start;
    padding: .34rem .4rem .08rem .48rem;
  }

  .player-name-block {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  .player-name {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: .88rem;
    line-height: 1.15;
  }

  .player-card-meta {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-size: .62rem;
    font-weight: 400;
    font-style: italic;
    color: var(--muted);
    letter-spacing: .02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: .1rem;
  }

  .player-badges {
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-self: center;
  }

  .award-icon {
    width: 26px;
    height: 26px;
  }

  .player-name-row {
    flex-direction: row;
    align-items: center;
    gap: .4rem;
  }

  .player-stat-line {
    grid-column: 2;
    grid-row: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .1rem .5rem;
    font-size: .72rem;
    line-height: 1.35;
    padding: .06rem .4rem .4rem .48rem;
    align-self: start;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .psl-off,
  .psl-def {
    white-space: nowrap;
    display: inline;
  }

  .psl-def {
    font-size: .68rem;
  }

  /* ── ROSTER PANEL (LINEUP TAB) ───────────────────── */

  .roster-list-head {
    padding: .2rem .75rem .1rem;
  }

  /* Mobile: lineup logo — compact hero, everything needs to fit one screen */
  .lineup-card-logo {
    height: clamp(2.8rem, 16vw, 4.5rem);
    margin: .15rem auto .1rem;
    filter: drop-shadow(0 3px 14px rgba(0,0,0,.22));
  }

  .slot-grid {
    padding: .1rem .4rem .3rem;
    gap: .25rem;
    grid-template-columns: 1fr;
  }

  /* Compact section headers */
  .lineup-section h4 {
    padding: .25rem .55rem;
    font-size: .68rem;
  }

  /* Slim slot rows — no detail text needed on lineup tab */
  .roster-panel .slot-card {
    min-height: 34px;
  }

  .roster-panel .slot-detail {
    display: none;
  }


  .mlp-icon  { font-size: .9rem; line-height: 1; }
  .mlp-label { letter-spacing: .07em; }
  .mlp-arrow { font-size: 1.1rem; line-height: 1; opacity: .7; }

  /* ── BOTTOM NAV ──────────────────────────────────── */

  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--navy);
    border-top: 2px solid var(--gold);
    height: 70px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mbn-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: rgba(255,255,255,.42);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s, background .15s;
    min-height: 44px;
  }

  .mbn-icon {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mbn-icon img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    opacity: 0.6;
    transition: opacity .15s;
  }

  .mbn-label {
    font-family: 'Oswald', sans-serif;
    font-size: .58rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
  }

  .mbn-tab.active {
    color: var(--gold);
    background: rgba(201,138,32,.07);
  }

  .mbn-tab.active .mbn-icon img {
    opacity: 1;
  }

  .mbn-action .mbn-icon img {
    width: 72px;
    height: 72px;
    opacity: 0.85;
  }

  .mbn-leaderboard {
    text-decoration: none;
  }

  .mbn-leaderboard:hover, .mbn-leaderboard:active {
    color: var(--gold);
  }

  /* ── ASSIGN DIALOG → CENTERED MODAL ─────────────── */

  .assign-dialog {
    width: calc(100vw - 1.5rem);
    max-height: 88svh;
    overflow: hidden;
  }

  /* Flex column: header + picker fixed, stats scroll if needed */
  .assign-dialog form {
    height: 88svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .ad-head { flex-shrink: 0; }

  .assign-dialog .dialog-stats {
    flex-shrink: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .assign-buttons { flex: 1 0 auto; min-height: 0; }
  .assign-dialog .dd-wrap { height: 100%; }
  .assign-dialog .dd-field {
    flex: 1;
    height: 0;
    aspect-ratio: unset;
    max-height: none;
    border-radius: 0;
    overflow: hidden;
  }
    padding: .65rem .75rem .5rem;
    gap: .55rem;
  }

  .ad-pos-badge {
    font-size: 1.35rem;
    min-width: 2.3rem;
    padding: .14rem .38rem .1rem;
  }

  .ad-name  { font-size: 1rem; }
  .ad-meta  { font-size: .72rem; margin-top: .1rem; }

  /* Reduce circles and suit shapes on mobile */
  .dd-circle {
    width: 30px;
    height: 30px;
    font-size: .62rem;
  }

  /* Bigger tap target for field nodes — padding expands the clickable area */
  .dd-field .dd-node { padding: 6px; }

  /* Strip nodes (DH etc): large enough to tap reliably */
  .dd-node.strip {
    padding: 2px 8px;
    min-height: 38px;
    justify-content: center;
  }
  .dd-node.strip .dd-circle { width: 36px; height: 36px; font-size: .62rem; }
  .dd-strip-nodes { gap: .55rem; }

  /* ── Stats: compact, all stats visible including defense ── */
  .dd-stat { padding: .08rem .08rem .07rem; }
  .dd-stat span { font-size: .46rem; }
  .dd-stat strong { font-size: .82rem; }

  /* Defense cards flow directly after batting — batting has no bottom border, defense has it */
  .dd-stat-grid-bat { border-bottom: none; }

  .dd-hint { display: none; }

  /* Infield positions on mobile — match the SVG field geometry */
  .dd-node[data-slot="2B"]  { left: 55%; top: 53%; }
  .dd-node[data-slot="SS"]  { left: 42%; top: 57%; }
  .dd-node[data-slot="3B"]  { left: 37%; top: 67%; }
  .dd-node[data-slot="1B"]  { left: 63%; top: 67%; }

  /* ── Strip: flat row — SP2 SP3 CL | DH all at same level ── */
  .dd-strip-label { display: none; }
  .dd-subgroup { flex-direction: row; gap: .22rem; }
  .dd-strip-section {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: .22rem .2rem;
    gap: .22rem;
  }
  .dd-subgroup-sep { border-left: 1px solid rgba(255,255,255,.15); padding-left: .22rem; }
  .dd-strip-nodes { gap: .22rem; }

  /* Keep strip circles tappable */
  .dd-node.strip .dd-circle { width: 38px; height: 38px; font-size: .62rem; }
  .dd-node.strip { padding: 2px 6px; min-height: 36px; }

  .assign-buttons { min-height: 0; }

  /* ── RESULT DIALOG → SHARE CARD ─────────────────── */

  .result-dialog {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    border: 0;
    max-height: 100svh;
    overflow: hidden;
  }

  .result-dialog-box {
    position: relative;
    max-height: 100svh;
    overflow-y: auto;
    padding: 0;
    gap: 0;
  }

  /* Close button floats over share card */
  .result-dialog .dialog-head {
    position: absolute;
    top: .5rem;
    right: .5rem;
    z-index: 20;
    padding: 0;
    border: none;
    background: transparent;
  }
  .result-dialog .dialog-head > div { display: none; }
  .result-dialog-logo { display: none; }
  .result-dialog .dialog-head .icon-btn {
    background: rgba(0,0,0,.38);
    color: rgba(255,255,255,.78);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-size: .85rem;
  }

  /* Share card — compact horizontal strip on mobile */
  .result-share-card {
    display: flex;
    flex-direction: column;
    background: var(--navy);
    padding: .45rem .75rem;
  }

  /* Score grid wrapper: hidden on mobile inside the share card */
  .rsc-score-grid-desktop { display: none; }

  /* Centered vertical column — compact but aligned */
  .rsc-record-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: .06rem;
    padding: .1rem 0;
  }

  .rsc-eyebrow {
    font-family: 'Oswald', sans-serif;
    font-size: .52rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(201,138,32,.65);
    margin: 0;
  }

  .rsc-wins {
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    font-size: 1.85rem;
    line-height: .9;
    color: var(--paper);
    margin: .02rem 0 0;
    letter-spacing: .01em;
  }

  .rsc-tier {
    font-family: 'Oswald', sans-serif;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0;
  }

  /* Hide the 3-box result-hero on mobile (replaced by rsc-record-block) */
  .result-share-card .result-hero { display: none; }

  /* Hide branding line to save vertical space */
  .rsc-brand { display: none; }

  /* Logo: small centered above the record text */
  .rsc-share-logo {
    width: 42px;
    height: auto;
    margin: 0 0 .06rem;
    filter: drop-shadow(0 1px 5px rgba(0,0,0,.45));
  }

  /* Action strip between share card and roster */
  .result-mobile-cta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .22rem;
    padding: .28rem .7rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .result-mobile-cta button {
    min-height: 30px;
    padding: .22rem .3rem;
    font-size: .7rem;
    letter-spacing: .04em;
  }
  .result-mobile-cta .primary-btn {
    box-shadow: 0 3px 0 #8a0e0e, 0 4px 10px rgba(196,21,25,.22);
  }
  .result-mobile-cta .ghost-btn {
    border-color: var(--red);
    color: var(--paper);
    background: var(--red);
  }

  /* Roster — primary section, right after the CTA */
  .result-roster-primary {
    padding: .4rem .7rem .3rem;
    background: var(--paper);
    border-bottom: 2px solid var(--line);
  }
  .result-roster-primary h3 {
    font-size: .65rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 .2rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
  }

  /* 2-column compact roster so all players fit on one screen */
  .result-roster-primary.result-roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .15rem;
  }
  .result-roster-primary .result-roster-row {
    grid-template-columns: 22px minmax(0, 1fr);
    padding: .1rem .18rem;
    gap: .18rem;
  }
  /* Position badge: much smaller on mobile */
  .result-roster-primary .result-roster-row strong {
    font-size: .54rem;
    letter-spacing: .02em;
    padding: .05rem .03rem;
  }
  .result-roster-primary .rrr-name { font-size: .66rem; }
  .result-roster-primary .rrr-year { font-size: .5rem; }

  /* WHY section below the roster */
  .result-below-fold { padding: .75rem .85rem 1.5rem; }

  /* Score grid inside the WHY section on mobile */
  .rsc-score-grid-mobile { margin-bottom: .75rem; }
  .rsc-score-grid-mobile .result-score-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .22rem;
  }

  /* Hide original sticky actions on mobile */
  .result-dialog .result-actions { display: none; }

  /* Mobile debrief: 2 columns, 3rd card full-width, compact padding */
  .postgame-card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .postgame-card-grid article:last-child {
    grid-column: 1 / -1;
  }
  .postgame-card {
    padding: .4rem .45rem;
  }
  .pgc-tier { font-size: .78rem; }
  .pgc-num  { font-size: 1.1rem; }

  /* Mobile score breakdown: 2 cols (3-col is too cramped) */
  .formula-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .fcg-total { grid-column: 1 / -1; }

  /* ── HOW TO PLAY DIALOG → FULL SCREEN ────────────── */

  .htp-dialog {
    top: 0;
    bottom: 70px; /* leave footer visible */
    left: 0;
    right: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    max-height: calc(100svh - 70px);
    border-radius: 0;
    border: 0;
  }

  .htp-dialog::backdrop {
    inset-block-end: 70px;
  }

  .htp-box {
    max-height: calc(100svh - 70px);
    overflow-y: auto;
  }

  .htp-body {
    padding: 1rem .9rem;
    gap: 1.15rem;
    overflow-y: visible;
  }

  .htp-priority-list div {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: .45rem;
  }

  .htp-score-grid {
    grid-template-columns: 1fr 1fr;
  }

}

@media (max-width: 640px) and (max-height: 700px) {
  .assign-dialog {
    max-height: calc(98svh - env(safe-area-inset-bottom, 0px));
  }

  .assign-dialog form {
    height: calc(98svh - env(safe-area-inset-bottom, 0px));
  }

  .assign-dialog .dd-field { min-height: 120px; }

  /* Very small screens: keep the compact centered layout, just trim the record font slightly */
  .rsc-wins {
    font-size: 1.65rem;
  }

  .result-mobile-cta {
    padding: .2rem .55rem;
    gap: .18rem;
  }

  .result-mobile-cta button {
    min-height: 28px;
    padding: .2rem .25rem;
    font-size: .66rem;
  }
}

/* ══════════════════════════════════════════════════════
   CUSTOM BUILD MODE
══════════════════════════════════════════════════════ */

/* ─── Home screen Custom Build card ─────────────────── */

.mode-custom-row {
  width: min(760px, 100%);
  margin-top: .75rem;
}

.mode-card-custom {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: .85rem 1.2rem;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  text-align: left;
}

.mode-card-custom:hover,
.mode-card-custom:focus-visible {
  border-color: var(--navy);
  box-shadow: 0 4px 18px rgba(7,21,40,.13);
  background: #f5f0e5;
  outline: none;
}

.mode-custom-icon {
  font-size: 2.4rem;
  line-height: 1;
  flex-shrink: 0;
  filter: grayscale(.2);
}

.mode-custom-text {
  display: flex;
  flex-direction: column;
  gap: .18rem;
}

.mode-custom-text strong {
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
}

.mode-custom-text span {
  font-family: 'Lora', serif;
  font-size: .82rem;
  color: var(--muted);
  font-style: italic;
}

/* ─── Custom mode: hide roll-specific elements ───────── */

body.custom-mode .players-eyebrow,
body.custom-mode #rollTitle,
body.custom-mode #rollMeta,
body.custom-mode #rosterHelp,
body.custom-mode .players-head-logo,
body.custom-mode #rerollBtn,
body.custom-mode .gic-right,
body.custom-mode .gic-center,
body.custom-mode .mobile-reroll-pill { display: none !important; }

body.custom-mode .players-head-content { display: none; }

/* Simulate Season button stays visible; stat bar shows fill progress */
body.custom-mode #rollBtn { display: flex !important; }
body.custom-mode .gic-left { display: flex !important; }
body.custom-mode .game-inline-controls { display: flex !important; }

/* ─── Custom browse header ───────────────────────────── */

.custom-browse-head { display: none; flex: 1; min-width: 0; }

body.custom-mode .custom-browse-head { display: flex; flex-direction: column; gap: .55rem; }

.custom-browse-title h2 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 .1rem;
}

.custom-browse-title p {
  font-family: 'Lora', serif;
  font-size: .8rem;
  font-style: italic;
  color: var(--muted);
  margin: 0;
}

/* ─── Custom filter grid ─────────────────────────────── */

.custom-filter-grid {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.custom-dropdowns {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.custom-dropdowns .custom-select { flex: 1 1 120px; }

.custom-find-btn {
  flex: 0 0 auto;
  font-family: 'Oswald', sans-serif;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--navy);
  border: none;
  border-radius: 4px;
  padding: .35rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .13s;
}
.custom-find-btn:hover { background: #1a3a6e; }
.custom-find-btn:active { background: #0d2040; }

.custom-search,
.custom-select {
  font-family: 'Oswald', sans-serif;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--navy);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 4px;
  padding: .35rem .5rem;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.custom-search {
  grid-column: 1 / -1;
  font-family: 'Lora', serif;
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: 0;
}

.custom-search::placeholder { color: var(--muted); font-style: italic; }

.custom-search:focus,
.custom-select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(7,21,40,.08);
}

/* ─── Custom load status bar ─────────────────────────── */

.custom-load-status {
  font-family: 'Oswald', sans-serif;
  font-size: .68rem;
  letter-spacing: .05em;
  color: var(--muted);
  min-height: 1.1em;
}

.custom-load-status.loading { color: var(--gold); }

/* ─── Custom mode player count badge ─────────────────── */

.custom-pool-count {
  font-family: 'Oswald', sans-serif;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--muted);
  padding: .25rem .55rem;
  background: rgba(7,21,40,.06);
  border-radius: 3px;
}

@media (max-width: 760px) {
  .custom-dropdowns .custom-select { flex: 1 1 90px; }
  .custom-find-btn { width: 100%; }
  .custom-search { font-size: .8rem; }
  .mode-card-custom { padding: .7rem .9rem; gap: .8rem; }
  .mode-custom-icon { font-size: 1.8rem; }
  .mode-custom-text strong { font-size: .88rem; }
  .mode-custom-text span { font-size: .72rem; }
}

/* ── Pitch Clock + Slots Counter ─────────────────────────────── */

.pc-stack {
  position: fixed;
  bottom: 20px;
  right: 16px;
  z-index: 400;
  display: none;
  flex-direction: row;
  align-items: flex-end;
  gap: .6rem;
  pointer-events: none;
  user-select: none;
}
.pc-stack .header-reroll-btn {
  pointer-events: auto;
}

body.game-active .pc-stack { display: flex; }

.pc-slots-box {
  background: var(--navy);
  border: 1.5px solid rgba(201,138,32,.45);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  padding: .6rem .9rem .48rem;
  display: none; /* hidden on desktop; mobile shows via media query */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .22rem;
  min-width: 101px;
}

.pc-slots-label {
  font-family: 'Oswald', sans-serif;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.2;
}

.pc-slots-box #filledCount {
  font-family: 'Oswald', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(253,252,245,.95);
  line-height: 1;
}

.pitch-clock {
  pointer-events: none;
  user-select: none;
}
.pitch-clock.hidden { display: none; }

/* Outer scoreboard panel */
.pc-panel {
  background: var(--navy);
  border: 1.5px solid rgba(201,138,32,.45);
  border-radius: 8px;
  padding: .6rem .9rem .48rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .34rem;
  min-width: 101px;
}

/* Top label row with dot accents */
.pc-panel-header {
  display: flex;
  align-items: center;
  gap: .36rem;
  width: 100%;
  justify-content: center;
}
.pc-panel-label {
  font-family: 'Oswald', sans-serif;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--gold);
  text-transform: uppercase;
  white-space: nowrap;
}
.pc-panel-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(201,138,32,.45);
  flex-shrink: 0;
}

/* Dark glass screen that holds the digits */
.pc-screen {
  background: #060d16;
  border-radius: 5px;
  border: 1px solid rgba(201,138,32,.18);
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,.8),
    inset 0 0 2px rgba(0,0,0,.5);
  padding: .22rem .66rem .14rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The countdown number — single element, no overlay */
.pc-digits {
  font-family: 'Oswald', sans-serif;
  font-size: 3.12rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: #22c55e;
  text-shadow:
    0 0 4px rgba(34,197,94,.9),
    0 0 12px rgba(34,197,94,.55),
    0 0 28px rgba(34,197,94,.25);
  transition: color .2s, text-shadow .2s;
}

/* Warning state ≤7 s — shifts to amber */
.pc-digits.warning {
  color: #f5a000;
  text-shadow:
    0 0 4px rgba(245,160,0,.9),
    0 0 12px rgba(245,160,0,.55),
    0 0 28px rgba(245,160,0,.2);
}

/* Urgent state ≤5 s — red, pulse */
.pc-digits.urgent {
  color: #ff2200;
  text-shadow:
    0 0 4px rgba(255,34,0,1),
    0 0 14px rgba(255,34,0,.8),
    0 0 32px rgba(255,34,0,.4);
  animation: pc-urgent-pulse .5s ease-in-out infinite alternate;
}

@keyframes pc-urgent-pulse {
  from { opacity: 1;    text-shadow: 0 0 4px rgba(255,34,0,1), 0 0 14px rgba(255,34,0,.8), 0 0 32px rgba(255,34,0,.4); }
  to   { opacity: .55;  text-shadow: 0 0 2px rgba(255,34,0,.7), 0 0 6px rgba(255,34,0,.4); }
}

/* Drain bar — runs 45 s then resets on each new roll */
.pc-drain-track {
  width: 100%;
  height: 3px;
  background: rgba(201,138,32,.18);
  border-radius: 2px;
  overflow: hidden;
}
.pc-drain-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  width: 100%;
  transform-origin: left;
  border-radius: 2px;
  animation: pc-drain 45s linear forwards;
}
.pc-drain-fill.warning {
  background: linear-gradient(90deg, #f5a000, #d98800);
}
.pc-drain-fill.urgent {
  background: linear-gradient(90deg, #ff2200, #ff5500);
}

@keyframes pc-drain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* Slot flash when pitch clock auto-assigns */
.pitch-clock-autofill {
  animation: pitch-autofill-flash 1s ease-out forwards !important;
}
@keyframes pitch-autofill-flash {
  0%   { box-shadow: inset 0 0 0 2px #ff2200, 0 0 14px rgba(255,34,0,.5); background: rgba(255,34,0,.14); }
  60%  { box-shadow: inset 0 0 0 2px rgba(255,34,0,.25); background: rgba(255,34,0,.04); }
  100% { box-shadow: none; background: transparent; }
}

/* ── Pitch Clock violation modal ──────────────────────────────── */
.pc-penalty-dialog {
  border: 2px solid rgba(201,138,32,.55);
  border-radius: 12px;
  padding: 0;
  background: transparent;
  max-width: 340px;
  width: 92vw;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.6),
    0 20px 60px rgba(0,0,0,.8),
    0 4px 16px rgba(0,0,0,.5);
}
.pc-penalty-dialog::backdrop {
  background: rgba(4,10,22,.82);
  backdrop-filter: blur(4px);
}

.pc-penalty-inner {
  overflow: hidden;
  border-radius: 10px;
  background: var(--navy);
  display: flex;
  flex-direction: column;
}

/* Big centered violation logo */
.pc-penalty-logo-wrap {
  padding: 1.6rem 1.4rem .8rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.pc-penalty-logo {
  width: clamp(160px, 62%, 220px);
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 18px rgba(196,21,25,.45));
}

/* Body area */
.pc-penalty-body {
  padding: 0 1.1rem .9rem;
}

.pc-penalty-tagline {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: .78rem;
  color: rgba(253,252,245,.45);
  margin: 0 0 .8rem;
  text-align: center;
}

/* Player card inside modal */
.pc-penalty-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(201,138,32,.3);
  border-radius: 8px;
  padding: .7rem .85rem;
}

.pc-penalty-pos {
  background: rgba(201,138,32,.18);
  border: 1px solid rgba(201,138,32,.45);
  color: var(--gold);
  font-family: 'Oswald', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: .3rem .6rem;
  border-radius: 5px;
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.pc-penalty-info { min-width: 0; }

.pc-penalty-name {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--paper);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-penalty-team {
  font-family: 'Oswald', sans-serif;
  font-size: .68rem;
  font-weight: 400;
  color: rgba(253,252,245,.45);
  margin-top: .15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .04em;
}
.pc-penalty-slot-assign {
  font-family: 'Oswald', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  color: var(--gold);
  margin-top: .18rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Auto-dismiss progress bar */
.pc-penalty-progress-wrap {
  height: 3px;
  background: rgba(201,138,32,.15);
  overflow: hidden;
  margin-top: .5rem;
}
.pc-penalty-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #e8a020);
  width: 100%;
  transform-origin: left;
  animation: pc-bar-drain 3s linear forwards;
}
@keyframes pc-bar-drain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* Continue button */
.pc-penalty-ok {
  display: block;
  width: calc(100% - 1.6rem);
  margin: .7rem .8rem .85rem;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 6px;
  font-family: 'Oswald', sans-serif;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .68rem 1rem;
  cursor: pointer;
  box-shadow: 0 3px 0 #7a5000, 0 4px 14px rgba(201,138,32,.35);
  transition: filter .1s, transform .1s, box-shadow .1s;
}
.pc-penalty-ok:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #7a5000, 0 6px 18px rgba(201,138,32,.4);
}
.pc-penalty-ok:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #7a5000, 0 2px 6px rgba(201,138,32,.2);
}

@media (max-width: 480px) {
  .pc-stack { bottom: 64px; right: 10px; flex-direction: column; align-items: flex-end; }
  /* Pitch clock — larger on mobile */
  .pc-digits { font-size: 2.6rem; }
  .pc-panel { min-width: 88px; padding: .5rem .7rem .4rem; }
  /* Slots filled — compact on mobile */
  body.game-active .pc-slots-box {
    display: flex;
    min-width: 62px;
    padding: .28rem .45rem .22rem;
    gap: .12rem;
  }
  .pc-slots-box #filledCount { font-size: 1.25rem; }
  .pc-slots-label { font-size: .44rem; }
}


.htp-hiw-link {
  display: inline-block;
  margin-top: .6rem;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.htp-hiw-link:hover { color: var(--red); }

/* ── HTP Pitch Clock section ─────────────────────────────────── */
.htp-pitch-clock-section {
  background: rgba(196,21,25,.04);
  border-left: 3px solid var(--red);
  border-radius: 0 0 0 3px;
  padding-left: 1rem;
  margin-left: -.1rem;
}


.htp-pc-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
  margin: .75rem 0;
}
.htp-pc-rule {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 6px;
  padding: .55rem .7rem;
}
.htp-pc-rule strong {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: .2rem;
}
.htp-pc-rule span {
  font-family: 'DM Sans', sans-serif;
  font-size: .73rem;
  color: var(--muted);
  line-height: 1.4;
}

.htp-pc-states {
  display: flex;
  gap: .5rem;
  margin: .7rem 0 .6rem;
  flex-wrap: wrap;
}
.htp-pc-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .18rem;
  flex: 1;
  min-width: 80px;
  border-radius: 6px;
  padding: .45rem .5rem .4rem;
  font-family: 'Oswald', sans-serif;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.htp-pc-state span {
  font-family: 'DM Sans', sans-serif;
  font-size: .62rem;
  font-weight: 400;
  opacity: .75;
  letter-spacing: 0;
}
.htp-pc-state-green  { background: rgba(42,112,40,.1); color: #2a7028; border: 1px solid rgba(42,112,40,.2); }
.htp-pc-state-amber  { background: rgba(201,138,32,.12); color: #9a6610; border: 1px solid rgba(201,138,32,.25); }
.htp-pc-state-red    { background: rgba(196,21,25,.1); color: #c41519; border: 1px solid rgba(196,21,25,.2); }

.htp-pc-note {
  font-style: italic;
  font-size: .78rem;
  color: var(--muted);
  border-top: 1px solid rgba(0,0,0,.07);
  padding-top: .6rem;
  margin-top: .6rem;
}

@media (max-width: 480px) {
  .htp-pc-rules { grid-template-columns: 1fr; }
}

/* ─── Legend Draft mode ──────────────────────────────────────────────────────── */

/* Home screen: hidden legend mode row (shown locally via JS) */
.mode-legend-row { margin-top: .75rem; }
.mode-card-legend {
  background: none;
}
.mode-ball-legend {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Slot card golden treatment when legend is assigned */
.slot-card.legend-slot {
  border-color: var(--gold) !important;
  background: linear-gradient(to right, #fffbef, #fff8de) !important;
  box-shadow: 0 0 0 1px rgba(201,138,32,.25), inset 0 0 0 1px rgba(201,138,32,.12);
}
.slot-card.legend-slot .slot-pos {
  color: #7a5010;
  border-right-color: rgba(201,138,32,.35);
}
.legend-badge-star { color: var(--gold); }

/* Final roster row — legend hero treatment */
.result-roster-row.legend-row {
  background: var(--navy) !important;
  border-left-color: var(--gold) !important;
  border-left-width: 4px !important;
  border-top: 1px solid rgba(201,138,32,.4);
  border-bottom: 1px solid rgba(201,138,32,.4);
  border-right: 1px solid rgba(201,138,32,.25);
  box-shadow: 0 2px 16px rgba(201,138,32,.18);
  position: relative;
}
.result-roster-row.legend-row .rrr-pos {
  color: var(--gold);
  border-right-color: rgba(201,138,32,.3);
}
.result-roster-row.legend-row .rrr-name { color: var(--paper); }
.result-roster-row.legend-row .rrr-year { color: rgba(253,252,245,.6); }
.result-roster-row.legend-row .rrr-stats { color: var(--gold); }
.legend-badge {
  display: inline-flex;
  align-items: center;
  gap: .18rem;
  font-family: 'Oswald', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--navy);
  background: var(--gold);
  border: none;
  border-radius: 3px;
  padding: .06rem .35rem;
  margin-left: .35rem;
  vertical-align: middle;
  text-transform: uppercase;
}

/* Legend modal — dark navy/gold theme */
.legend-modal {
  width: min(560px, 94vw);
  max-height: 90vh;
  padding: 0;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: var(--navy);
  box-shadow: 0 24px 64px rgba(0,0,0,.55), 0 0 0 4px rgba(201,138,32,.18);
  overflow: hidden;
}
.legend-modal::backdrop { background: rgba(10,8,20,.75); backdrop-filter: blur(3px); }
.legend-modal-inner { padding: 1.4rem 1.4rem 1.5rem; overflow-y: auto; max-height: calc(90vh - 4px); background: var(--navy); }
.legend-modal-header {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid rgba(201,138,32,.3);
}
.legend-modal-logo { display: none; }
.legend-modal-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 .18rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.legend-modal-sub {
  font-size: .82rem;
  color: rgba(253,252,245,.6);
  margin: 0;
  line-height: 1.4;
}
/* Legend pick cards */
.legend-cards {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .75rem;
}
.legend-list-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 58px;
  align-items: stretch;
  min-height: 62px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px;
  background: rgba(255,255,255,.05);
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
  padding: 0;
  overflow: hidden;
}
.legend-list-row:hover {
  background: rgba(201,138,32,.13);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(201,138,32,.45), 0 3px 16px rgba(201,138,32,.18);
  position: relative;
}
.legend-list-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; z-index: 2; position: relative; }

/* Position color strip */
.legend-list-pos-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  background: var(--muted);
  flex-shrink: 0;
}
.legend-list-row.position-c    .legend-list-pos-strip { background: #c41519; }
.legend-list-row.position-ss   .legend-list-pos-strip { background: #1a4f9e; }
.legend-list-row.position-1b   .legend-list-pos-strip { background: #1e7abc; }
.legend-list-row.position-2b   .legend-list-pos-strip { background: #2596c8; }
.legend-list-row.position-3b   .legend-list-pos-strip { background: #0d7a8e; }
.legend-list-row.position-dh   .legend-list-pos-strip { background: #7a5598; }
.legend-list-row.position-of   .legend-list-pos-strip { background: #2a7028; }
.legend-list-row.position-bat  .legend-list-pos-strip { background: #7a5598; }
.legend-list-row.position-p    .legend-list-pos-strip { background: #b87010; }

/* Middle: name + team + stat */
.legend-list-main {
  min-width: 0;
  padding: .4rem .35rem .4rem .6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .15rem;
}
.legend-list-name {
  font-family: 'Lora', serif;
  font-size: .92rem;
  font-weight: 700;
  color: var(--paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}
.legend-list-team {
  font-size: .68rem;
  color: rgba(253,252,245,.5);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.legend-stat-line {
  font-family: 'Oswald', sans-serif;
  font-size: .66rem;
  font-weight: 400;
  letter-spacing: .03em;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Right: OVR rating badge */
.legend-list-ovr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .3rem .5rem .3rem .2rem;
  flex-shrink: 0;
  border-left: 1px solid rgba(255,255,255,.07);
}
.legend-list-ovr-num {
  font-family: 'Oswald', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.legend-list-ovr-label {
  font-family: 'Oswald', sans-serif;
  font-size: .5rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(201,138,32,.55);
  text-transform: uppercase;
  margin-top: .08rem;
}

/* Slot selection grid (step 2) */
.legend-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .5rem;
  margin-bottom: 1.1rem;
}
.legend-slot-btn {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  padding: .55rem .65rem;
  background: rgba(255,255,255,.05);
  cursor: pointer;
  text-align: left;
  transition: border-color .12s, background .12s;
  color: var(--paper);
}
.legend-slot-btn:hover {
  border-color: var(--gold);
  background: rgba(201,138,32,.13);
}
.legend-slot-btn:focus-visible { outline: 2px solid var(--gold); }
.legend-slot-btn-pos {
  font-family: 'Oswald', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  color: rgba(253,252,245,.5);
  letter-spacing: .06em;
  display: block;
  margin-bottom: .18rem;
}
.legend-slot-btn-name {
  font-size: .8rem;
  color: var(--paper);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.legend-modal-actions { display: flex; justify-content: center; padding-top: .3rem; }

@media (max-width: 600px) {
  .legend-list-row { grid-template-columns: 2.4rem 1fr 52px; }
  .legend-modal-inner { padding: 1rem 1rem 1.2rem; }
  .legend-modal { width: 96vw; }
}

/* ── Welcome modal ──────────────────────────────────────────── */
.welcome-dialog {
  width: min(480px, calc(100vw - 2rem));
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(0,0,0,.35), 0 6px 16px rgba(0,0,0,.18);
  padding: 0;
  overflow: hidden;
}
.welcome-dialog::backdrop {
  background: rgba(10,20,8,.72);
  backdrop-filter: blur(4px);
}
.welcome-hero {
  background: var(--navy);
  padding: 1.2rem 1.5rem 1rem;
  text-align: center;
}
.welcome-eyebrow {
  font-family: 'Oswald', sans-serif;
  font-size: .7rem; font-weight: 400;
  letter-spacing: .18em; text-transform: uppercase;
  color: rgba(253,252,245,.6); margin: 0 0 .1rem;
}
.welcome-title {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 2.4rem; letter-spacing: .04em;
  color: var(--gold); margin: 0;
}
.welcome-body { padding: 1.1rem 1.4rem 1.2rem; }
.welcome-sub {
  font-family: 'Lora', Georgia, serif;
  font-size: .88rem; line-height: 1.5;
  color: var(--ink); margin: 0 0 .9rem;
}
.welcome-modes {
  border: 1px solid var(--line);
  border-radius: 5px; overflow: hidden;
  margin-bottom: .85rem;
}
.wm-item {
  padding: .42rem .7rem;
  border-bottom: 1px solid var(--line);
  font-family: 'Oswald', sans-serif;
  font-size: .83rem; color: var(--ink);
}
.wm-item:last-child { border-bottom: none; }
.wm-item strong { color: var(--navy); }
.welcome-new-strip {
  display: flex; align-items: center; gap: .6rem;
  background: rgba(201,138,32,.08);
  border: 1px solid rgba(201,138,32,.3);
  border-radius: 5px;
  padding: .55rem .75rem;
  margin-bottom: 1rem;
  font-family: 'Oswald', sans-serif;
  font-size: .83rem; color: var(--ink);
}
.welcome-new-badge {
  font-size: .62rem; font-weight: 700;
  background: var(--gold); color: var(--navy);
  padding: .1rem .38rem; border-radius: 3px;
  letter-spacing: .06em; flex-shrink: 0;
}
.welcome-footer {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.welcome-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}
.welcome-htp-link {
  font-family: 'Oswald', sans-serif;
  font-size: .8rem; color: var(--gold);
  text-decoration: none; flex-shrink: 0;
}
.welcome-htp-link:hover { text-decoration: underline; }
.welcome-skip-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-size: .73rem;
  letter-spacing: .05em;
  color: var(--muted);
  padding: .15rem 0;
  transition: color .15s;
}
.welcome-skip-label:hover { color: var(--ink); }
.welcome-skip-label input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 30px; height: 17px;
  background: var(--line);
  border-radius: 9px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: background .22s;
}
.welcome-skip-label input[type="checkbox"]::after {
  content: '';
  position: absolute;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  top: 2px; left: 2px;
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 1px 3px rgba(0,0,0,.28);
}
.welcome-skip-label input[type="checkbox"]:checked {
  background: var(--gold);
}
.welcome-skip-label input[type="checkbox"]:checked::after {
  transform: translateX(13px);
}
.welcome-play-btn {
  background: var(--gold); color: var(--navy);
  border: none; border-radius: 5px;
  padding: .52rem 1.25rem;
  font-family: 'Oswald', sans-serif;
  font-size: .92rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; flex-shrink: 0;
  transition: background .12s;
}
.welcome-play-btn:hover { background: #dfa820; }
