:root {
  --carrot: #c97a35;
  --carrot-dark: #a85e1a;
  --cream: #F5EDD8;
  --paper: #f0dfc8;
  --ink: #1a0f09;
  --muted: #7A5F3A;
  --green: #5a7a4a;
  --green-dark: #3a5a2a;
  --gold: #c4935a;
  --line: rgba(26, 15, 9, .16);
  --shadow: 0 18px 46px rgba(26, 15, 9, .28);
  /* Layout tokens */
  --pb-gap: 18px;
  --pb-btn-h: 46px;
  --pb-btn-r: 14px;
  --pb-card-r: 12px;
  --pb-inner-r: 9px;
  --pb-fixture-px: 16px;
  --pb-desktop-w: 1100px;
}

* { box-sizing: border-box; }

@keyframes pb-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.game-shell, .match-screen, .report-screen {
  animation: pb-fade-in 0.18s ease both;
}

html { min-height: 100%; background: transparent; }
html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  background: transparent;
}

/* Fixed wallpaper div - a real element avoids the z-index stacking issue
   that makes body::before invisible on iOS when html has a background colour. */
.pitch-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(26, 15, 9, .22), rgba(20, 11, 6, .58)),
    url("images/pawball/pitch.webp") center / cover no-repeat;
}

@media (max-width: 768px) {
  .pitch-bg {
    background:
      linear-gradient(rgba(26, 15, 9, .18), rgba(20, 11, 6, .52)),
      url("images/pawball/pitch_mobile.webp") center / cover no-repeat;
  }
}

button, summary { font: inherit; }

#pb-name-input:focus {
  border-color: rgba(255, 210, 140, .65);
  box-shadow: 0 0 0 3px rgba(255, 210, 140, .18);
  outline: none;
}
button { cursor: pointer; touch-action: manipulation; }

.team-name-full {
  display: inline;
}

.team-name-short {
  display: none;
}

.game-shell {
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 6px 12px max(32px, env(safe-area-inset-bottom));
}

.setup-screen {
  display: flex;
  flex-direction: column;
}

.brand-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 12px;
  color: white;
}

.brand-header h1 {
  margin: 0;
  font: 400 clamp(40px, 12vw, 54px) / .95 "Cormorant Garamond", Georgia, serif;
  letter-spacing: -.02em;
  text-shadow: 0 3px 14px rgba(0, 0, 0, .35);
}

.eyebrow {
  margin: 0 0 5px;
  color: #F5A84E;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7), 0 3px 8px rgba(0, 0, 0, .5);
}

.section-label {
  margin: 0 0 5px;
  color: var(--carrot-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.pitch-section-label {
  margin: 16px 0 10px;
  text-align: left;
}

.tagline {
  max-width: 280px;
  margin: 9px 0 0;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .7);
}

.daily-score {
  flex: 0 0 auto;
  min-width: 86px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 16px;
  background: rgba(255, 240, 213, .14);
  box-shadow: inset 0 1px rgba(255, 255, 255, .18);
  text-align: center;
  backdrop-filter: blur(10px);
}

.daily-score span {
  display: block;
  color: #F5A84E;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .55);
}

.daily-score strong { font-size: 28px; }

.panel {
  margin: 11px 0;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 22px;
  background: rgba(248, 236, 214, .78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.game-shell > .panel:first-child,
.setup-screen > .panel:first-child { margin-top: 4px; }

.panel-heading, .fixture-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fixture-card {
  position: relative;
  z-index: 1;
  padding: 0;
  overflow: hidden;
}

.fixture-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 11px;
  border-bottom: 1px solid var(--line);
}

.fixture-topline .section-label { margin: 0; }
.fixture-topline time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.matchup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  padding: 18px 14px 16px;
  background: linear-gradient(135deg, rgba(255, 250, 239, .42), rgba(232, 211, 181, .3));
}

.matchup-team {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.matchup-team strong {
  font: 400 18px / 1.05 "Bree Serif", serif;
}

.team-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 3px solid var(--cream);
  border-radius: 50%;
  color: var(--cream);
  background: var(--carrot);
  box-shadow: 0 0 0 2px rgba(43, 23, 14, .13), 0 5px 12px rgba(43, 23, 14, .16);
  font-size: 13px;
  font-weight: 800;
}

.opponent-mark {
  border: 3px solid var(--cream);
  color: var(--cream);
  background: var(--strip);
}

.team-badge {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
}

.carrot-badge {
  filter: drop-shadow(0 2px 6px rgba(43,23,14,.22));
}

.opp-badge {
  filter: drop-shadow(0 2px 6px rgba(43,23,14,.22));
}

.versus {
  align-self: center;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 11px;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font: 800 10px / 1 "DM Sans", sans-serif;
  text-transform: uppercase;
}

.scout-report {
  margin: 0;
  padding: 14px var(--pb-fixture-px);
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 250, 239, .48);
  box-shadow: inset 5px 0 var(--green);
}

.scout-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.opponent-stats {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.opponent-shape {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.opponent-shape strong { font-size: 19px; }
.opponent-shape span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.opponent-style-badge {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(90, 122, 74, .15);
  border: 1px solid rgba(90, 122, 74, .3);
}
.opponent-style-badge strong {
  font-size: 11px;
  font-weight: 800;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.scout-report ul, .verdict-card ul, .lineup-verdict-card ul { margin: 8px 0 0; padding-left: 19px; }
.scout-report li, .verdict-card li, .lineup-verdict-card li { margin: 6px 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

.fixture-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px var(--pb-fixture-px);
}

.fixture-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  width: 100%;
}

.fixture-actions .kickoff-button {
  width: 100%;
  font-size: 15px;
}

.fixture-actions .mode-button {
  min-width: 0;
  font-size: 13px;
  text-align: center;
}

.kickoff-final-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.kickoff-final-card h2 {
  margin: 2px 0 4px;
  color: var(--ink);
  font: 400 25px/1.05 "Cormorant Garamond", Georgia, serif;
}

.kickoff-final-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.kickoff-final-card .kickoff-button {
  min-width: 128px;
  min-height: 48px;
}

.panel > .kickoff-button {
  width: 100%;
  margin-top: 12px;
}

.mode-hint {
  margin: 14px var(--pb-fixture-px) 11px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.pb-btn-disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}


.optimal-sublabel {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 2px;
}

.optimal-correct { color: var(--green); }

.optimal-reasons {
  margin: 0;
  padding-left: 19px;
}

.optimal-reasons li {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}


.played-note {
  margin: 0 var(--pb-fixture-px) 14px;
  padding: 11px 13px;
  border: 1px solid rgba(168, 94, 26, .5);
  border-left: 5px solid var(--carrot-dark);
  border-radius: var(--pb-card-r);
  color: var(--ink);
  background: rgba(244, 224, 186, .82);
}

.played-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--carrot-dark);
  font-size: 13px;
}
.played-note p { margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }

.button {
  min-height: 46px;
  padding: 11px 15px;
  border: 0;
  border-radius: 14px;
  font-weight: 800;
}

.primary {
  color: white;
  background: linear-gradient(145deg, var(--green), var(--green-dark));
  box-shadow: 0 7px 16px rgba(58, 90, 42, .28);
}

.secondary { color: var(--ink); background: rgba(232, 211, 181, .72); }

.mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid rgba(26, 15, 9, .16);
  color: var(--ink);
  background: rgba(245, 237, 216, .86);
  box-shadow: 0 4px 10px rgba(26, 15, 9, .08);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}

.mode-button[data-fixture-mode="practice"] {
  color: var(--ink);
  border-color: rgba(26, 15, 9, .16);
  background: rgba(245, 237, 216, .86);
  box-shadow: 0 4px 10px rgba(26, 15, 9, .08);
}

