:root {
  --bg-0: #070b14;
  --bg-1: #10192b;
  --surface: rgba(16, 24, 42, 0.78);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f7fb;
  --muted: #93a0b8;
  --blue: #3b82f6;
  --blue-2: #93c5fd;
  --red: #ef4444;
  --red-2: #fda4af;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(1000px 520px at 8% -10%, rgba(59, 130, 246, 0.28), transparent 55%),
    radial-gradient(760px 420px at 110% 0%, rgba(239, 68, 68, 0.18), transparent 50%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 42%, #090e1a);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

button,
input,
select {
  font: inherit;
}

button {
  touch-action: manipulation;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

:focus-visible {
  outline: 2px solid var(--blue-2);
  outline-offset: 3px;
}

[data-focus]:focus:not(:focus-visible) {
  outline: none;
}

.app-shell {
  width: min(1120px, calc(100% - 20px));
  margin-inline: auto;
  padding: calc(18px + env(safe-area-inset-top)) 0 calc(28px + env(safe-area-inset-bottom));
}

main a {
  color: var(--blue-2);
}

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

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(12, 19, 34, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 22px 16px 18px;
}

.screen.is-active {
  animation: screen-in 0.4s ease;
}

.hero {
  text-align: center;
  margin-bottom: 18px;
}

.hero--compact {
  margin-bottom: 8px;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.7rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.hero-text {
  margin: 10px auto 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.quota {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(5, 10, 20, 0.35);
}

.quota__title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
}

.quota-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quota-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
  font-weight: 700;
}

.quota-list li.is-short strong {
  color: #fde68a;
}

.quota-list li.is-exact {
  outline: 1px solid rgba(74, 222, 128, 0.75);
}

.quota-list li.is-exact strong {
  color: #bbf7d0;
}

.quota-list li.is-over {
  outline: 1px solid rgba(251, 113, 133, 0.9);
}

.quota-list li.is-over strong {
  color: #fecdd3;
}

.meter {
  height: 6px;
  margin: 0 0 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.meter > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #bfdbfe);
  transition: width 0.2s ease;
}

.meter > span.is-invalid {
  background: linear-gradient(90deg, var(--red), #fecdd3);
}

.player-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.player-field {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(5, 10, 20, 0.35);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.player-field:focus-within {
  border-color: rgba(96, 165, 250, 0.8);
  background: rgba(59, 130, 246, 0.1);
}

.player-field:has(input.is-invalid),
.player-field:has(select.is-invalid) {
  border-color: rgba(251, 113, 133, 0.9);
  background: rgba(239, 68, 68, 0.1);
}

.player-field__index {
  flex: none;
  width: 34px;
  color: var(--blue-2);
  font-weight: 800;
  text-align: center;
}

.player-field__body {
  flex: 1;
  min-width: 0;
}

.player-field__label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.player-field input {
  width: 100%;
  padding: 4px 0 2px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.player-field input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.player-field input:focus {
  outline: none;
}

.player-field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px #121a2b inset;
}

.player-field select {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(7, 12, 24, 0.72);
  color: var(--text);
  font-size: 16px;
}

.player-field select.is-invalid {
  border-color: rgba(251, 113, 133, 0.95);
}

.entry-actions {
  margin-top: 16px;
}

.status {
  min-height: 1.4em;
  margin: 0 0 10px;
  color: var(--muted);
  text-align: center;
}

.status.is-error {
  color: var(--red-2);
}

.btn-main,
.btn-ghost {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn-main {
  min-height: 56px;
  border: 0;
  color: white;
  background: linear-gradient(180deg, #60a5fa, #1d4ed8);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.btn-ghost {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.action-stack,
.action-row {
  display: grid;
  gap: 10px;
}

.action-stack {
  margin-top: 18px;
}

.flow-bar {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 14, 28, 0.55);
}

.flow-bar__label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

.steps {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.step-dot.is-done {
  background: var(--blue-2);
}

.step-dot.is-current {
  background: white;
  transform: scale(1.25);
}

.stage {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 8px 0 4px;
}

.draw-video-wrap {
  position: relative;
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: #05070d;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  container-type: inline-size;
}

.draw-video {
  display: block;
  width: 100%;
  height: auto;
  background: #05070d;
  pointer-events: none;
}

.draw-video::-webkit-media-controls {
  display: none !important;
}

.draw-name {
  position: absolute;
  left: 71.6%;
  top: 58.6%;
  width: 16%;
  margin: 0;
  color: #141414;
  font-family: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  font-size: clamp(11px, 3.15cqi, 20px);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 0.92;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ball {
  position: relative;
  display: grid;
  width: 138px;
  height: 138px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.7), transparent 24%),
    radial-gradient(circle at 50% 50%, #ffffff 0 58%, #d5deea 59% 100%);
  box-shadow:
    inset -14px -16px 24px rgba(15, 23, 42, 0.25),
    0 18px 40px rgba(0, 0, 0, 0.35);
  animation: float 3.4s ease-in-out infinite;
}

.ball.is-drawing {
  animation: spin-ball 0.48s linear infinite;
}

.ball__glyph {
  font-size: 62px;
  line-height: 1;
}

.name-reel {
  min-height: 1.15em;
  margin: 0;
  font-size: clamp(2.1rem, 8vw, 4.3rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  text-align: center;
  overflow-wrap: anywhere;
}

.name-reel.is-idle {
  color: rgba(255, 255, 255, 0.45);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
}

.name-reel.is-tick {
  animation: reel-pop 0.12s ease;
}

.name-reel.is-chosen {
  text-shadow: 0 12px 36px rgba(96, 165, 250, 0.45);
  animation: chosen-in 0.35s ease;
}

.reveal {
  text-align: center;
}

.reveal__mark {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
}

.reveal__title {
  margin: 8px 0 0;
  font-size: clamp(2rem, 8vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.reveal__title.is-chosen {
  animation: chosen-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.match-role {
  margin: 10px 0 0;
  color: var(--blue-2);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-undo {
  margin-top: 14px;
}

.opponent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.player-card {
  display: flex;
  min-height: 72px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: var(--text);
  background: rgba(8, 14, 28, 0.55);
  font-weight: 700;
  overflow-wrap: anywhere;
  animation: card-in 0.35s ease both;
}

.player-card__role {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.player-card__name {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.opponent-grid.is-locked .player-card {
  opacity: 0.38;
}

.opponent-grid.is-locked .player-card.is-selected {
  opacity: 1;
  border-color: white;
  background: rgba(59, 130, 246, 0.28);
  transform: scale(1.03);
}

.pair-title {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  text-align: center;
  overflow-wrap: anywhere;
}

.assign-status {
  margin: 8px 0 0;
  color: var(--blue-2);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}

.assign-stage {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.assign-slot.is-shake {
  animation: shake 0.2s linear;
}

.assign-slot {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: center;
}

.assign-slot--a {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.24), rgba(8, 14, 28, 0.4));
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.assign-slot--b {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.22), rgba(8, 14, 28, 0.4));
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.assign-stage.is-settled .assign-slot {
  animation: chosen-in 0.35s ease;
}

.slot-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.assign-slot strong {
  display: block;
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.pair-log-wrap {
  margin-top: 22px;
}

.pair-log-wrap h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.pair-log {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pair-log li {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(5, 10, 20, 0.35);
}

.pair-order {
  width: 22px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.pair-side {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.pair-side--a {
  color: var(--blue-2);
}

.pair-side--b {
  color: var(--red-2);
}

.teams {
  display: grid;
  gap: 14px;
}

.versus {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 800;
  letter-spacing: 0.14em;
}

.team-card {
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.screen[data-screen="final"].is-reveal .team-card {
  animation: team-in 0.55s ease both;
}

.team-card--a {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.24), rgba(10, 16, 30, 0.88) 30%);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.28), var(--shadow);
}

.team-card--b {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.22), rgba(10, 16, 30, 0.88) 30%);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.28), var(--shadow);
}

.screen[data-screen="final"].is-reveal .team-card--b {
  animation-delay: 0.12s;
}

.team-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.team-card h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.team-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.team-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.team-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  animation: row-in 0.4s ease both;
}

.team-card--b .team-list li {
  animation-name: row-in-right;
}

.team-index {
  flex: none;
  width: 1.4rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.team-icon {
  flex: none;
  font-size: 1rem;
  line-height: 1;
}

.team-name {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.team-ovr {
  margin-left: auto;
  color: #fde68a;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.final-actions {
  margin-top: 16px;
}

.team-list li:has(.team-swap) {
  padding: 0;
  background: transparent;
  animation: none;
}

.team-swap {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  text-align: left;
}

.team-swap.is-target {
  border-color: rgba(103, 232, 249, 0.45);
}

.team-swap.is-selected {
  border-color: #67e8f9;
  background: rgba(14, 116, 144, 0.28);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.55);
}

#swap-toggle.is-on {
  border-color: #67e8f9;
  color: #e0f2fe;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.35);
}

.swap-panel {
  width: min(560px, 100%);
  margin: 16px auto 0;
  padding: 16px 16px 14px;
  border: 1px solid rgba(103, 232, 249, 0.45);
  border-radius: 22px;
  background:
    radial-gradient(180px 80px at 50% 0%, rgba(34, 211, 238, 0.16), transparent 70%),
    rgba(6, 14, 28, 0.92);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.18);
  text-align: center;
}

.swap-panel__kicker {
  margin: 0;
  color: #7dd3fc;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.swap-panel__pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.swap-panel__player {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 1.6rem;
  font-style: italic;
  font-weight: 800;
}

.swap-panel__mark {
  color: #67e8f9;
  font-size: 1.4rem;
  font-weight: 800;
}

.swap-panel__preview {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: #fde68a;
  font-weight: 700;
}

.swap-panel__confirm {
  width: min(320px, 100%);
  margin-top: 12px;
}

.swap-panel__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.swap-panel__exit {
  margin-top: 8px;
}

.final-hero {
  margin-bottom: 16px;
  text-align: center;
}

.final-badge {
  display: inline-flex;
  margin: 0;
  padding: 6px 14px;
  border: 1px solid rgba(103, 232, 249, 0.55);
  border-radius: 999px;
  background: rgba(8, 47, 73, 0.72);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.28);
  color: #a5f3fc;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.final-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 10px 0 0;
  color: #f8fbff;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 0.95;
  text-shadow: 0 10px 30px rgba(56, 189, 248, 0.28);
}

.final-title::before,
.final-title::after {
  content: "";
  width: min(88px, 10vw);
  height: 2px;
  flex: none;
  background: linear-gradient(90deg, transparent, #67e8f9);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.75);
}

.final-title::after {
  transform: scaleX(-1);
}

.final-meta {
  margin: 8px 0 0;
  color: #dbeafe;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.final-scoreline,
.final-rosters {
  display: grid;
  gap: 12px;
}

.final-side {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(16, 32, 58, 0.78), rgba(6, 12, 24, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.final-side--a {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 22px rgba(14, 165, 233, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.final-side--b {
  border-color: rgba(251, 113, 133, 0.55);
  box-shadow: 0 0 22px rgba(244, 63, 94, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.final-side__crest {
  font-size: 1.6rem;
  line-height: 1;
}

.final-side h2,
.final-side p {
  margin: 0;
}

.final-side h2 {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 1.7rem;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.final-side__count,
.final-side__avg {
  color: #dbeafe;
  font-weight: 700;
}

.final-vs {
  margin: 0;
  color: #f8fbff;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 0 18px rgba(125, 211, 252, 0.45);
}

#screen-final .team-card {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 32, 58, 0.82), rgba(6, 12, 24, 0.9));
  backdrop-filter: blur(10px);
}

#screen-final .team-card__header {
  align-items: center;
  gap: 12px;
}

.team-card__identity,
.team-card__stats {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.team-card__stats {
  margin-left: auto;
  color: #dbeafe;
  font-size: 0.82rem;
  font-weight: 800;
}

.team-role {
  display: inline-grid;
  min-width: 2.4rem;
  place-items: center;
  padding: 3px 6px;
  border-radius: 7px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.team-role--goalkeeper { background: #d4a017; }
.team-role--defense { background: #2563eb; }
.team-role--midfield,
.team-role--rightWing,
.team-role--leftWing { background: #16a34a; }
.team-role--forward { background: #e11d48; }

.final-analysis {
  padding: 14px 12px;
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-radius: 18px;
  background:
    radial-gradient(160px 80px at 50% 0%, rgba(34, 211, 238, 0.14), transparent 70%),
    rgba(7, 16, 32, 0.9);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.1);
}

.final-analysis h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
}

.final-analysis__list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.final-analysis__list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.final-analysis__list dt {
  color: #93a0b8;
  font-weight: 700;
}

.final-analysis__list dd {
  margin: 0;
  font-weight: 800;
}

.final-balance {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.final-balance.is-close {
  background: rgba(22, 163, 74, 0.18);
  color: #86efac;
}

.final-balance.is-mid {
  background: rgba(217, 119, 6, 0.18);
  color: #fde68a;
}

.final-balance.is-far {
  background: rgba(225, 29, 72, 0.18);
  color: #fda4af;
}

.final-balance.is-muted {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

#final-pitch-slot .pitch-progress,
#final-pitch-slot .pitch-scores {
  display: none;
}

#final-pitch-slot .pitch {
  width: min(100%, 520px);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.88),
    0 0 24px rgba(34, 211, 238, 0.22);
}

#final-pitch-slot .pitch-wrap--b .pitch {
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.88),
    0 0 24px rgba(244, 63, 94, 0.24);
}

#final-pitch-slot .pitch-wrap__header {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  margin: 0;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(4, 12, 24, 0.72);
}

#final-pitch-slot .pitch-wrap {
  position: relative;
}

#final-pitch-slot .pitch-wrap__header h2,
#final-pitch-slot .pitch-count {
  color: #fff;
  font-size: 0.78rem;
}

#final-pitch-slot .pitch-player {
  padding: 3px 6px 2px;
  border-color: rgba(125, 211, 252, 0.45);
  border-radius: 10px;
  background: rgba(4, 10, 20, 0.82);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.28);
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#final-pitch-slot .pitch-player.is-dragging {
  z-index: 6;
  cursor: grabbing;
  transition: none;
  box-shadow: 0 0 16px rgba(103, 232, 249, 0.85);
}

#final-pitch-slot .pitch-wrap--b .pitch-player {
  border-color: rgba(251, 113, 133, 0.5);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.28);
}

#final-pitch-slot .pitch-player__ovr {
  display: block;
  color: #fde68a;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

#final-pitch-slot .pitch-player__ovr[hidden] {
  display: none;
}

#final-pitch-slot .versus {
  align-self: center;
}

.pitch-hub {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: min(148px, 100%);
  margin-inline: auto;
  padding: 12px 10px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 18px;
  background: rgba(6, 14, 28, 0.82);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.16);
  text-align: center;
}

.pitch-hub__ball {
  font-size: 1.5rem;
  line-height: 1;
}

.pitch-hub strong {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 1.45rem;
  font-style: italic;
  line-height: 1;
}

.pitch-hub__kicker {
  margin-top: 6px;
  color: #93c5fd;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pitch-hub__dots {
  display: grid;
  gap: 4px;
  width: 72px;
  min-height: 92px;
  margin-top: 6px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  background: linear-gradient(#3cbe68, #17843d);
  align-content: space-between;
}

.pitch-hub__row {
  display: flex;
  justify-content: space-evenly;
}

.pitch-hub__row i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

#screen-final .final-actions .btn-main {
  border-radius: 999px;
  box-shadow: 0 0 22px rgba(37, 99, 235, 0.45);
}

#screen-final #swap-toggle {
  border-radius: 999px;
  border-color: rgba(103, 232, 249, 0.7);
  background: rgba(8, 20, 40, 0.72);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.2);
}

#screen-final .final-save {
  border-radius: 999px;
  border-color: rgba(250, 204, 21, 0.75);
  color: #fde68a;
  background: rgba(66, 42, 8, 0.45);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.18);
}

#screen-final .final-save.is-saved {
  border-color: rgba(74, 222, 128, 0.8);
  color: #bbf7d0;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.22);
}

#screen-final .final-share,
.share-fallback .btn-ghost {
  border-radius: 999px;
  border-color: rgba(125, 211, 252, 0.55);
  background: rgba(8, 20, 40, 0.72);
}

.share-fallback {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.kura-dock {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.kura-dock__button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(125, 211, 252, 0.45);
  border-radius: 999px;
  background: rgba(6, 14, 28, 0.82);
  color: #e0f2fe;
  font-size: 0.82rem;
  font-weight: 800;
}

.kura-dock__mute {
  min-width: 42px;
  padding-inline: 0;
}

.kura-volume {
  display: flex;
  align-items: center;
  width: 112px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 999px;
  background: rgba(6, 14, 28, 0.82);
}

.kura-volume input {
  width: 100%;
  accent-color: #22d3ee;
}

#screen-final .final-actions [data-action="undo"] {
  width: min(220px, 100%);
  min-height: 42px;
  margin-inline: auto;
  border-radius: 999px;
}

@media (min-width: 980px) {
  .final-scoreline {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
  }

  .final-side--b {
    flex-direction: row-reverse;
    text-align: right;
  }

  .final-rosters {
    grid-template-columns: minmax(0, 1fr) 230px minmax(0, 1fr);
    align-items: start;
  }

  #final-pitch-slot .pitch-grid {
    grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr);
    gap: 8px 18px;
  }
}

@media (max-width: 979px) {
  .final-title::before,
  .final-title::after {
    display: none;
  }

  #final-pitch-slot .pitch-grid {
    grid-template-columns: 1fr;
  }

  .team-card__header,
  .team-card__stats {
    flex-wrap: wrap;
  }
}

