@import url('https://fonts.googleapis.com/css2?family=Anton&family=Archivo:wght@400;500;600;700;800;900&family=Archivo+Narrow:wght@500;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --maroon: #7a1138;
  --maroon-deep: #4a0a22;
  --maroon-glow: rgba(122, 17, 56, 0.55);
  --gold: #c9a24b;
  --gold-bright: #e8c874;
  --gold-deep: #8a6d28;
  --night: #0b0710;
  --night-2: #150b16;
  --field-top: #14532d;
  --field-bot: #0b3d20;
  --field-stripe: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.7);
  --text: #f5eedf;
  --muted: rgba(245, 238, 223, 0.5);
  --card-w: clamp(42px, 4.8vw, 68px);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--night);
  font-family: 'Archivo', sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, var(--maroon-glow) 0%, transparent 55%),
    radial-gradient(ellipse 100% 60% at 50% 110%, rgba(122, 17, 56, 0.3) 0%, transparent 50%),
    linear-gradient(160deg, var(--night) 0%, var(--night-2) 50%, var(--night) 100%);
}

.app::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(201, 162, 75, 0.05) 0, transparent 12%),
    radial-gradient(circle at 88% 82%, rgba(201, 162, 75, 0.05) 0, transparent 12%);
}

.topbar {
  flex-shrink: 0;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: relative;
  z-index: 60;
  background: linear-gradient(180deg, rgba(11, 7, 16, 0.95) 0%, rgba(11, 7, 16, 0.6) 100%);
  border-bottom: 1px solid rgba(201, 162, 75, 0.2);
}

.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold) 30%,
    var(--gold-bright) 50%,
    var(--gold) 70%,
    transparent
  );
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crest {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(from 180deg, #fcd116 0deg 180deg, #003087 180deg 270deg, #ce1126 270deg 360deg);
  position: relative;
  box-shadow:
    0 0 0 2px rgba(201, 162, 75, 0.6),
    0 0 16px rgba(201, 162, 75, 0.3);
  flex-shrink: 0;
}

.crest::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--night);
  border: 1px solid rgba(201, 162, 75, 0.4);
}

.crest span {
  position: relative;
  z-index: 2;
  font-family: 'Anton', sans-serif;
  font-size: 15px;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.eyebrow {
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.9;
}

.brand-title {
  font-family: 'Anton', sans-serif;
  font-size: 25px;
  letter-spacing: 0.04em;
  line-height: 0.9;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, var(--gold-bright) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hud {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-chip {
  font-family: 'Archivo Narrow', sans-serif;
  padding: 6px 14px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid rgba(201, 162, 75, 0.22);
  background: rgba(122, 17, 56, 0.18);
}

.hud-chip.active {
  color: #0b0710;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  border-color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(201, 162, 75, 0.35);
}

.main-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 340px;
  gap: 18px;
  padding: 18px 24px 10px;
  position: relative;
  z-index: 5;
}

.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.field {
  position: relative;
  height: 100%;
  aspect-ratio: 68 / 105;
  max-width: 100%;
  border-radius: 6px;
  overflow: visible;
  border: 1px solid rgba(201, 162, 75, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(122, 17, 56, 0.4),
    0 40px 90px rgba(0, 0, 0, 0.85),
    inset 0 0 80px rgba(0, 0, 0, 0.35);
  background:
    repeating-linear-gradient(
      180deg,
      var(--field-stripe) 0 calc(100% / 9),
      transparent calc(100% / 9) calc(200% / 9)
    ),
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(255, 255, 255, 0.05), transparent 60%),
    linear-gradient(180deg, var(--field-top) 0%, var(--field-bot) 100%);
}

.field::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.4) 100%);
}

.m {
  position: absolute;
  pointer-events: none;
}

.midline {
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
  opacity: 0.55;
  transform: translateY(-50%);
}

.circle {
  left: 50%;
  top: 50%;
  width: 19%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid var(--line);
  opacity: 0.55;
  border-radius: 50%;
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--line);
  border-radius: 50%;
  opacity: 0.6;
}