.mode-button[data-fixture-mode="daily"] {
  color: var(--ink);
  border-color: rgba(26, 15, 9, .16);
  background: rgba(245, 237, 216, .86);
  box-shadow: 0 4px 10px rgba(26, 15, 9, .08);
}

.mode-button.selected {
  color: var(--green-dark);
  border-width: 2px;
  border-color: var(--green);
  background: rgba(90, 122, 74, .14);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--green) 16%, var(--cream)),
    color-mix(in srgb, var(--green) 8%, var(--cream))
  );
  box-shadow:
    0 0 0 3px rgba(90, 122, 74, .18),
    inset 0 1px 0 rgba(255, 255, 255, .62),
    0 5px 13px rgba(58, 90, 42, .18);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, .62),
    0 5px 13px rgba(58, 90, 42, .18);
  font-weight: 900;
}

.panel-heading {
  align-items: flex-start;
  margin-bottom: 12px;
}

.panel-heading > div { display: flex; align-items: center; gap: 9px; }
.panel-heading h2, .verdict-card h2 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 400; font-size: 21px; }
.optimal-panel h2 { margin: 2px 0 8px; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 400; font-size: 25px; color: var(--green); }
.panel-heading > p { max-width: 170px; margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; text-align: right; }

.step {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.formation-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}
.style-panel .panel-heading { margin-bottom: 4px; }
.style-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.style-list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(122, 95, 58, .22);
  border-radius: 10px;
  background: rgba(255, 250, 240, .55);
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}
.style-list-row strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  min-width: 90px;
}
.style-list-row span {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  line-height: 1.35;
}
.style-list-row.selected {
  background: var(--green);
  border-color: var(--green);
}
.style-list-row.selected strong {
  color: #fff;
}
.style-list-row.selected span {
  color: rgba(255, 255, 255, .75);
}

.formation-options .choice-button {
  flex: 0 0 calc(33.333% - 4px);
}

.choice-button, .wide-choice {
  min-width: 0;
  padding: 10px 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 250, 240, .64);
}

.choice-button strong, .choice-button span, .wide-choice strong, .wide-choice span { display: block; }
.choice-button strong { font-size: 13px; }
.choice-button span { margin-top: 2px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.choice-button.selected, .wide-choice.selected { color: white; border-color: var(--green); background: var(--green); box-shadow: 0 5px 12px rgba(58, 90, 42, .2); }
.choice-button.selected span, .wide-choice.selected span { color: #d9ebd8; }

.tactics-board {
  position: relative;
  width: min(100%, 330px);
  aspect-ratio: 3 / 4;
  margin: 13px auto 0;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, .66);
  border-radius: 13px;
  background:
    linear-gradient(rgba(1, 26, 8, .08), rgba(1, 26, 8, .22)),
    url("images/pawball/tactics.webp") center / cover no-repeat;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .22), 0 10px 25px rgba(19, 47, 26, .24);
  touch-action: pan-y;
}

.pitch-player {
  position: absolute;
  width: 80px;
  display: grid;
  justify-items: center;
  border: 0;
  padding: 0;
  transform: translate(-50%, -50%);
  color: white;
  background: transparent;
  text-align: center;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .9);
}

.pitch-player img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border: 2px solid var(--cream);
  border-radius: 50%;
  background: #ead8b9;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .4);
}

.pitch-player strong { margin-top: 3px; font-size: 13px; line-height: 1; }
.pitch-player span { margin-top: 3px; padding: 3px 7px; border-radius: 10px; background: rgba(0, 0, 0, .56); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.pitch-stat-pill[data-pos="GK"] { background: #b08b00; }
.pitch-stat-pill[data-pos="DF"] { background: #b02020; }
.pitch-stat-pill[data-pos="MF"] { background: #1a5aa8; }
.pitch-stat-pill[data-pos="AT"] { background: #177a3e; }
.pitch-player { cursor: pointer; }
.pitch-player.gk-pos { transform: translate(-50%, -78%); }
.opponent-tactics-board {
  width: min(100%, 330px);
  margin-top: 8px;
  border-width: 3px;
}
.compact-pitch-player {
  width: 62px;
}
.compact-pitch-player img {
  width: 38px;
  height: 38px;
}
.compact-pitch-player strong {
  font-size: 10px;
}
.compact-pitch-player span {
  padding: 1px 5px;
  font-size: 10px;
}

.squad-panel { padding-bottom: 13px; }

.desktop-match-plan {
  display: none;
}

.transfer-panel .panel-heading {
  margin-bottom: 8px;
}
.transfer-panel .panel-heading > p {
  max-width: 190px;
}
.transfer-reset-note {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-left: 3px solid var(--carrot);
  border-radius: 0 var(--pb-inner-r) var(--pb-inner-r) 0;
  color: var(--muted);
  background: rgba(201, 122, 53, .09);
  font-size: 11px;
  line-height: 1.4;
}
.transfer-budget-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.transfer-budget-strip span {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(26, 15, 9, .12);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 250, 240, .58);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}
.transfer-budget-strip strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 12px;
}
.transfer-budget-strip .is-over strong {
  color: #9d2518;
}
.transfer-list-label {
  margin: 11px 0 6px;
  color: var(--carrot-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.transfer-player-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.transfer-card,
.transfer-target-main {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(26, 15, 9, .15);
  border-radius: 9px;
  color: var(--ink);
  background: rgba(255, 250, 240, .64);
  text-align: left;
}
.transfer-card img,
.transfer-target-main img,
.transfer-summary img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border: 2px solid rgba(255, 240, 213, .9);
  border-radius: 50%;
  background: #ead8b9;
}
.transfer-card span,
.transfer-target-main span {
  min-width: 0;
}
.transfer-card strong,
.transfer-target-main strong,
.transfer-summary strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transfer-card small,
.transfer-target-main small,
.transfer-summary small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.position-label {
  display: inline-flex;
  min-width: 0;
  gap: 4px;
  align-items: baseline;
  color: var(--muted);
  white-space: nowrap;
}
.position-label b {
  color: var(--ink);
  font-weight: 900;
}
.position-label span {
  color: var(--muted);
  font-weight: 600;
}
.position-label span::before {
  content: "/ ";
  color: rgba(123, 92, 58, .78);
  font-weight: 600;
}
.transfer-card em,
.transfer-target-main em {
  padding: 4px 6px;
  border-radius: 7px;
  color: #fff;
  background: var(--green);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}
.transfer-card.selected,
.transfer-market-card.selected .transfer-target-main {
  border-color: var(--carrot);
  background: rgba(201, 122, 53, .15);
  box-shadow: 0 0 0 2px rgba(201, 122, 53, .2);
}
.transfer-card:disabled,
.transfer-target-main:disabled {
  cursor: default;
}
.transfer-market-card {
  position: relative;
  min-width: 0;
}
.transfer-market-card.unaffordable {
  opacity: .43;
}
.transfer-profile-button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(26, 15, 9, .18);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(245, 237, 216, .94);
  font: 800 11px/1 Georgia, serif;
}
.transfer-target-main {
  padding-right: 36px;
}
.transfer-decision {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}
.transfer-decision p {
  min-height: 32px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}
.transfer-decision .button {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.2;
}
.transfer-decision-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 7px;
}
.transfer-cancel-button {
  color: #fff;
  background: linear-gradient(145deg, var(--carrot), var(--carrot-dark));
  box-shadow: 0 5px 12px rgba(168, 94, 26, .22);
}
.transfer-cancel-button:disabled {
  color: rgba(255, 255, 255, .72);
  background: linear-gradient(145deg, rgba(201, 122, 53, .58), rgba(168, 94, 26, .58));
  box-shadow: none;
}
.transfer-decision [data-confirm-transfer]:disabled {
  cursor: not-allowed;
  color: rgba(26, 15, 9, .42);
  background: rgba(122, 112, 98, .28);
  box-shadow: none;
  opacity: .62;
}
.transfer-summary-panel > p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}
.transfer-summary-list {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}
.transfer-budget-line {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}
.transfer-undo-button {
  width: 100%;
  margin-top: 10px;
  min-height: var(--pb-btn-h);
  padding: 10px 12px;
  border-radius: var(--pb-btn-r);
  font-size: 13px;
}

.no-transfer-info {
  margin: 9px 0 0;
  padding: 10px 13px;
  border: 1px solid rgba(26, 15, 9, .13);
  border-radius: var(--pb-inner-r);
  color: var(--muted);
  background: rgba(255, 250, 240, .6);
  font-size: 12px;
  line-height: 1.4;
}

.transfer-verdict {
  margin-top: 11px;
  padding: 10px 12px;
  border-left: 3px solid var(--green);
  border-radius: 0 9px 9px 0;
  background: rgba(90, 122, 74, .1);
}
.transfer-verdict > span {
  color: var(--carrot-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.transfer-verdict h3 {
  margin: 2px 0 5px;
  color: var(--green-dark);
  font: 400 22px/1.1 "Cormorant Garamond", Georgia, serif;
}
.transfer-verdict ul {
  margin: 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.transfer-verdict li + li {
  margin-top: 3px;
}
.transfer-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.transfer-summary > div {
  min-width: 0;
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(26, 15, 9, .14);
  border-radius: 9px;
  background: rgba(255, 250, 240, .6);
}
.transfer-summary > div > span {
  min-width: 0;
}
.transfer-arrow {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(58, 90, 42, .24);
  border-radius: 50%;
  background: rgba(255, 250, 240, .74);
  box-shadow: 0 2px 6px rgba(26, 15, 9, .08);
}
.transfer-arrow::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: -2px;
  border-top: 2px solid var(--green);
  border-right: 2px solid var(--green);
  transform: rotate(45deg);
}

.profile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(26, 15, 9, .58);
  backdrop-filter: blur(3px);
}
.player-profile-modal {
  position: relative;
  width: min(390px, 100%);
  max-height: min(704px, calc(100dvh - 16px));
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 22px;
  color: var(--ink);
  background: linear-gradient(155deg, #f7eddb, #e8d5b8);
  box-shadow: 0 24px 70px rgba(26, 15, 9, .42);
}
.player-profile-modal::-webkit-scrollbar { display: none; }
.profile-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 250, 240, .76);
  box-shadow: inset 0 0 0 1px rgba(26, 15, 9, .12);
  font-weight: 900;
}
.player-profile-modal header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  margin-bottom: 8px;
}
.player-profile-modal header img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border: 3px solid #fff8e9;
  border-radius: 50%;
  background: #ead8b9;
  box-shadow: 0 3px 10px rgba(26, 15, 9, .16);
}
.player-profile-modal h2 {
  margin: 0 0 3px;
  font: 400 27px/1 "Cormorant Garamond", Georgia, serif;
  color: var(--ink);
}
.player-profile-modal header p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.profile-bio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 7px;
}
.profile-bio-grid div {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(26, 15, 9, .12);
  border-radius: 9px;
  background: rgba(255, 250, 240, .68);
}
.profile-bio-grid span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.profile-bio-grid strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.profile-bio-grid strong.profile-bio-value {
  color: var(--green);
  font-weight: 700;
}
.profile-position-note {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 800;
}
.profile-position-note.is-secondary,
.profile-position-note.is-out {
  color: var(--muted);
}
.profile-groups {
  display: grid;
  gap: 6px;
}
.profile-group {
  padding: 6px;
  border: 1px solid rgba(26, 15, 9, .12);
  border-radius: 11px;
  background: rgba(255, 250, 240, .46);
}
.profile-group h3 {
  margin: 0 0 5px;
  color: var(--carrot-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}
.profile-stat {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 6px;
  align-items: center;
  padding: 5px 6px;
  border: 1px solid rgba(26, 15, 9, .11);
  border-radius: 8px;
  background: rgba(255, 252, 245, .76);
}
.profile-stat span {
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}
.profile-stat strong {
  color: hsl(var(--stat-hue), 58%, 38%);
  font-size: 14px;
  text-align: right;
}
.profile-stat i {
  grid-column: 1 / 3;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(26, 15, 9, .12);
}
.profile-stat b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: hsl(var(--stat-hue), 58%, 42%);
}

