/* 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 ─────────────────────────────────────────── */

body {
  margin: 0;
  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(280px, min(86vw, 62svh), 820px);
  max-height: 56svh;
  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 {
  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(760px, 100%);
  margin-top: clamp(-5.5rem, -9svh, -1.75rem);
}

.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(3, auto);
  gap: clamp(.75rem, 4vw, 2rem);
  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(64px, min(30vw, 30svh), 360px);
  height: clamp(64px, min(30vw, 30svh), 360px);
  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);
}

/* Daily challenge card is slightly larger — center position, featured */
.mode-card-daily .mode-ball {
  width: clamp(80px, min(35vw, 35svh), 420px);
  height: clamp(80px, min(35vw, 35svh), 420px);
}


.daily-challenge-mark {
  width: clamp(96px, min(17vw, 20svh), 220px);
  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);
}


/* ─── 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: calc(100vh - 92px); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: .6rem clamp(1rem, 3vw, 2rem);
  background: rgba(253, 252, 245, .55);
  border-bottom: 2px solid var(--line);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.site-header-logo {
  display: flex;
  align-items: center;
}

/* ─── 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: 'Oswald', sans-serif;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.35;
  text-align: left;
  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;
}

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

.roll-banner-left .primary-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-right .ghost-btn:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .45);
}

/* ─── 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: start;
}

/* ─── 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: .6rem;
  border-bottom: 2px solid var(--gold);
  padding-bottom: .55rem;
}

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

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

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

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

.rolled-team-era {
  font-family: 'Oswald', sans-serif;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: .55;
}

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

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

#positionFilter { display: none; }

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

.players-filter-row #searchInput {
  flex: 1 1 100px;
  min-width: 80px;
}

.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;
}

.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;
}

.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;
}

/* ─── 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 {
  color: rgba(255,255,255,.55);
  flex-shrink: 0;
}
.htp-head .icon-btn:hover { color: rgba(255,255,255,.9); }

.htp-body {
  padding: 1.4rem 1.35rem;
  overflow-y: auto;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.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;
}

/* 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 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;
}

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

.htp-mode-row {
  display: flex;
  gap: .85rem;
  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-row span { font-family: 'Lora', serif; font-size: .88rem; color: var(--ink); line-height: 1.5; }

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

.player-grid {
  display: flex;
  gap: .45rem;
  align-items: start;
}

.player-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.player-group {
  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: space-between;
  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-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 {
  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-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;
}

.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;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: .28rem .45rem .28rem .3rem;
  align-self: center;
}

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


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

.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(1040px, calc(100vw - 1rem)); }
.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.2rem;
  display: grid;
  place-items: center;
}

.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; }

.assign-dialog { max-height: 96vh; overflow: hidden; }
.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: .4rem .3rem .35rem;
  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: .6rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: .15rem;
}

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

.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;
}

/* ─── 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;
  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: 25%; top: 30%; }
.dd-node[data-slot="CF"]  { left: 50%; top: 19%; }
.dd-node[data-slot="RF"]  { left: 75%; top: 30%; }
.dd-node[data-slot="2B"]  { left: 50%; top: 45%; }
.dd-node[data-slot="SS"]  { left: 44%; top: 54%; }
.dd-node[data-slot="1B"]  { left: 62%; top: 67%; }
.dd-node[data-slot="3B"]  { left: 38%; top: 67%; }
.dd-node[data-slot="C"]   { left: 50%; top: 83%; }
.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: 48px;
  height: 48px;
  font-size: .78rem;
}

/* 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; }

/* ─── 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: .45rem .3rem .4rem;
  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 use the same circle size as field positions */
.dd-node.strip .dd-circle {
  width: 48px;
  height: 48px;
  font-size: .72rem;
}

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

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

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

.result-actions {
  display: grid;
  grid-template-columns: 1fr .9fr .8fr;
  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; }

#shareResultBtn {
  border-color: var(--red);
  color: var(--paper);
  background: var(--red);
}

#saveLeaderboardBtn:disabled {
  opacity: .58;
  cursor: default;
}

.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);
}

.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.4fr) 92px 70px 88px;
  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;
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, .75fr));
  gap: .4rem;
  align-items: stretch;
}