.cdot {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.box {
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid var(--line);
  opacity: 0.55;
}

.pa-top {
  top: 0;
  width: 54%;
  height: 17%;
  border-top: 0;
}

.pa-bot {
  bottom: 0;
  width: 54%;
  height: 17%;
  border-bottom: 0;
}

.ga-top {
  top: 0;
  width: 26%;
  height: 7%;
  border-top: 0;
}

.ga-bot {
  bottom: 0;
  width: 26%;
  height: 7%;
  border-bottom: 0;
}

.pdot-top {
  left: 50%;
  top: 11.5%;
  transform: translate(-50%, -50%);
}

.pdot-bot {
  left: 50%;
  top: 88.5%;
  transform: translate(-50%, -50%);
}

.arc {
  position: absolute;
  left: 50%;
  width: 14%;
  aspect-ratio: 2/1;
  border: 2px solid var(--line);
  opacity: 0.45;
  transform: translateX(-50%);
}

.arc-top {
  top: 17%;
  border-top: 0;
  border-radius: 0 0 100px 100px;
}

.arc-bot {
  bottom: 17%;
  border-bottom: 0;
  border-radius: 100px 100px 0 0;
}

.corner {
  position: absolute;
  width: 3.2%;
  aspect-ratio: 1;
  border: 2px solid var(--line);
  opacity: 0.4;
  border-radius: 50%;
}

.corner.tl {
  top: -1.6%;
  left: -1.6%;
}

.corner.tr {
  top: -1.6%;
  right: -1.6%;
}

.corner.bl {
  bottom: -1.6%;
  left: -1.6%;
}

.corner.br {
  bottom: -1.6%;
  right: -1.6%;
}

#cardsLayer {
  position: absolute;
  inset: 0;
}

.player-card {
  position: absolute;
  width: var(--card-w);
  aspect-ratio: 3/4;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.35);
  border-radius: 8px;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  transition:
    left 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    top 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s ease;
}

.card-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  border: 1.5px solid rgba(201, 162, 75, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.card-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.card-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 40%,
    rgba(232, 200, 116, 0.12) 50%,
    transparent 60%
  );
}

.badge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 16px 5px 5px;
  background: linear-gradient(
    to top,
    rgba(11, 7, 16, 0.96) 0%,
    rgba(74, 10, 34, 0.5) 60%,
    transparent 100%
  );
  text-align: center;
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card.hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.35);
  pointer-events: none;
}

.player-card.preview {
  width: min(26vh, 200px);
  left: 50% !important;
  top: 42% !important;
  opacity: 1;
  z-index: 30;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.player-card.preview .card-frame {
  border: 2px solid var(--gold);
  box-shadow:
    0 0 0 4px rgba(201, 162, 75, 0.12),
    0 0 50px rgba(201, 162, 75, 0.4),
    0 0 90px rgba(122, 17, 56, 0.6),
    0 24px 60px rgba(0, 0, 0, 0.7);
}

.player-card.preview .badge {
  font-size: 11px;
  padding-bottom: 8px;
}

.player-card.placed {
  opacity: 1;
  z-index: 10;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.player-card.coach.placed,
.player-card.bench.placed {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.65);
}

.image-error .card-frame {
  background: linear-gradient(160deg, #300814, #12050a);
}

.image-error .card-frame::after {
  content: 'Imagen no encontrada';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-transform: uppercase;
}

.target-marker {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--gold-bright);
  background: rgba(201, 162, 75, 0.16);
  transform: translate(-50%, -50%);
  z-index: 5;
  animation: pulse 1.4s infinite;
}

.target-marker.staff-target {
  opacity: 0;
}

.target-marker::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--gold-bright);
}

.target-marker.hidden {
  display: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(201, 162, 75, 0.65);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(201, 162, 75, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(201, 162, 75, 0);
  }
}

#nameOverlay {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(8px);
  z-index: 80;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

#nameOverlay.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ov-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: min(50vw, 620px);
  max-width: min(54vw, 760px);
  padding: 14px 44px 16px;
  background: linear-gradient(180deg, rgba(74, 10, 34, 0.94) 0%, rgba(11, 7, 16, 0.97) 100%);
  border: 1px solid rgba(201, 162, 75, 0.5);
  border-radius: 4px;
  box-shadow:
    0 16px 50px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(122, 17, 56, 0.4);
  position: relative;
}

.ov-wrap::before,
.ov-wrap::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  transform: translateY(-50%);
}

.ov-wrap::before {
  left: -26px;
}

.ov-wrap::after {
  right: -26px;
  transform: translateY(-50%) scaleX(-1);
}