.option-list { display: grid; gap: 7px; }
.wide-choice { display: grid; grid-template-columns: 84px 1fr; gap: 8px; align-items: center; padding: 10px 12px; text-align: left; }
.wide-choice strong { font-size: 13px; }
.wide-choice span { color: var(--muted); font-size: 10px; line-height: 1.3; }

.rules summary { color: var(--carrot-dark); font-weight: 800; cursor: pointer; }
.rules p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* Match engine */
.match-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(430px, 100%);
  min-height: calc(100svh - 10px);
  margin: 10px auto 0;
  padding: 6px 10px 160px;
  overflow: hidden;
  color: white;
  border-radius: 20px 20px 0 0;
  background: transparent;
}

@media (max-width: 768px) {
  .match-screen {
    border-radius: 0;
    margin: 0 auto;
    padding-top: 8px;
    padding-bottom: 162px;
    min-height: calc(100svh - 78px);
  }
  /* Fixed vertical rhythm: scorer slot is always reserved, so ratings never jump after goals. */
  .match-screen .live-ratings-grid {
    margin-top: clamp(68px, 9svh, 86px);
    margin-bottom: 0;
  }
  .match-tactics-bar {
    display: none;
  }

  .match-tactics-inline {
    display: none;
  }

  .match-tactics-mobile {
    display: block;
    margin: 0 0 6px;
    padding: 0 8px;
    text-align: center;
  }
  /* Scoreboard: balanced panels with anchored, readable team groups. */
  .match-screen .scoreboard {
    grid-template-columns: minmax(0, 1fr) minmax(74px, 21vw) minmax(0, 1fr);
    min-height: 62px;
    border-radius: 18px;
  }
  .match-screen .score-team {
    gap: 7px;
    padding: 9px 8px;
    min-height: 62px;
    justify-content: flex-start;
  }
  .match-screen .away-team {
    justify-content: flex-end;
  }
  .match-screen .score-badge {
    width: clamp(28px, 8.6vw, 34px);
    height: clamp(28px, 8.6vw, 34px);
  }
  .match-screen .score-name {
    flex: 0 1 auto;
    min-width: 0;
    font-size: clamp(12px, 3.3vw, 13px);
    line-height: 1.1;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    max-height: 2.4em;
  }
  .match-screen .scoreline-block {
    justify-content: center;
    padding: 8px 9px;
    gap: 3px;
  }
  .match-screen .score-number {
    font-size: 22px;
    min-width: 16px;
  }
  .match-screen .score-sep {
    font-size: 14px;
  }
  /* Commentary text is 13px globally - no override needed */
  /* Pin controls and commentary to viewport bottom so they never scroll off-screen */
  .match-footer {
    position: fixed;
    bottom: max(56px, env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
    z-index: 10;
  }
  .commentary-stage {
    position: fixed;
    bottom: calc(max(56px, env(safe-area-inset-bottom)) + 60px);
    left: 10px;
    right: 10px;
    z-index: 10;
  }
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 62px;
  margin: 0 1px;
  border-radius: 18px;
  overflow: hidden;
  transform: translateZ(0);
}

.score-team {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  overflow: hidden;
}

.score-badge {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.score-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  max-height: 2.4em;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.home-team { color: var(--cream); background: linear-gradient(135deg, #d4863e 0%, var(--carrot-dark) 100%); }
.away-team { color: var(--opp-cream); background: var(--opp); }

.scoreline-block {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  background: rgba(26, 15, 9, 0.52);
  border-left: 1px solid rgba(245, 237, 216, 0.12);
  border-right: 1px solid rgba(245, 237, 216, 0.12);
}

.score-number {
  display: block;
  min-width: 20px;
  color: var(--cream);
  font: 800 30px / 1 "DM Sans", sans-serif;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.score-sep {
  color: rgba(245, 237, 216, 0.32);
  font: 700 18px / 1 "DM Sans", sans-serif;
  line-height: 1;
  padding: 0 1px;
}

.match-meta, .match-details {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  color: rgba(245, 237, 216, .76);
  font-size: 11px;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .85);
}
.match-meta span:last-child,
.match-details span:last-child { text-align: right; }
.match-meta { padding: 7px 7px 0; }

.half-label {
  margin: 6px 0 2px;
  color: #F5A84E;
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 3px 5px rgba(0, 0, 0, .82);
}

.event-board {
  min-height: 0;
  height: 40px;
  max-height: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 1px 28px 0;
  overflow: visible;
  color: white;
  font-size: 10px;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .9);
}

.event-board > div {
  max-height: none;
  overflow: visible;
  scrollbar-width: none;
}
.event-board > div::-webkit-scrollbar { display: none; }
.event-board > div:last-child { text-align: right; }
.event-board p { margin: 2px 0; color: inherit; font-size: inherit; font-weight: inherit; line-height: 1.4; background: rgba(0,0,0,0.22); padding: 2px 7px; border-radius: 20px; display: block; width: fit-content; }
.event-board > div:last-child p { margin-left: auto; }
.event-board .red { color: #ff4141; }
.event-board .yellow { color: #ffe24a; }
.event-board .penalty-miss { color: #8fbf7a; }

.live-ratings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 8px 2px 0;
}
.live-ratings-grid section {
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(245, 237, 216, .22);
  border-radius: 12px;
  background: rgba(0, 0, 0, .32);
}
.live-ratings-grid section > p {
  margin: 0 0 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(245, 237, 216, .75);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  overflow: hidden;
}
.ratings-badge {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.78;
}
.live-rating-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 5px 6px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  color: rgba(245, 237, 216, .92);
  background: rgba(255, 255, 255, .06);
  text-align: left;
}
.live-rating-row img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 50%;
  background: #ead8b9;
}
.live-rating-row .lr-name-wrap {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 3px;
  overflow: hidden;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
}
.live-rating-row .lr-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
}
.live-rating-row small {
  flex-shrink: 0;
  color: rgba(245, 237, 216, .62);
  font-size: 10px;
  line-height: 1;
}
.live-rating-row strong {
  justify-self: end;
  color: #d8c58a;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.live-rating-row.is-good strong { color: #8fd06d; }
.live-rating-row.is-poor strong { color: #ff7d6c; }

.commentary-stage {
  position: absolute;
  bottom: 82px;
  left: 10px;
  right: 10px;
  transform: none;
}

.commentary-box {
  width: min(390px, 96%);
  height: 68px;
  transition: background 0.15s ease, color 0.15s ease;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  padding: 12px 18px 12px 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 32px;
  background: var(--carrot);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .36), inset 0 1px rgba(255, 255, 255, .22);
  color: var(--cream);
}

.commentary-box:has(.avatar-frame[hidden]) { grid-template-columns: 1fr; }
.avatar-frame[hidden] { display: none; }
.avatar-frame img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border: 2px solid var(--cream);
  border-radius: 50%;
  background: #ead3af;
}

.commentary-box p {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  letter-spacing: 0.01em;
  color: inherit;
}

.commentary-box.home-line { color: var(--cream); background: var(--carrot); }
.commentary-box.away-line { color: var(--opp-cream); background: var(--opp); }
.commentary-box.neutral-line { color: #352116; background: #eee0c8; }
.commentary-box.home-line.goal-line { animation: home-goal-flash .5s steps(2, end) 6; }
.commentary-box.away-line.goal-line { animation: away-goal-flash .5s steps(2, end) 6; }
.commentary-box.red-line { color: var(--cream); background: #b51f25; }
.commentary-box.yellow-line { color: #3b2706; background: #e6b928; }
.commentary-box.penalty-miss-line { color: #8fbf7a; background: #1a0f09; }
.commentary-box.full-time-line {
  width: min(330px, 88%);
  height: auto;
  min-height: 50px;
  padding: 9px 16px;
  border-radius: 14px;
  color: #352116;
  background: #eee0c8;
}
.commentary-box.full-time-line p {
  font-size: 12px;
  line-height: 1.2;
}

.match-screen.is-full-time .commentary-stage {
  display: none;
}
.match-screen.is-full-time .controls-label,
.match-screen.is-full-time .speed-controls {
  display: none;
}
.match-screen.is-full-time .match-progress-wrap {
  padding-bottom: 4px;
}
.match-screen.is-full-time .finish-button {
  margin-top: 8px;
}

.match-footer {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: max(12px, env(safe-area-inset-bottom));
}

.match-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 6px;
}

.match-progress-track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(245, 237, 216, .18);
  overflow: hidden;
}

.match-progress-clock {
  flex-shrink: 0;
  color: #F5A84E;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  min-width: 32px;
  text-align: right;
  text-shadow: 0 2px 4px rgba(0,0,0,.8);
}

.match-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--carrot);
  transition: width .3s ease;
}

.speed-controls { display: flex; align-items: center; gap: 8px; }
.match-tactics-inline {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  color: rgba(245,237,216,0.65);
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  text-align: left;
}
.match-tactics-mobile {
  display: none;
  font-size: 11px;
  font-weight: 700;
  color: rgba(245,237,216,0.65);
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  text-align: center;
}

.match-tactics-bar {
  display: none; /* shown only on mobile via max-width block */
}

.tactics-bar-sep {
  font-size: 9px;
  font-weight: 500;
  font-style: italic;
  text-transform: lowercase;
  letter-spacing: 0;
  opacity: 0.65;
}
.speed-controls .pause-control {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 6px 10px;
  border: 1px solid rgba(196, 147, 90, .55);
  border-radius: 9px;
  color: #f4e3c4;
  background: rgba(26, 15, 9, .82);
  font-size: 10px;
  font-weight: 800;
}
.speed-controls .pause-control.active { border-color: var(--gold); color: #24170a; background: var(--gold); }

.speed-slider-wrap { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.speed-edge { flex-shrink: 0; font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: rgba(245, 237, 216, .5); }

.speed-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  min-width: 0;
  border-radius: 999px;
  background: rgba(245, 237, 216, .25);
  outline: none;
}
.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--carrot);
  border: 2px solid rgba(245, 237, 216, .85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  cursor: pointer;
}
.speed-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--carrot);
  border: 2px solid rgba(245, 237, 216, .85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  cursor: pointer;
}
.speed-slider::-moz-range-track { height: 4px; border-radius: 999px; background: transparent; }

.finish-button {
  width: 100%;
  margin-top: 9px;
  color: white;
  background: linear-gradient(145deg, var(--carrot), var(--carrot-dark));
  box-shadow: 0 7px 16px rgba(168, 94, 26, .32);
}

.controls-label {
  margin: 0 0 5px;
  color: rgba(245, 237, 216, 0.65);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,.8);
}

