:root {
  --bg: #edf7f0;
  --bg-panel: rgba(255, 255, 255, 0.88);
  --bg-card: #f6fbf7;
  --pitch: #3d9b63;
  --pitch-dark: #2f7f50;
  --pitch-line: rgba(255, 255, 255, 0.75);
  --text: #163322;
  --muted: #5d7a68;
  --accent: #d4a017;
  --accent-hover: #e8b422;
  --danger: #d64545;
  --success: #2d9f62;
  --border: rgba(22, 51, 34, 0.12);
  --shadow: 0 14px 40px rgba(10, 28, 18, 0.18);
  --radius: 14px;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Outfit", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  background: #0d1f16;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

/* --- Stadium atmosphere --- */
.stadium-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.stadium-photos {
  position: absolute;
  inset: 0;
}

.stadium-photo {
  position: absolute;
  inset: -4%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 1.8s ease-in-out;
  filter: saturate(1.05) contrast(1.05);
  will-change: opacity;
}

.stadium-photo.is-active {
  opacity: 1;
  animation: stadium-drift 42s ease-in-out infinite alternate;
}

.stadium-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 22, 16, 0.55) 0%, rgba(12, 32, 22, 0.42) 38%, rgba(18, 48, 32, 0.58) 100%),
    radial-gradient(ellipse 90% 70% at 50% 35%, rgba(61, 155, 99, 0.18), transparent 58%),
    radial-gradient(ellipse at center, transparent 42%, rgba(6, 16, 12, 0.72) 100%);
}

.stadium-floodlights {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 28% 40% at 12% 0%, rgba(255, 248, 220, 0.22), transparent 70%),
    radial-gradient(ellipse 28% 40% at 88% 0%, rgba(255, 248, 220, 0.2), transparent 70%),
    radial-gradient(ellipse 40% 28% at 50% 105%, rgba(212, 160, 23, 0.12), transparent 65%);
  animation: floodlight-breathe 7s ease-in-out infinite;
}

.stadium-haze {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.04) 48%, transparent 62%);
  background-size: 220% 100%;
  animation: haze-sweep 16s linear infinite;
}

@keyframes stadium-drift {
  from { transform: scale(1.05) translate(0, 0); }
  to { transform: scale(1.1) translate(-1.5%, -1%); }
}

@keyframes floodlight-breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes haze-sweep {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.app {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(1680px, 96vw);
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px 32px 40px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise-in 0.55s ease both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  overflow: visible;
}

.brand-logo {
  width: clamp(96px, 14vw, 150px);
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 14px rgba(10, 28, 18, 0.28));
}

.brand-text {
  min-width: 0;
  flex: 1;
  overflow: visible;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
  padding-block: 0.12em 0.16em;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: linear-gradient(135deg, #163322 0%, #2f7f50 55%, #9a7209 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Gradient text often clips condensed glyphs; keep paint box a bit taller */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.header-meta {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: right;
  max-width: 280px;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.header-actions .btn {
  white-space: nowrap;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: rise-in 0.6s ease both;
}

.setup-panel {
  max-width: none;
  animation-delay: 0.08s;
}

.game-layout > .roster-panel { animation: rise-in 0.55s ease both; animation-delay: 0.05s; }
.game-layout > .spin-panel { animation: rise-in 0.55s ease both; animation-delay: 0.12s; }
.game-layout > .info-panel { animation: rise-in 0.55s ease both; animation-delay: 0.18s; }

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.hint {
  color: var(--muted);
  margin: 0 0 16px;
}

.hidden {
  display: none !important;
}

.formation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.formation-card {
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 22px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
  color: inherit;
  font: inherit;
}

.formation-card:hover {
  border-color: rgba(212, 160, 23, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(22, 51, 34, 0.1);
}

.formation-card.selected {
  border-color: var(--accent);
  background: rgba(212, 160, 23, 0.1);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15);
}

.formation-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #2a2100;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-spin {
  background: var(--pitch);
  color: white;
  min-width: 96px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn-spin:hover:not(:disabled) {
  background: var(--pitch-dark);
  transform: translateY(-1px);
}

.btn-spin.is-spinning {
  pointer-events: none;
  animation: spin-btn-pulse 0.55s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(61, 155, 99, 0.25);
}

@keyframes spin-btn-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  margin-top: 12px;
}

.btn-block {
  width: 100%;
  margin-top: 20px;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1.35fr) minmax(340px, 1.4fr) minmax(190px, 0.55fr);
  gap: 20px;
  align-items: start;
}

.roster-panel {
  min-width: 0;
}

.spin-panel {
  min-width: 0;
}

.info-panel {
  min-width: 0;
}