.ov-role {
  font-family: 'Anton', sans-serif;
  font-size: clamp(22px, 2.7vw, 38px);
  letter-spacing: 0.06em;
  line-height: 0.9;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff, var(--gold-bright));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ov-name {
  font-family: 'Archivo Narrow', sans-serif;
  font-size: clamp(13px, 1.3vw, 18px);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 7px;
}

.ov-job {
  font-family: 'Archivo Narrow', sans-serif;
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffffff;
  margin-top: 6px;
  opacity: 0.9;
}

.ov-phrase {
  max-width: 620px;
  margin-top: 7px;
  font-family: 'Archivo', sans-serif;
  font-size: clamp(12px, 1.18vw, 16px);
  font-weight: 600;
  line-height: 1.25;
  color: #f5eedf;
}

.staff-panel,
.lineup-panel {
  height: 100%;
  min-height: 0;
  align-self: stretch;
  border-radius: 8px;
  border: 1px solid rgba(201, 162, 75, 0.32);
  background:
    linear-gradient(180deg, rgba(74, 10, 34, 0.78) 0%, rgba(11, 7, 16, 0.92) 54%, rgba(11, 7, 16, 0.97) 100%),
    radial-gradient(circle at top right, rgba(232, 200, 116, 0.15), transparent 36%);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.staff-panel::before,
.lineup-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 18%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 6px
    );
  opacity: 0.55;
}

.staff-section {
  position: relative;
  z-index: 2;
  padding: 18px;
  border-bottom: 1px solid rgba(201, 162, 75, 0.25);
}

.staff-section.bench-section {
  border-bottom: 0;
  flex: 1;
}