/* Pawball-specific league table leaderboard */
.pb-table { display: flex; flex-direction: column; gap: 5px; }
.pb-row {
  display: grid;
  grid-template-columns: 36px 38px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 210, 140, 0.18);
  border-radius: 11px;
  background: rgba(255, 210, 140, 0.04);
  min-height: 52px;
}
.pb-row--me {
  background: rgba(201, 122, 53, 0.14);
  border-color: rgba(201, 122, 53, 0.45);
}
.pb-rank {
  font-family: 'Bree Serif', Georgia, serif;
  font-size: 13px;
  color: rgba(245, 237, 216, 0.6);
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}
.pb-rank.pb-rank--medal { font-size: 26px; }
.pb-av-wrap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 2px;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, #dfc08f, #7a4b1f);
  flex-shrink: 0;
}
.pb-av-wrap .lb-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.pb-name {
  color: #F5EDD8;
  font-weight: 500;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.pb-manager {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.pb-manager-meta {
  min-width: 0;
  overflow: hidden;
  color: rgba(245, 237, 216, .65);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pb-pts {
  color: #f5c842;
  font-weight: 700;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Light mode overrides for Pawball league table */
.light .pb-row {
  background: rgba(255, 210, 140, 0.12);
  border-color: rgba(168, 94, 26, 0.22);
}
.light .pb-row--podium {
  background: linear-gradient(135deg, rgba(255, 228, 176, 0.72), rgba(230, 195, 128, 0.60));
  border-color: rgba(168, 94, 26, 0.38);
}
.light .pb-row--me {
  background: rgba(201, 122, 53, 0.14);
  border-color: rgba(201, 122, 53, 0.45);
}
.light .pb-name { color: #2c1a0a; }
.light .pb-manager-meta { color: rgba(44, 26, 10, .58); }
.light .pb-pts { color: #a85e1a; }
.light .pb-rank { color: rgba(44, 26, 10, 0.65); }

@keyframes home-goal-flash {
  50% { color: var(--carrot); background: var(--cream); }
}

@keyframes away-goal-flash {
  50% { color: var(--opp); background: var(--opp-cream); }
}

/* Full-time report */
.report-header {
  position: relative;
  align-items: center;
  padding: 12px 10px 16px;
}
.report-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(15, 8, 4, .58), rgba(15, 8, 4, .22));
}
.report-header h1 { font-size: 47px; }
.verdict-card h2 { margin: 2px 0 8px; font-size: 25px; color: var(--green); }
.lineup-verdict-card h2 {
  margin: 2px 0 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: 25px;
  color: var(--green);
}
.report-screen .lineup-verdict-card ul {
  margin: 8px 0 0;
  padding-left: 19px;
}
.report-screen .lineup-verdict-card li {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 400;
}
.score-breakdown { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.4; }
.motm-card {
  margin: 10px 0 4px;
  padding: 10px 12px;
  background: rgba(90, 122, 74, .08);
  border-radius: var(--pb-card-r);
  border-left: 3px solid var(--green);
}
.motm-card .motm-label {
  margin: 0 0 3px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.motm-name {
  margin: 0;
  font-family: "Bree Serif", serif;
  font-size: 18px;
  color: var(--ink);
  font-weight: 700;
}
.stats-table { margin-top: 10px; border-top: 1px solid var(--line); }
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  align-items: center;
  padding: 9px 3px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.stat-row strong:first-child { color: #4a382d; text-align: left; }
.stat-row strong:last-child { color: #4a382d; text-align: right; }
.stat-row span { color: var(--muted); font-size: 11px; }
.player-ratings { display: grid; gap: 8px; margin-top: 10px; }
.rating-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 239, .46);
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  transition: background .15s;
}
.rating-row:hover, .rating-row:focus-visible { background: rgba(245, 234, 208, .85); }
.rating-row img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 2px solid rgba(255, 240, 213, .82);
  border-radius: 50%;
  background: rgba(234, 211, 175, .72);
}
.rating-row h3 {
  margin: 0 0 3px;
  font-size: 13px;
}
.rating-row h3 span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}
.rating-row p {
  margin: 0;
  color: #5a3d25;
  font-size: 13px;
  line-height: 1.35;
}
.rating-row > strong {
  color: #49372c;
  font-size: 22px;
}
.rating-row small { font-size: 11px; opacity: 0.7; }
.report-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; }
.report-actions .button {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  min-height: 46px;
  padding: 11px 10px;
  border-radius: 14px;
}
.copy-result-button { width: 100%; margin-top: 8px; }
.practice-action {
  color: white;
  background: linear-gradient(145deg, var(--carrot), var(--carrot-dark));
  box-shadow: 0 7px 16px rgba(168, 94, 26, .28);
}
.report-btn-dark {
  color: var(--ink);
  background: linear-gradient(145deg, #d4a870, var(--gold));
  box-shadow: 0 5px 14px rgba(168, 110, 40, .28);
}
.report-actions:has([data-submit-rating][hidden]) [data-share] {
  grid-column: 1 / -1;
}
.report-btn-gold {
  color: var(--cream);
  background: linear-gradient(145deg, #6b3520, #3d1c0a);
  box-shadow: 0 5px 14px rgba(61, 28, 10, .45);
}
.copy-status { min-height: 16px; margin: 4px 0; color: white; font-size: 12px; text-align: center; }
.rank-status { min-height: 20px; margin: 6px 0 2px; color: #F5A84E; font-size: 13px; font-weight: 700; text-align: center; text-shadow: 0 2px 4px rgba(0,0,0,.6); }

/* History strip */
.history-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 16px 11px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.hist-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  color: white;
}

.hist-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}

.hist-w { background: var(--green); }
.hist-d { background: var(--gold); color: var(--ink); }
.hist-l { background: #b92724; }

.hist-record {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Opponent squad panel */
.opp-squad-hint {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-top: 2px;
}
.opp-squad-panel {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 250, 239, .48);
}
/* Plan card */
.plan-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 11px 0;
  padding: 14px 16px;
  border: 1px solid rgba(139, 49, 27, .3);
  border-radius: 22px;
  background: rgba(248, 236, 214, .78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.plan-card strong {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: #8b2712;
}

.plan-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}

.plan-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 900;
  color: white;
  background: #b92724;
  margin-top: 1px;
}

/* Half-time line */
.commentary-box.half-time-line { color: #352116; background: #eee0c8; }

@media (max-width: 370px) {
  .formation-options { grid-template-columns: repeat(3, 1fr); }
  .panel-heading { display: block; }
  .panel-heading > p { max-width: none; margin: 7px 0 0 34px; text-align: left; }
  .commentary-box { width: min(320px, 96%); height: 60px; grid-template-columns: 38px 1fr; }
  .commentary-box p { font-size: 12px; }
  .avatar-frame img { width: 34px; height: 34px; }
  .half-label { margin-top: 7px; }
}

@media (min-width: 700px) {
  body { padding: 22px 0; }
  .game-shell, .match-screen { min-height: min(860px, calc(100dvh - 44px)); border-radius: 28px; }
  .match-screen { box-shadow: none; }
}

@media (min-width: 900px) {
  body {
    padding: 22px 16px 16px;
    background-position: center;
  }

  .game-shell {
    width: min(1100px, 100%);
    min-height: auto;
    padding: 18px 20px 34px;
  }

  .setup-screen {
    display: block;
  }

  .fixture-card {
    margin-bottom: 0;
  }

  .fixture-card .matchup {
    grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr);
    padding: 20px 26px 18px;
  }

  .fixture-card .team-mark {
    width: 58px;
    height: 58px;
    font-size: 16px;
  }

  .fixture-card .team-badge {
    width: 66px;
    height: 66px;
  }

  .fixture-card .matchup-team strong {
    font-size: 21px;
  }

  .setup-layout {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(430px, 1.1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "style squad"
      "transfer squad";
    gap: var(--pb-gap);
    align-items: start;
    margin-top: var(--pb-gap);
    margin-bottom: var(--pb-gap);
  }

  .setup-layout > .style-panel { grid-area: style; }
  .setup-layout > .squad-panel {
    grid-area: squad;
    align-self: stretch;
    display: flex;
    flex-direction: column;
  }
  .setup-layout > .transfer-panel,
  .setup-layout > .transfer-summary-panel {
    grid-area: transfer;
    align-self: stretch;
  }
  .setup-layout > .plan-card { grid-area: plan; }
  .setup-layout > .mobile-plan-card { display: none; }

  .setup-layout > .panel,
  .setup-layout > .plan-card {
    margin: 0;
  }

  .setup-screen > .kickoff-final-card {
    margin-top: 0;
  }

  .style-panel .option-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .style-panel .wide-choice:last-child {
    grid-column: 1 / -1;
  }

  .squad-panel .tactics-board {
    width: min(100%, 410px);
    margin-top: 18px;
  }

  .squad-panel .swap-hint {
    padding-top: 8px;
  }

  .desktop-match-plan {
    display: block;
    margin-top: auto;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 250, 239, .34);
  }

  .match-plan-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .match-plan-facts div {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid rgba(26, 15, 9, .12);
    border-radius: 9px;
    background: rgba(255, 250, 239, .58);
  }

  .match-plan-facts span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .match-plan-facts strong {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .match-plan-warning {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin-top: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(139, 39, 18, .24);
    border-radius: var(--pb-inner-r);
    background: rgba(185, 39, 36, .08);
  }

  .match-plan-warning .plan-icon {
    width: 30px;
    height: 30px;
    margin: 0;
  }

  .match-plan-warning strong {
    display: block;
    margin-bottom: 3px;
    color: #8b2712;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
  }

  .match-plan-warning p,
  .match-plan-ready {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
  }

  .match-plan-ready {
    margin-top: 10px;
    padding: 8px 12px;
    border-left: 3px solid var(--green);
    border-radius: 0 var(--pb-inner-r) var(--pb-inner-r) 0;
    background: rgba(90, 122, 74, .08);
  }

  .squad-panel .pitch-player {
    width: 96px;
  }

  .squad-panel .pitch-player img {
    width: 62px;
    height: 62px;
  }

  .squad-panel .pitch-player strong {
    font-size: 15px;
  }

  .squad-panel .pitch-player span {
    font-size: 10px;
  }

  .transfer-player-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .transfer-card,
  .transfer-target-main {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    min-height: 60px;
    padding: 9px;
    padding-right: 44px;
  }

  .transfer-card img,
  .transfer-target-main img,
  .transfer-summary img {
    width: 42px;
    height: 42px;
  }

  .transfer-card strong,
  .transfer-target-main strong,
  .transfer-summary strong {
    font-size: 13px;
  }

  .match-screen {
    width: min(var(--pb-desktop-w), 100%);
    min-height: min(900px, calc(100dvh - 142px));
    margin-top: 18px;
    padding: 0 20px 0;
    display: flex;
    flex-direction: column;
  }

  .scoreboard {
    min-height: 80px;
    width: 100%;
    max-width: var(--pb-desktop-w);
    margin: 0 auto;
    border-radius: 22px;
  }

  .score-team {
    gap: 12px;
    padding: 14px 20px;
  }

  .score-name {
    font-size: 17px;
    letter-spacing: 0.01em;
  }

  .score-badge {
    width: 40px;
    height: 40px;
  }

  .scoreline-block {
    padding: 12px 22px;
    gap: 8px;
  }

  .score-number {
    font-size: 42px;
    min-width: 28px;
    letter-spacing: -0.03em;
    font-weight: 800;
  }

  .score-sep {
    font-size: 26px;
  }

  .match-meta {
    padding: 9px 10px 0;
    font-size: 12px;
  }

  .half-label {
    margin: 7px 0 3px;
    font-size: 12px;
  }

  .event-board {
    height: 58px;
    max-height: 58px;
    padding: 0 56px;
    overflow: hidden;
    font-size: 11px;
  }

  .event-board > div {
    max-height: 58px;
    overflow: auto;
  }

  .event-board p {
    margin: 2px 0;
    padding: 1px 7px;
    line-height: 1.25;
  }

  .live-ratings-grid {
    gap: 12px;
    margin: auto 0 0;
  }

  .live-ratings-grid section {
    padding: 7px 8px;
    border-radius: 12px;
  }

  .live-ratings-grid section > p {
    margin-bottom: 4px;
    font-size: 9px;
  }

  .live-rating-row {
    grid-template-columns: 24px minmax(0, 1fr) 34px;
    gap: 7px;
    min-height: 30px;
    padding: 3px 7px;
  }

  .live-rating-row img {
    width: 24px;
    height: 24px;
  }

  .live-rating-row .lr-name-wrap {
    font-size: 11px;
  }

  .live-rating-row small {
    font-size: 9px;
  }

  .live-rating-row strong {
    font-size: 12px;
  }

  .commentary-stage {
    position: static;
    flex: 0 0 auto;
    margin-top: 12px;
    padding: 0;
  }

  .commentary-box {
    width: min(680px, 94%);
    height: 68px;
  }

  .match-footer {
    position: static;
    flex: 0 0 auto;
    width: min(980px, 100%);
    margin: 8px auto 0;
    padding: 7px 10px 7px;
    border: 1px solid rgba(245, 237, 216, .13);
    border-radius: 14px;
    background: rgba(0, 0, 0, .22);
    box-shadow: inset 0 1px rgba(255, 255, 255, .06);
  }

  .match-progress-wrap {
    padding: 0 0 6px;
  }

  .speed-controls {
    gap: 12px;
  }

  .speed-controls .pause-control {
    min-width: 70px;
    min-height: 32px;
    padding: 7px 12px;
  }

  .speed-slider-wrap {
    flex: 0 1 430px;
    max-width: 430px;
  }

  .match-screen .ht-overlay {
    inset: 24px 18% auto;
    max-height: calc(100% - 48px);
    border: 1px solid rgba(255, 255, 255, .56);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .48);
    padding: 22px 26px 26px;
  }

  .ht-overlay .option-list {
    grid-template-columns: 1fr;
  }

  .ht-overlay .wide-choice:last-child {
    grid-column: auto;
  }

  .report-screen {
    width: min(1100px, 100%);
  }

  .report-header {
    padding: 18px 22px 21px;
  }

  .report-header h1 {
    font-size: 55px;
  }

  .report-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--pb-gap);
  }

  .report-layout .panel {
    margin: 11px 0;
  }

  /* Panels inside report flex columns must have no margin - gap handles spacing.
     This rule appears directly after the general margin rule to guarantee
     it wins on same-specificity cascade regardless of align-self value. */
  .report-analysis-column > .panel,
  .report-analysis-column .report-analysis-panels > .panel,
  .report-performance-column > .panel {
    margin-top: 0;
    margin-bottom: 0;
  }

  .report-analysis-panels {
    display: grid;
    gap: var(--pb-gap);
    align-items: start;
  }

  /* Daily report: rating breakdown is full-width above the two-column layout.
     Tactical panels sit on the left; ratings and HT switch sit on the right. */
  .daily-report .report-layout {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .daily-report .report-analysis-column {
    display: flex;
    flex-direction: column;
    gap: var(--pb-gap);
  }

  .daily-report .rating-breakdown-panel {
    margin: 0 0 var(--pb-gap);
  }

  .daily-report .rating-breakdown-grid {
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin-top: 12px;
  }

  .daily-report .streak-summary {
    grid-template-columns: repeat(4, 1fr);
  }

  /* JS adds .streak-five when Average Rating item is present (totalDays > 1) */
  .daily-report .streak-summary.streak-five {
    grid-template-columns: repeat(5, 1fr);
  }

  /* Verdict and Analysis stack full-width in left column */
  .daily-report .report-analysis-panels {
    grid-template-columns: 1fr;
    align-content: start;
  }

  /* Zero margins so gaps are consistent on all sides */
  .daily-report .report-analysis-panels > .panel {
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 22px;
  }

  .daily-report .report-performance-column {
    display: flex;
    flex-direction: column;
    gap: var(--pb-gap);
  }

  /* Remove inherited panel margins inside flex columns */
  .daily-report .report-performance-column > .panel {
    margin-top: 0;
    margin-bottom: 0;
  }

  /* Last panel in each column stretches to fill equal column height */
  .daily-report .report-analysis-column > .transfer-summary-panel {
    flex: 1;
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 15px;
  }

  /* Extra padding so HT switch bottom aligns with transfer panel bottom */
  .daily-report .report-performance-column > .ht-report-panel {
    flex: 1;
    padding-bottom: 15px;
  }

  .daily-report .report-stats-panel {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .daily-report .report-ratings-panel .player-ratings {
    grid-template-columns: 1fr;
  }

  .daily-report .report-ratings-panel .motm-card {
    margin-top: 4px;
    margin-bottom: 8px;
    padding: 7px 12px;
  }

  .daily-report .report-stats-panel .stats-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }

  .daily-report .report-stats-panel .stat-row {
    padding: 8px 3px;
  }

  /* Practice report follows the same clear analysis/performance split. */
  .practice-report .report-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }

  /* Practice mode: analysis column is a flex column - all boxes share space equally */
  .practice-report .report-analysis-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  /* Dissolve the wrapper so Verdict and Tactical Analysis become direct flex siblings */
  .practice-report .report-analysis-panels {
    display: contents;
  }

  /* All panels inside the dissolved wrapper get equal share */
  .practice-report .report-analysis-panels > .panel {
    flex: 1;
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
  }

  /* HT Switch: equal share */
  .practice-report .report-analysis-column > .ht-report-panel {
    flex: 1;
    margin-top: 0;
    margin-bottom: 0;
  }

  .practice-report .report-performance-column {
    display: flex;
    flex-direction: column;
  }

  .practice-report .report-stats-panel {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .practice-report .report-ratings-panel {
    flex: 1;
    margin-top: 0;
    margin-bottom: 0;
    padding: 10px 12px;
  }

  .practice-report .player-ratings {
    gap: 5px;
  }

  .practice-report .rating-row {
    padding: 6px 9px;
  }

  .practice-report .motm-card {
    margin: 6px 0 8px;
  }

  .practice-report .player-ratings {
    grid-template-columns: 1fr;
  }

  .practice-report .report-stats-panel .stats-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }

  .practice-report .report-stats-panel .stat-row {
    padding: 8px 3px;
  }

  .practice-report .report-ratings-panel .motm-card {
    margin-bottom: 12px;
  }

  .report-analysis-column > .ht-report-panel {
    margin-top: 0;
  }

  .report-actions {
    margin: 10px 0 0;
  }

  .player-profile-modal {
    width: min(720px, 100%);
    max-height: min(760px, calc(100dvh - 36px));
    padding: 18px;
  }

  .player-profile-modal header {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 12px;
  }

  .player-profile-modal header img {
    width: 76px;
    height: 76px;
  }

  .player-profile-modal h2 {
    font-size: 38px;
  }

  .profile-bio-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .profile-bio-grid div {
    padding: 9px 10px;
  }

  .profile-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .profile-group {
    padding: 9px;
  }

  .profile-group:last-child {
    grid-column: 1 / -1;
  }

  .profile-stat {
    padding: 7px 8px;
  }

  .profile-stat span {
    font-size: 11px;
  }
}

/* ── Half-time overlay ──────────────────────────────────────────── */
.ht-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: rgba(248, 236, 214, .98);
  border-radius: 20px 20px 0 0;
  border: none;
  box-shadow: none;
  backdrop-filter: blur(12px);
  padding: 14px 14px 18px;
  display: flex;
  flex-direction: column;
}
.ht-overlay::-webkit-scrollbar { display: none; }
.ht-title {
  font: 400 26px/1 "Cormorant Garamond", Georgia, serif;
  color: var(--carrot-dark);
  text-align: center;
  margin: 0 0 2px;
  text-shadow: none;
}
.ht-score {
  color: var(--ink);
  font-family: "Bree Serif", serif;
  font-size: 15px;
  text-align: center;
  margin: 0 0 2px;
}
.ht-plan-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  text-align: center;
  margin: 0 0 8px;
}
.ht-overlay .section-label { color: var(--carrot-dark); margin-bottom: 6px; margin-top: 8px; }
.ht-overlay .choice-button {
  background: rgba(255,250,240,.58);
  border-color: rgba(26,15,9,.16);
  color: var(--ink);
  min-height: 36px;
  padding: 6px 5px;
}
.ht-overlay .choice-button span { color: var(--muted); text-transform: none; font-size: 10px; }
.ht-style-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-bottom: 14px;
}
.ht-style-grid .choice-button {
  flex: 0 0 calc(33.33% - 5px);
  min-height: 52px;
  padding: 8px 6px;
}
.ht-overlay .choice-button.selected {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}
.ht-overlay .choice-button.selected span { color: #d9ebd8; }
.ht-overlay .wide-choice {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 9px 12px;
  background: rgba(255,250,240,.58);
  border-color: rgba(26,15,9,.16);
  color: var(--ink);
}
.ht-overlay .wide-choice strong {
  font-size: 13px;
}
.ht-overlay .wide-choice span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}
.ht-overlay .wide-choice.selected {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}
.ht-overlay .wide-choice.selected span { color: rgba(245,237,216,0.78); }
.ht-overlay .option-list { gap: 5px; }
.ht-adjust-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(270px, .92fr);
  gap: 14px;
  align-items: start;
  margin-top: 8px;
}
.ht-adjust-panel {
  min-width: 0;
}
.ht-shape-panel .formation-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}
.ht-shape-panel .choice-button {
  grid-column: span 2;
}
.ht-shape-panel .choice-button:nth-child(4) {
  grid-column: 2 / span 2;
}
.ht-shape-panel .choice-button:nth-child(5) {
  grid-column: 4 / span 2;
}
.ht-lineup-preview {
  width: min(100%, 246px);
  margin: 12px auto 0;
}
.ht-lineup-preview-inner {
  display: grid;
  gap: 7px;
  justify-items: center;
}
.ht-preview-board {
  width: 208px;
  margin: 0;
  border-width: 2px;
  border-radius: 10px;
}
.ht-preview-board .compact-pitch-player { width: 58px; }
.ht-preview-board .compact-pitch-player img {
  width: 34px;
  height: 34px;
}
.ht-preview-board .compact-pitch-player strong {
  font-size: 9px;
}
.ht-preview-board .compact-pitch-player span {
  padding: 1px 4px;
  font-size: 9px;
}
.ht-lineup-note {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(26, 15, 9, .14);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 250, 240, .58);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}
.ht-kickoff-btn {
  display: block;
  width: min(100%, 208px);
  min-height: 50px;
  margin: 12px auto 0;
  border-radius: 22px;
  font-size: 15px;
}