@media (hover: hover) {
  .btn-main:hover:not(:disabled),
  .btn-ghost:hover:not(:disabled),
  .player-card:hover:not(:disabled) {
    transform: translateY(-2px);
  }
}

.btn-main:active:not(:disabled),
.player-card:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

@media (min-width: 640px) {
  .quota-list {
    grid-template-columns: 1fr 1fr;
  }

  .panel {
    padding: 32px 28px 24px;
  }

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

  .ball {
    width: 168px;
    height: 168px;
  }

  .ball__glyph {
    font-size: 76px;
  }
}

@media (min-width: 760px) {
  .opponent-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .assign-stage,
  .teams {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .teams {
    grid-template-columns: 1fr auto 1fr;
  }

  .action-row--split {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 639px) {
  .entry-actions {
    position: sticky;
    bottom: 0;
    margin-inline: -8px;
    padding: 14px 8px calc(8px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(14, 22, 38, 0), rgba(14, 22, 38, 0.96) 32%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

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

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes spin-ball {
  from {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(180deg) scale(1.05);
  }

  to {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes reel-pop {
  from {
    opacity: 0.45;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes chosen-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  30% {
    transform: translateX(-5px);
  }

  70% {
    transform: translateX(5px);
  }
}

@keyframes team-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes row-in-right {
  from {
    opacity: 0;
    transform: translateX(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.pitch-board {
  margin-top: 16px;
}

.pitch-grid {
  display: grid;
  gap: 16px;
  justify-content: center;
}

.pitch-wrap__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.pitch-wrap__header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.pitch-count,
.pitch-progress,
.pitch-scores {
  color: var(--muted);
  font-weight: 700;
}

.pitch-progress,
.pitch-scores {
  margin: 10px 0 0;
  text-align: center;
}

.pitch-scores {
  margin-top: 4px;
  font-size: 0.92rem;
}

.pitch {
  position: relative;
  width: min(82%, 460px);
  margin-inline: auto;
  aspect-ratio: 3 / 4;
  overflow: visible;
  border-radius: 16px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.055) 0 16px,
      rgba(0, 0, 0, 0.05) 16px 32px
    ),
    linear-gradient(165deg, #46c772 0%, #1e9848 40%, #157538 74%, #1b8b42 100%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.92),
    inset 0 20px 30px rgba(255, 255, 255, 0.05),
    0 14px 28px rgba(0, 0, 0, 0.28);
}

.pitch__markings,
.pitch__markers {
  position: absolute;
  inset: 0;
}

.pitch__line,
.pitch__circle,
.pitch__spot,
.pitch__box,
.pitch__six,
.pitch__corner {
  position: absolute;
  border-color: rgba(255, 255, 255, 0.92);
  border-style: solid;
}

.pitch__line {
  top: 50%;
  right: 0;
  left: 0;
  border-width: 2px 0 0;
}

.pitch__circle {
  top: 50%;
  left: 50%;
  width: 28%;
  aspect-ratio: 1;
  border-width: 2px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pitch__spot {
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  transform: translate(-50%, -50%);
}

.pitch__box {
  left: 17%;
  width: 66%;
  height: 23%;
  border-width: 2px;
}

.pitch__box--top {
  top: 0;
  border-top-width: 0;
}

.pitch__box--bottom {
  bottom: 0;
  border-bottom-width: 0;
}

.pitch__six {
  left: 31%;
  width: 38%;
  height: 13%;
  border-width: 2px;
}

.pitch__six--top {
  top: 0;
  border-top-width: 0;
}

.pitch__six--bottom {
  bottom: 0;
  border-bottom-width: 0;
}

.pitch__frame {
  position: absolute;
  left: 37%;
  z-index: 1;
  width: 26%;
  pointer-events: none;
}

.pitch__frame--own {
  bottom: 0;
  height: 11%;
}

.pitch__frame--away {
  top: 0;
  height: 8%;
}

.pitch__net {
  position: absolute;
  background-color: rgba(6, 22, 14, 0.2);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 6px 6px;
}

.pitch__frame--own .pitch__net {
  inset: 3px 3px 0;
}

.pitch__frame--away .pitch__net {
  inset: 0 3px 3px;
}

.pitch__post,
.pitch__crossbar {
  position: absolute;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.pitch__post {
  top: 0;
  bottom: 0;
  width: 3px;
}

.pitch__post--left {
  left: 0;
}

.pitch__post--right {
  right: 0;
}

.pitch__crossbar {
  left: 0;
  right: 0;
  height: 3px;
}

.pitch__frame--own .pitch__crossbar {
  top: 0;
}

.pitch__frame--away .pitch__crossbar {
  bottom: 0;
}

.pitch__corner {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.pitch__corner--tl {
  top: -2px;
  left: -2px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 16px;
}

.pitch__corner--tr {
  top: -2px;
  right: -2px;
  border-width: 0 0 2px 2px;
  border-radius: 0 0 0 16px;
}

.pitch__corner--bl {
  bottom: -2px;
  left: -2px;
  border-width: 2px 2px 0 0;
  border-radius: 0 16px 0 0;
}

.pitch__corner--br {
  right: -2px;
  bottom: -2px;
  border-width: 2px 0 0 2px;
  border-radius: 16px 0 0;
}

.pitch__empty {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  transform: translate(-50%, -50%);
}

.pitch-player {
  position: absolute;
  z-index: 2;
  display: grid;
  width: max-content;
  max-width: 46%;
  justify-items: center;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(6, 12, 22, 0.88);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.34);
  color: #fff;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left 0.35s ease, top 0.35s ease;
}

.pitch-player.is-entering {
  transition: none;
  animation: marker-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pitch-player__name {
  max-width: 100%;
  color: #fff;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
}

.pitch-player__ovr {
  display: none;
}

#final-pitch-slot {
  margin-bottom: 16px;
}

#final-pitch-slot:empty {
  display: none;
}

@media (min-width: 900px) {
  .pitch-grid {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px 32px;
    align-items: start;
  }
}

@media (max-width: 899px) {
  .pitch-player {
    max-width: 48%;
    padding: 2px 4px;
  }

  .pitch-player__name {
    font-size: 0.72rem;
  }
}

@keyframes marker-in {
  0% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 12px)) scale(0.64);
  }

  58% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }

  78% {
    transform: translate(-50%, -50%) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