/* --- Pitch formation view --- */
.pitch-field {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  max-height: min(68vh, 620px);
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.045) 0,
      rgba(255, 255, 255, 0.045) 10%,
      transparent 10%,
      transparent 20%
    ),
    linear-gradient(180deg, #4aad6e 0%, var(--pitch) 45%, var(--pitch-dark) 100%);
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 12px 28px rgba(10, 40, 22, 0.28);
}

.pitch-field::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid var(--pitch-line);
  border-radius: 4px;
  pointer-events: none;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.08);
}

.pitch-field::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: none;
  background:
    linear-gradient(var(--pitch-line), var(--pitch-line)) center / 100% 2px no-repeat,
    radial-gradient(circle, transparent 44%, var(--pitch-line) 45%, var(--pitch-line) 48%, transparent 49%) center / 30% 20% no-repeat;
}

.pitch-field-empty {
  background:
    linear-gradient(180deg, #5cb57d 0%, var(--pitch) 50%, var(--pitch-dark) 100%);
}

.pitch-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  color: white;
  font: inherit;
  text-align: center;
  z-index: 1;
}

.pitch-slot.releasable {
  cursor: pointer;
}

.pitch-dot {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.98);
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: 0.15s ease;
}

.pitch-slot.filled .pitch-dot {
  background: linear-gradient(145deg, #ffffff 0%, #dff5e8 100%);
  border-color: #ffffff;
}

.pitch-slot.empty .pitch-dot {
  border-style: dashed;
  background: rgba(0, 0, 0, 0.12);
}

.pitch-slot.releasable:hover .pitch-dot {
  border-color: #ffd0d0;
  background: linear-gradient(145deg, #fff0f0 0%, #ffd8d8 100%);
  transform: scale(1.06);
}

.pitch-slot.selected .pitch-dot {
  border-color: #ffe08a;
  background: linear-gradient(145deg, #fff9df 0%, #ffe8a8 100%);
  box-shadow: 0 0 0 4px rgba(255, 224, 138, 0.35);
  transform: scale(1.06);
}

.pitch-pos {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.1;
  -webkit-font-smoothing: antialiased;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 0 8px rgba(0, 0, 0, 0.35);
}

.pitch-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.15;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 0 8px rgba(0, 0, 0, 0.35);
}

.pitch-slot.empty.dimmed .pitch-dot {
  opacity: 0.35;
}

.pitch-slot.draftable {
  cursor: pointer;
}

.pitch-slot.draftable-highlight .pitch-dot {
  border-color: #ffe08a;
  border-style: solid;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 224, 138, 0.45);
  animation: pitch-slot-pulse 1.4s ease-in-out infinite;
}

.pitch-slot.draftable:hover .pitch-dot,
.pitch-slot.draftable:focus-visible .pitch-dot {
  border-color: #ffffff;
  background: linear-gradient(145deg, #fff9df 0%, #ffe8a8 100%);
  transform: scale(1.08);
  box-shadow: 0 0 0 5px rgba(255, 224, 138, 0.55);
}

@keyframes pitch-slot-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 224, 138, 0.35); }
  50% { box-shadow: 0 0 0 7px rgba(255, 224, 138, 0.55); }
}

.pitch-slot.empty .pitch-name {
  opacity: 0.75;
  font-weight: 600;
}

.transfer-preview {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(212, 160, 23, 0.3);
  border-radius: 12px;
  background: linear-gradient(145deg, #fffdf5, #f7fbf8);
}

.transfer-preview h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
}

.transfer-player-meta {
  margin: 0 0 16px;
  color: var(--muted);
}

.transfer-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.transfer-metrics div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
}

.transfer-metrics span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.transfer-metrics strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--success);
}

.transfer-actions {
  display: flex;
  gap: 8px;
}

.transfer-actions .btn-ghost {
  margin-top: 0;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #bd3838;
}

.badge {
  background: rgba(212, 160, 23, 0.15);
  color: #9a7209;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.spin-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.spin-machine {
  margin-bottom: 14px;
  padding: 18px 16px 14px;
  border-radius: 16px;
  background:
    radial-gradient(ellipse at top, rgba(212, 160, 23, 0.12), transparent 55%),
    linear-gradient(165deg, #234f35 0%, #163322 58%, #123028 100%);
  color: #f4faf6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow);
}

.spin-machine.is-locked {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 2px rgba(212, 160, 23, 0.45),
    var(--shadow);
}

.spin-machine.is-locked .spin-machine-status {
  color: var(--accent);
  font-weight: 600;
}

.spin-reels {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
}

.spin-reel-label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 250, 246, 0.62);
}