/* ── Half-time switch report section ────────────────────────────── */
.ht-report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 6px;
}
.ht-report-half {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,250,239,.6);
  border: 1px solid rgba(26,15,9,.15);
}
.ht-report-label {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}
.ht-report-tactics {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.ht-report-grade {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
.ht-report-change {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark, #3a5a2a);
}
.change-arrow {
  width: 8px;
  height: 10px;
  display: inline-block;
  flex: 0 0 auto;
  margin: 0 1px;
  border-radius: 1px;
  background: var(--green);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.ht-report-verdict {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.swap-hint {
  margin: 7px 0 0;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

/* ── Manager Rating chip (report header) ──────────────────────────── */
.manager-rating-chip {
  flex: 0 0 auto;
  min-width: 90px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 16px;
  background: rgba(255, 240, 213, .14);
  box-shadow: inset 0 1px rgba(255, 255, 255, .18);
  text-align: center;
  backdrop-filter: blur(10px);
}
.manager-rating-chip span {
  display: block;
  color: #F5A84E;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .55);
  margin-bottom: 3px;
  white-space: nowrap;
}
.manager-rating-chip strong {
  display: block;
  color: white;
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
}
.manager-rating-chip strong small {
  font-size: 14px;
  opacity: 0.65;
  font-weight: 400;
}

/* ── Daily-mode-only locked panels (shown in practice report) ─────── */
.daily-only-panel .section-label {
  opacity: 0.55;
}
.daily-only-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ── Rating breakdown panel ───────────────────────────────────────── */
.rating-breakdown-panel { padding-bottom: 16px; }
.rating-breakdown-grid {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 10px;
}
.rating-row-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 5px;
  gap: 3px 10px;
  align-items: center;
}
.rating-row-item > span {
  grid-row: 1;
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.rating-row-item > strong {
  grid-row: 1 / 3;
  grid-column: 2;
  font-size: 17px;
  font-weight: 800;
  text-align: right;
  color: var(--ink);
  white-space: nowrap;
}
.rating-row-item > strong small {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.55;
}
.rating-bar-wrap {
  grid-row: 2;
  grid-column: 1;
  height: 5px;
  background: rgba(26, 15, 9, .1);
  border-radius: 999px;
  overflow: hidden;
}
.rating-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--carrot-dark), var(--carrot));
  transition: width 0.5s ease;
  min-width: 3px;
}

/* ── Streak summary (inside breakdown panel) ──────────────────────── */
.streak-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* 5-item layout on mobile: 3+2 avoids a single orphan */
.streak-summary.streak-five {
  grid-template-columns: repeat(3, 1fr);
}

.streak-summary.streak-five .streak-summary-item:nth-child(4),
.streak-summary.streak-five .streak-summary-item:nth-child(5) {
  grid-column: span 1;
}

/* Centre the bottom pair when in 3-col layout */
.streak-summary.streak-five .streak-summary-item:nth-child(4) {
  grid-column: 1 / 2;
}
.streak-summary.streak-five .streak-summary-item:nth-child(5) {
  grid-column: 2 / 3;
}
.streak-summary-item {
  padding: 7px 9px;
  border: 1px solid rgba(26, 15, 9, .1);
  border-radius: var(--pb-inner-r);
  background: rgba(255, 250, 239, .5);
}
.streak-summary-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 2px;
}
.streak-summary-item strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

/* Leaderboard pts small tag */
.pb-pts small {
  font-size: 10px;
  opacity: 0.65;
  font-weight: 400;
}
.lb-manager-note {
  margin: 8px 0 0;
  color: rgba(44, 26, 10, .52);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

@media (min-width: 900px) {
  .team-name-short {
    display: none;
  }

  .team-name-full {
    display: inline;
  }

  .daily-report .rating-breakdown-panel {
    padding: 24px 26px 26px;
  }

  .daily-report .rating-breakdown-grid {
    gap: 13px;
  }

  .daily-report .rating-row-item {
    grid-template-columns: minmax(170px, 220px) minmax(0, 1fr) 72px;
    grid-template-rows: auto;
    gap: 14px;
  }

  .daily-report .rating-row-item > span,
  .daily-report .rating-bar-wrap,
  .daily-report .rating-row-item > strong {
    grid-row: auto;
    grid-column: auto;
  }

  .daily-report .rating-row-item > span {
    align-self: center;
  }

  .daily-report .rating-row-item > strong {
    align-self: center;
  }

  .daily-report .streak-summary,
  .daily-report .streak-summary.streak-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
  }

  .daily-report .streak-summary:not(.streak-five) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .daily-report .streak-summary.streak-five .streak-summary-item:nth-child(4),
  .daily-report .streak-summary.streak-five .streak-summary-item:nth-child(5) {
    grid-column: auto;
  }

  .daily-report .streak-summary-item {
    min-height: 64px;
    padding: 12px 14px;
    display: grid;
    align-content: center;
  }

  .daily-report .streak-summary-item strong {
    font-size: 16px;
  }
}

@media (max-width: 899px) {
  .transfer-player-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .ht-report-change {
    gap: 5px;
    font-size: 11px;
  }

  .change-arrow {
    width: 8px;
    height: 10px;
    margin: 0;
    border-radius: 1px;
  }

  .ht-overlay {
    padding: 16px 14px 18px;
  }

  .ht-title {
    font-size: 25px;
  }

  .ht-score {
    font-size: 14px;
  }

  .ht-plan-hint {
    margin-bottom: 10px;
  }

  .ht-adjust-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ht-shape-panel .formation-options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
  }

  .ht-shape-panel .choice-button {
    grid-column: auto;
    min-height: 42px;
    padding: 6px 4px;
    border-radius: 14px;
  }

  .ht-shape-panel .choice-button strong {
    font-size: 15px;
    line-height: 1;
  }

  .ht-shape-panel .choice-button span {
    display: none;
  }

  .ht-lineup-preview {
    width: min(100%, 230px);
    margin-top: 10px;
  }

  .ht-preview-board {
    width: 190px;
  }

  .ht-preview-board .compact-pitch-player {
    width: 52px;
  }

  .ht-preview-board .compact-pitch-player img {
    width: 30px;
    height: 30px;
  }

  .ht-preview-board .compact-pitch-player strong,
  .ht-preview-board .compact-pitch-player span {
    font-size: 8px;
  }

  .ht-style-panel .option-list {
    grid-template-columns: 1fr;
  }

  .ht-overlay .wide-choice {
    grid-template-columns: 94px minmax(0, 1fr);
    min-height: 46px;
  }

  .ht-kickoff-btn {
    min-height: 48px;
  }
}