.result-hero div {
  padding: .42rem .6rem;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.result-hero div:first-child {
  background: linear-gradient(135deg, var(--navy) 0%, #091830 100%);
  border-color: var(--navy);
}

.result-hero span {
  display: block;
  margin-bottom: .18rem;
  color: var(--muted);
  font-family: 'Oswald', sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.result-hero div:first-child span { color: rgba(253, 252, 245, .55); }

.result-hero strong {
  display: block;
  color: var(--red);
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: clamp(1.45rem, 3.4vw, 2.5rem);
  font-weight: 400;
  line-height: .95;
}

.result-hero div:first-child strong {
  color: var(--paper);
  font-size: clamp(2.9rem, 7vw, 5.1rem);
}

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

.result-score-grid {
  display: grid;
  grid-template-columns: repeat(8, 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;
  font-style: italic;
}

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

/* ─── 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: .4rem;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--navy);
}

.formula-card p, .insight-list p {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.48;
  margin-bottom: .35rem;
  font-style: italic;
}

.formula-card p:last-child, .insight-list p:last-child { margin-bottom: 0; }

.insight-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .3rem;
}

.insight-list p {
  padding: .45rem .55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

/* ─── 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: 42px 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 {
  color: var(--sky);
  font-family: 'Oswald', sans-serif;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.result-roster-row span {
  font-family: 'Lora', serif;
  overflow: hidden;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink);
  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);
}

@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);
}

/* ─── 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(64px, min(34vw, 26svh), 150px); height: clamp(64px, min(34vw, 26svh), 150px); }
  .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: 2.2rem; }
  .site-header { justify-content: center; padding: .75rem 1rem; }
  .site-header-logo { position: static; transform: none; }
  .slot-grid, .dialog-stats, .result-score-grid, .postgame-card-grid { grid-template-columns: 1fr 1fr; }
  .result-hero { grid-template-columns: 1fr; }
  .result-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leaderboard-row { grid-template-columns: 48px minmax(0, 1fr) 76px 58px; }
  .leaderboard-row span:last-child { display: none; }
  .player-grid { flex-direction: column; }
}

@media (max-width: 520px) {
  .dialog-stats, .result-score-grid, .postgame-card-grid { grid-template-columns: 1fr; }
  .result-roster { grid-template-columns: 1fr; }
  .result-actions { grid-template-columns: 1fr; }
  .leaderboard-form > div { grid-template-columns: 1fr; }
  .leaderboard-row {
    grid-template-columns: 42px minmax(0, 1fr) 68px 54px;
    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: 52px 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-home-footer,
.rsc-record-block,
.rsc-brand,
.result-mobile-cta { 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: .7rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(42,58,30,.55);
  text-decoration: none;
}

.mobile-home-footer a:hover { color: var(--navy); }

.mobile-home-footer .mhf-sep {
  color: rgba(42,58,30,.25);
  font-size: .6rem;
}

.mhf-coming-soon {
  width: 100%;
  margin: .15rem 0 0;
  font-family: 'Oswald', sans-serif;
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(100,80,30,.4);
  text-align: center;
}

@media (min-width: 641px) {
  .mobile-home-brand,
  .mobile-mode-info,
  .mobile-bottom-nav,
  .mobile-lineup-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(.5rem, 2svh, 1.5rem) 1.25rem;
    gap: clamp(.28rem, 1.4svh, .85rem);
    justify-content: center;
  }

  /* Kill the desktop negative pull — it overlaps the brand text on mobile */
  .mode-panel {
    margin-top: 0;
    width: 100%;
  }

  .main-logo img {
    width: clamp(100px, min(38vw, 17svh), 180px);
  }

  .mobile-home-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    text-align: center;
  }

  .mob-apd-title {
    font-family: 'Bebas Neue', 'Oswald', sans-serif;
    font-size: clamp(1.5rem, min(9vw, 5svh), 2.4rem);
    color: var(--gold);
    letter-spacing: .04em;
    line-height: 1;
    margin: 0;
  }

  .mob-game-sub {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(.6rem, 2svh, .8rem);
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(242,232,184,.65);
    margin: 0;
  }

  .mode-panel > p {
    display: none;
  }

  .mode-ball {
    width: clamp(56px, min(22vw, 20svh), 115px);
    height: clamp(56px, min(22vw, 20svh), 115px);
  }

  .mode-card-daily .mode-ball {
    width: clamp(68px, min(27vw, 24svh), 138px);
    height: clamp(68px, min(27vw, 24svh), 138px);
  }

  .mode-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(.3rem, 1.5vw, .6rem);
  }

  .mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(.25rem, 1svh, .5rem);
    padding: .15rem .4rem .5rem;
    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); }

  .mobile-home-footer a { color: rgba(242,232,184,.45); }
  .mobile-home-footer a:hover { color: var(--gold); }
  .mobile-home-footer .mhf-sep { color: rgba(242,232,184,.2); }
  .mhf-coming-soon { color: rgba(201,138,32,.45); }

  /* ── GAME SCREEN HEADER ───────────────────────────── */

  .site-header {
    padding: .3rem .75rem;
    border-bottom: 1.5px solid var(--line);
  }

  .header-logo-img {
    height: 26px;
  }

  /* ── ROLL BANNER — Roll button + FILLED count only ── */

  .roll-banner-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
  }

  .roll-banner-left {
    flex: 1;
  }

  .roll-banner-left .primary-btn {
    width: 100%;
    padding: .6rem .75rem;
    font-size: .9rem;
  }

  .roll-banner-team .team-summary > div:not(.banner-filled) {
    display: none;
  }

  .roll-banner-team .team-summary .banner-filled {
    margin-left: 0;
    min-width: 58px;
    padding: .3rem .6rem;
  }

  .roll-banner-team .team-summary .banner-filled strong {
    font-size: 1.05rem;
  }

  .roll-banner-team .team-summary .banner-filled span {
    font-size: .55rem;
  }

  .roll-banner-right { display: none; }
  /* ── 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; }

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

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

  .players-panel-head {
    padding: .5rem .75rem .45rem;
  }

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

  .rolled-team-name {
    font-size: 1.65rem;
    line-height: 1.05;
  }

  .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; }

  #searchInput {
    flex: 1;
    min-width: 0;
    width: auto;
    font-size: .8rem;
  }

  /* ── 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: .35rem;
    flex-shrink: 0;
    line-height: 1;
  }

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

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

  .player-grid {
    display: block;
  }

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

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

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

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

  .player-name {
    white-space: normal;
    text-overflow: unset;
    overflow: visible;
    font-size: .83rem;
    line-height: 1.2;
  }

  .player-stat-line {
    grid-column: 2;
    grid-row: 2;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: .63rem;
    line-height: 1.3;
    padding: 0 .4rem .32rem .45rem;
    align-self: start;
  }

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

  .roster-list-head {
    padding: .6rem .75rem .35rem;
  }

  .slot-grid {
    padding: .3rem .5rem .5rem;
    grid-template-columns: 1fr;
  }

  .roster-panel .slot-card {
    min-height: 44px;
  }

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

  /* ── LINEUP / DRAFT TOGGLE PILL ─────────────────── */

  .mobile-lineup-pill {
    position: fixed;
    bottom: 68px;
    right: 1rem;
    z-index: 890;
    display: flex;
    align-items: center;
    padding: .55rem 1.05rem .55rem .85rem;
    background: var(--navy);
    border: 1.5px solid var(--gold);
    border-radius: 2rem;
    color: var(--gold);
    font-family: 'Oswald', sans-serif;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.42);
    -webkit-tap-highlight-color: transparent;
    transition: background .15s, box-shadow .15s, transform .1s;
  }

  .mobile-lineup-pill:hover {
    background: rgba(201,138,32,.14);
    box-shadow: 0 6px 18px rgba(0,0,0,.5);
  }

  .mobile-lineup-pill:active {
    transform: scale(.96);
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
  }

  /* Inner state spans */
  .mlp-state {
    display: flex;
    align-items: center;
    gap: .35rem;
  }

  /* Show draft-state on draft tab, lineup-state on lineup tab */
  .mlp-state-lineup               { display: none; }
  body.mobile-tab-lineup .mlp-state-draft  { display: none; }
  body.mobile-tab-lineup .mlp-state-lineup { display: flex; }

  .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: 56px;
    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 {
    font-size: 1rem;
    line-height: 1;
  }

  .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-sim {
    background: rgba(255,255,255,.03);
  }

  .mbn-sim:not(:disabled) {
    background: rgba(200,40,40,.22);
    color: #f88;
  }

  .mbn-sim:not(:disabled).active,
  .mbn-sim:not(:disabled):hover {
    color: #fff;
  }

  .mbn-sim:disabled {
    opacity: .38;
    cursor: default;
  }

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

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

  .assign-dialog form {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 88svh;
  }

  .ad-head {
    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: 38px;
    height: 38px;
    font-size: .72rem;
  }

  .dd-node.strip .dd-circle { width: 40px; height: 40px; font-size: .66rem; }

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

  .dd-stat { padding: .22rem .18rem .18rem; }
  .dd-stat span { font-size: .56rem; }
  .dd-stat strong { font-size: 1.05rem; }

  .dd-hint { display: none; }

  .dd-field {
    aspect-ratio: unset;
    height: min(44svh, 250px);
    border-radius: 0;
    overflow: hidden;
  }

  /* Spread SS/2B/1B/3B so circles don't overlap on narrow screens */
  .dd-node[data-slot="2B"]  { left: 55%; top: 43%; }
  .dd-node[data-slot="SS"]  { left: 43%; top: 57%; }
  .dd-node[data-slot="3B"]  { left: 36%; top: 71%; }
  .dd-node[data-slot="1B"]  { left: 64%; top: 71%; }

  .dd-strip-section {
    padding: .28rem .15rem .24rem;
    gap: .28rem;
  }

  .dd-subgroup-sep {
    padding-left: .32rem;
  }

  .dd-strip-nodes {
    gap: .22rem;
  }

  .dd-node.strip .dd-circle {
    width: 40px;
    height: 40px;
    font-size: .66rem;
  }

  .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;
  }

  .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 .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 — screenshot target, fills one screen */
  .result-share-card {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    background: var(--navy);
    padding: 1.5rem 1rem 1rem;
  }

  .rsc-record-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    gap: .2rem;
    padding: .5rem 0;
  }

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

  .rsc-wins {
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    font-size: clamp(5.5rem, 26vw, 7.5rem);
    line-height: .88;
    color: var(--paper);
    margin: .15rem 0;
    letter-spacing: .01em;
  }

  .rsc-tier {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1rem, 5vw, 1.35rem);
    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; }

  /* Score grid: 4-column 2-row on dark bg */
  .result-share-card .result-score-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .22rem;
  }
  .result-share-card .result-score-grid div {
    background: rgba(255,255,255,.065);
    border-left-color: rgba(255,255,255,.1);
    border-right-color: rgba(255,255,255,.1);
    border-bottom-color: rgba(255,255,255,.1);
    border-top-color: rgba(255,255,255,.18);
  }
  .result-share-card .result-score-grid div.elite { border-top-color: var(--grass); }
  .result-share-card .result-score-grid div.good { border-top-color: var(--gold); }
  .result-share-card .result-score-grid div.ok { border-top-color: var(--sky); }
  .result-share-card .result-score-grid div.bad { border-top-color: var(--red); }
  .result-share-card .result-score-grid span { color: rgba(255,255,255,.45); }
  .result-share-card .result-score-grid strong { color: var(--paper); }
  .result-share-card .result-score-grid small { color: rgba(255,255,255,.38); }

  /* Branding pinned to bottom of share card */
  .rsc-brand {
    display: block;
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-size: .62rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(201,138,32,.42);
    padding-top: .7rem;
  }

  /* Action strip between share card and roster */
  .result-mobile-cta {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: .5rem;
    padding: .65rem .85rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .result-mobile-cta button { min-height: 46px; }
  .result-mobile-cta .ghost-btn {
    border-color: var(--red);
    color: var(--paper);
    background: var(--red);
  }

  /* Details below share card */
  .result-below-fold { padding: .75rem .85rem 1.5rem; }

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

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

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

  .htp-box {
    max-height: 100svh;
    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 {
    max-height: calc(98svh - env(safe-area-inset-bottom, 0px));
  }

  .ad-pos-badge {
    font-size: 1.45rem;
    min-width: 2.65rem;
  }

  .ad-name {
    font-size: 1rem;
  }

  .ad-meta {
    font-size: .68rem;
  }

  .dd-stat-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .dd-stat:nth-child(n) {
    border-top: 0;
    border-right: 1px solid var(--line);
  }

  .dd-stat:last-child {
    border-right: 0;
  }

  .dd-stat span {
    font-size: .5rem;
  }

  .dd-stat strong {
    font-size: .95rem;
  }

  .dd-field {
    max-height: 42svh;
    min-height: 190px;
  }

  .result-share-card {
    min-height: 100svh;
    padding: 1rem .8rem .65rem;
  }

  .rsc-record-block {
    flex: 0 0 auto;
    padding: 1.5rem 0 .55rem;
  }

  .rsc-wins {
    font-size: clamp(4.2rem, 21vw, 5.8rem);
    margin: .05rem 0;
  }

  .rsc-tier {
    font-size: clamp(.88rem, 4.3vw, 1.05rem);
  }

  .result-share-card .result-score-grid {
    gap: .18rem;
  }

  .result-share-card .result-score-grid div {
    padding: .22rem .12rem;
    border-top-width: 3px;
  }

  .result-share-card .result-score-grid span {
    font-size: .52rem;
  }

  .result-share-card .result-score-grid strong {
    font-size: .9rem;
  }

  .result-share-card .result-score-grid small {
    display: none;
  }

  .rsc-brand {
    padding-top: .45rem;
  }

  .result-mobile-cta {
    padding: .5rem .7rem;
  }

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