.staff-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.staff-kicker {
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.staff-title-row h2 {
  font-family: 'Anton', sans-serif;
  font-size: 31px;
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
}

.staff-drop-zone {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.staff-slot {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 6px;
  border: 1px dashed rgba(201, 162, 75, 0.28);
  background: rgba(11, 7, 16, 0.42);
  opacity: 0.42;
  transition:
    opacity 0.3s ease,
    border-color 0.3s ease,
    background 0.3s ease,
    transform 0.3s ease;
}

.staff-slot.active {
  opacity: 1;
  transform: translateX(5px);
  border-style: solid;
  border-color: rgba(232, 200, 116, 0.9);
  background: linear-gradient(90deg, rgba(201, 162, 75, 0.2), rgba(122, 17, 56, 0.22));
}

.staff-slot.done {
  opacity: 1;
  border-style: solid;
  border-color: rgba(31, 185, 107, 0.35);
  background: rgba(31, 185, 107, 0.09);
}

.staff-number {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-family: 'Anton', sans-serif;
  font-size: 17px;
  color: #0b0710;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
}

.staff-slot.done .staff-number {
  background: linear-gradient(135deg, #2ed47a, #b6f5cc);
}

.staff-name {
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffffff;
}

.staff-role {
  margin-top: 2px;
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.staff-phrase {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(245, 238, 223, 0.76);
}

.lineup-header {
  position: relative;
  z-index: 2;
  padding: 20px 18px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(201, 162, 75, 0.25);
}

.lineup-kicker {
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.lineup-header h2 {
  font-family: 'Anton', sans-serif;
  font-size: 34px;
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
}

.formation-badge {
  flex-shrink: 0;
  min-width: 66px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 4px;
  font-family: 'Anton', sans-serif;
  font-size: 22px;
  letter-spacing: 0.05em;
  color: #0b0710;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  box-shadow: 0 0 22px rgba(201, 162, 75, 0.22);
}

.manager-card {
  position: relative;
  z-index: 2;
  margin: 16px 18px;
  padding: 14px;
  border: 1px solid rgba(201, 162, 75, 0.32);
  background: rgba(11, 7, 16, 0.55);
  border-radius: 6px;
}

.manager-label {
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.manager-name {
  margin-top: 6px;
  font-family: 'Anton', sans-serif;
  font-size: 27px;
  line-height: 1;
  text-transform: uppercase;
  color: #ffffff;
}

.manager-role {
  margin-top: 4px;
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 238, 223, 0.7);
}

.lineup-title-row {
  position: relative;
  z-index: 2;
  padding: 0 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.team-list {
  position: relative;
  z-index: 2;
  list-style: none;
  padding: 0 12px 14px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 75, 0.55) rgba(255, 255, 255, 0.04);
}

.team-list::-webkit-scrollbar {
  width: 6px;
}

.team-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.team-list::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 75, 0.55);
  border-radius: 999px;
}

.team-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 5px;
  border: 1px solid transparent;
  color: rgba(245, 238, 223, 0.74);
  background: rgba(255, 255, 255, 0.035);
  margin-bottom: 8px;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease,
    color 0.25s ease;
}

.team-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  font-family: 'Anton', sans-serif;
  font-size: 17px;
  color: #0b0710;
  background: linear-gradient(135deg, rgba(201, 162, 75, 0.9), rgba(232, 200, 116, 0.98));
}

.team-info {
  min-width: 0;
}

.team-name {
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-meta {
  margin-top: 2px;
  font-family: 'Archivo', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(245, 238, 223, 0.58);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-position {
  justify-self: end;
  padding: 5px 7px;
  border-radius: 3px;
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 238, 223, 0.68);
  background: rgba(255, 255, 255, 0.05);
  max-width: 96px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-item.active {
  transform: translateX(-5px);
  border-color: rgba(232, 200, 116, 0.85);
  background: linear-gradient(90deg, rgba(201, 162, 75, 0.22), rgba(122, 17, 56, 0.28));
  color: #ffffff;
  box-shadow: 0 0 24px rgba(201, 162, 75, 0.16);
}

.team-item.active .team-position {
  color: #0b0710;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
}

.team-item.done {
  border-color: rgba(31, 185, 107, 0.35);
  background: rgba(31, 185, 107, 0.09);
}

.team-item.done .team-number {
  background: linear-gradient(135deg, #2ed47a, #b6f5cc);
}

.bottombar {
  flex-shrink: 0;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 24px;
  position: relative;
  z-index: 60;
  background: linear-gradient(0deg, rgba(11, 7, 16, 0.95) 0%, rgba(11, 7, 16, 0.5) 100%);
  border-top: 1px solid rgba(201, 162, 75, 0.2);
}

.btn {
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 30px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid rgba(201, 162, 75, 0.35);
  background: rgba(122, 17, 56, 0.25);
  color: var(--text);
  transition: all 0.18s ease;
}

.btn:hover:not(:disabled) {
  background: rgba(122, 17, 56, 0.5);
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.22;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(
    135deg,
    var(--gold-deep) 0%,
    var(--gold) 50%,
    var(--gold-bright) 100%
  );
  color: #0b0710;
  border-color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(201, 162, 75, 0.3);
}

.btn.primary:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(201, 162, 75, 0.55);
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--muted);
  padding: 10px 20px;
}

.btn.ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
  transform: none;
}

@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 250px minmax(0, 1fr) 300px;
  }

  .staff-title-row h2,
  .lineup-header h2 {
    font-size: 28px;
  }
}

@media (max-width: 980px) {
  html,
  body {
    overflow: auto;
  }

  .app {
    min-height: 100vh;
    height: auto;
  }

  .main-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .stage {
    min-height: 680px;
  }

  .staff-panel,
  .lineup-panel {
    min-height: 520px;
  }

  .ov-wrap {
    min-width: min(86vw, 620px);
    max-width: min(90vw, 760px);
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 0 16px;
    height: 50px;
  }

  .brand-title {
    font-size: 20px;
  }

  .crest {
    width: 32px;
    height: 32px;
  }

  .main-layout {
    padding: 12px 12px 6px;
    gap: 12px;
  }

  .stage {
    min-height: 560px;
  }

  .field {
    aspect-ratio: 3 / 4;
  }

  .player-card.preview {
    width: min(26vh, 170px);
    top: 39% !important;
  }

  .staff-panel,
  .lineup-panel {
    min-height: 500px;
  }

  .team-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .team-position {
    grid-column: 2;
    justify-self: start;
    max-width: 100%;
  }

  .bottombar {
    height: 56px;
    gap: 8px;
  }

  .btn {
    padding: 9px 16px;
    font-size: 12px;
  }

  #nameOverlay {
    bottom: 10px;
  }

  .ov-wrap {
    min-width: min(92vw, 420px);
    padding: 10px 24px 12px;
  }

  .ov-role {
    font-size: clamp(22px, 8vw, 32px);
  }

  .ov-phrase {
    font-size: 13px;
  }
}