.spin-reel-window {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spin-reel-window::before,
.spin-reel-window::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 16px;
  pointer-events: none;
  z-index: 1;
}

.spin-reel-window::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent);
}

.spin-reel-window::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.45), transparent);
}

.spin-reel-value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  text-align: center;
  padding: 12px 14px;
  letter-spacing: 0.02em;
  transition: opacity 0.08s linear, transform 0.08s linear;
}

.spin-machine.is-rolling .spin-reel-value {
  animation: reel-blur-tick 0.1s linear infinite;
}

.spin-machine.is-landing .spin-reel-value {
  animation: reel-land 0.45s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.spin-machine.is-landing .spin-reel:nth-child(2) .spin-reel-value {
  animation-delay: 0.12s;
}

.spin-machine-status {
  margin: 14px 0 0;
  text-align: center;
  color: rgba(244, 250, 246, 0.72);
  font-size: 0.9rem;
}

@keyframes reel-blur-tick {
  0% { transform: translateY(-5px); opacity: 0.45; filter: blur(1.5px); }
  50% { transform: translateY(3px); opacity: 0.95; filter: blur(0); }
  100% { transform: translateY(6px); opacity: 0.4; filter: blur(1.5px); }
}

@keyframes reel-land {
  0% { transform: translateY(-18px) scale(0.96); opacity: 0.35; }
  55% { transform: translateY(3px) scale(1.03); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@media (max-width: 720px) {
  .spin-reels {
    grid-template-columns: 1fr;
  }
}

.tag {
  background: rgba(22, 51, 34, 0.06);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.tag-team {
  background: rgba(212, 160, 23, 0.15);
  color: #9a7209;
}

.player-list {
  display: grid;
  gap: 10px;
  max-height: min(52vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  align-content: start;
}

.player-list::-webkit-scrollbar {
  width: 8px;
}

.player-list::-webkit-scrollbar-thumb {
  background: rgba(22, 51, 34, 0.28);
  border-radius: 999px;
}

.player-list::-webkit-scrollbar-track {
  background: rgba(22, 51, 34, 0.06);
  border-radius: 999px;
}

.player-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: 0.15s ease;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
}

.player-card:hover:not(:disabled) {
  border-color: rgba(212, 160, 23, 0.45);
  transform: translateY(-1px);
}

.player-card.selected {
  border-color: var(--accent);
  background: rgba(212, 160, 23, 0.08);
}

.player-card.unavailable {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(22, 51, 34, 0.04);
}

.player-card.unavailable.on-roster {
  border-color: rgba(214, 69, 69, 0.25);
}

.player-card-main {
  min-width: 0;
}

.player-name {
  font-weight: 600;
}

.player-positions,
.player-stats {
  color: var(--muted);
  font-size: 0.85rem;
}

.player-positions {
  margin-top: 4px;
}

.player-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(22, 51, 34, 0.06);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.player-card.on-roster .player-badge {
  background: rgba(214, 69, 69, 0.12);
  color: var(--danger);
}

.placement-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(145deg, #fffdf5, #f7fbf8);
  border: 1px solid rgba(212, 160, 23, 0.25);
}

.placement-hint p {
  margin: 0;
  font-size: 0.92rem;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.position-picker {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.position-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pos-btn {
  background: var(--pitch);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.pos-btn:hover {
  background: var(--pitch-dark);
}

.status-list {
  margin: 0;
}

.status-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.status-list dt {
  color: var(--muted);
}

.status-list dd {
  margin: 0;
  font-weight: 600;
}

.empty-state {
  color: var(--muted);
  padding: 32px 12px;
  text-align: center;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 10px;
  background: #fff5f5;
  border: 1px solid rgba(214, 69, 69, 0.35);
  color: #8f2d2d;
  box-shadow: var(--shadow);
  z-index: 100;
}

.toast.success {
  background: #f0faf4;
  border-color: rgba(45, 159, 98, 0.35);
  color: #1f6b42;
}

.results-panel {
  max-width: none;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.results-badge {
  background: rgba(45, 159, 98, 0.15);
  color: var(--success);
  font-weight: 700;
}

.results-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.results-badge-perfect {
  background: linear-gradient(135deg, rgba(212, 160, 23, 0.22), rgba(255, 224, 138, 0.35));
  color: #8a5a00;
  border: 1px solid rgba(212, 160, 23, 0.45);
}

.transfer-window-badge {
  background: rgba(212, 160, 23, 0.18);
  color: #8a5a00;
  font-weight: 700;
}

.transfer-gate {
  margin-top: 8px;
  padding: 22px 22px 20px;
  border-radius: 16px;
  border: 1px solid rgba(212, 160, 23, 0.45);
  background:
    linear-gradient(145deg, rgba(255, 249, 223, 0.95), rgba(247, 251, 248, 0.92)),
    radial-gradient(circle at top right, rgba(212, 160, 23, 0.18), transparent 55%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 10px 28px rgba(90, 60, 0, 0.08);
}

.transfer-gate-kicker {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a07010;
}

.transfer-gate-copy h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
}

.transfer-gate-copy p {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
  line-height: 1.45;
}

.btn-transfer-gate {
  min-width: 220px;
  padding: 14px 22px;
  font-size: 1.05rem;
  box-shadow: 0 8px 18px rgba(212, 160, 23, 0.28);
}

.season-squad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 22px;
}

.season-squad-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 14px 10px;
}

.season-squad-block h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.season-squad-list,
.season-transfer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.season-squad-list li,
.season-transfer-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid rgba(22, 51, 34, 0.08);
  font-size: 0.88rem;
}

.season-squad-list li:first-child,
.season-transfer-list li:first-child {
  border-top: none;
}

.season-squad-pos {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
  min-width: 2.2em;
}

.season-squad-name {
  flex: 1;
  font-weight: 600;
}

.season-transfer-list .transfer-out {
  color: var(--danger);
  font-weight: 600;
}

.season-transfer-list .transfer-in {
  color: var(--success);
  font-weight: 600;
}

.season-transfer-list .transfer-arrow {
  color: var(--muted);
  padding: 0 4px;
}

.results-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.results-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.results-stat-main {
  border-color: rgba(212, 160, 23, 0.35);
  background: rgba(212, 160, 23, 0.08);
}

.results-stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.results-stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.results-stat-main .results-stat-value {
  font-size: 2.5rem;
  color: #9a7209;
}

.results-details {
  margin: 0 0 24px;
}

.results-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.results-details dt {
  color: var(--muted);
}

.results-details dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.results-actions .btn-ghost {
  margin-top: 0;
}

.half-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.half-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.half-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: #9a7209;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.half-record {
  margin: 0 0 4px;
  font-weight: 600;
}

.half-points {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #9a7209;
}

.half-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.results-hero-half {
  margin-bottom: 16px;
}

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 28, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-footer-inner {
  width: min(1680px, 96vw);
  max-width: 1680px;
  margin: 0 auto;
  padding: 18px 32px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  color: rgba(236, 245, 238, 0.78);
  font-size: 0.92rem;
}

.site-footer-credits {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.site-footer-legal {
  margin: 0;
  max-width: 820px;
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(236, 245, 238, 0.62);
}

.site-footer-legal a {
  color: rgba(240, 210, 120, 0.95);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer-legal a:hover {
  color: #ffffff;
}

.site-footer a {
  color: #f0d278;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer a:hover {
  color: #ffffff;
}

.site-footer-divider {
  opacity: 0.45;
}

@media (max-width: 960px) {
  .app {
    width: min(100%, 96vw);
    padding: 20px 16px 28px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px;
    overflow: visible;
  }

  .brand {
    width: 100%;
    gap: 10px;
    align-items: center;
  }

  .brand-logo {
    width: 72px;
  }

  .brand-text .eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
  }

  .brand-text h1 {
    font-size: clamp(1.45rem, 7vw, 2rem);
    line-height: 1.2;
    padding-block: 0.14em 0.18em;
  }

  .header-actions {
    align-items: flex-start;
    width: 100%;
  }

  .header-meta {
    text-align: left;
    max-width: none;
    font-size: 0.88rem;
  }

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

  .game-layout {
    grid-template-columns: 1fr;
  }

  .results-hero {
    grid-template-columns: 1fr;
  }

  .season-squad {
    grid-template-columns: 1fr;
  }

  .transfer-gate {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-transfer-gate {
    width: 100%;
  }

  .half-breakdown {
    grid-template-columns: 1fr;
  }

  .pitch-slot {
    width: 80px;
  }

  .pitch-dot {
    width: 48px;
    height: 48px;
  }

  .pitch-pos {
    font-size: 0.9rem;
  }

  .pitch-name {
    max-width: 80px;
    font-size: 0.82rem;
  }

  .stadium-photo.is-active,
  .stadium-haze {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stadium-photo,
  .stadium-photo.is-active,
  .stadium-floodlights,
  .stadium-haze,
  .panel,
  .header,
  .game-layout > .roster-panel,
  .game-layout > .spin-panel,
  .game-layout > .info-panel,
  .formation-card,
  .btn-spin.is-spinning,
  .pitch-slot.draftable-highlight .pitch-dot {
    animation: none !important;
    transition: none !important;
  }
}