@media (max-width: 430px) {
  .kickoff-final-card {
    grid-template-columns: 1fr;
  }
  .kickoff-final-card .kickoff-button {
    width: 100%;
  }
  .transfer-budget-strip {
    grid-template-columns: 1fr;
  }
  .ht-adjust-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ht-shape-panel .formation-options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }
  .ht-shape-panel .choice-button {
    grid-column: auto;
    min-height: 40px;
    padding: 6px 3px;
  }
  .ht-shape-panel .choice-button strong {
    font-size: 14px;
  }
  .ht-preview-board {
    width: 176px;
  }
  .ht-preview-board .compact-pitch-player { width: 50px; }
  .ht-preview-board .compact-pitch-player img {
    width: 30px;
    height: 30px;
  }
  .ht-preview-board .compact-pitch-player strong,
  .ht-preview-board .compact-pitch-player span {
    font-size: 8px;
  }
  .ht-lineup-note {
    padding: 8px 9px;
    font-size: 11px;
    line-height: 1.32;
  }
  .transfer-player-grid {
    grid-template-columns: 1fr;
  }
  .transfer-summary {
    grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
    gap: 7px;
  }
  .transfer-arrow {
    width: 22px;
    height: 22px;
  }
  .transfer-arrow::before {
    width: 6px;
    height: 6px;
    border-width: 1.75px;
  }
  .transfer-summary > div {
    display: grid;
    justify-items: center;
    gap: 4px;
    text-align: center;
  }
  .pb-row {
    grid-template-columns: 28px 34px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px 9px;
  }
  .pb-rank.pb-rank--medal { font-size: 22px; }
  .pb-av-wrap { width: 32px; height: 32px; }
  .pb-name { font-size: 13px; }
  .pb-manager-meta { font-size: 10px; }
  .pb-pts { font-size: 13px; }
}

@media (max-width: 340px) {
  .ht-shape-panel .formation-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
