:root {
  --felt: #0d3d2a;
  --felt-light: #145238;
  --gold: #f5c842;
  --gold-dark: #c9a020;
  --cream: #f8f4e8;
  --coral: #ff6b5b;
  --text: #f8f6ff;
  --text-muted: #9cb8a8;
  --panel-bg: rgba(10, 35, 25, 0.94);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --radius: 16px;
}

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

body {
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: var(--felt);
  overflow-x: hidden;
}

.arena-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 20%, rgba(245, 200, 66, 0.1) 0%, transparent 55%),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 20px,
      rgba(0, 0, 0, 0.03) 20px,
      rgba(0, 0, 0, 0.03) 40px
    ),
    linear-gradient(180deg, var(--felt-light) 0%, var(--felt) 100%);
}

.site-nav {
  position: relative;
  z-index: 10;
  max-width: 1050px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem 0;
}

.site-nav-link {
  display: inline-flex;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.header,
.container {
  position: relative;
  z-index: 1;
}

.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1050px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0.5rem;
}

.logo {
  font-size: 2.8rem;
  filter: drop-shadow(0 0 10px rgba(245, 200, 66, 0.35));
}

.header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2.5rem;
}

.panel {
  background: var(--panel-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(245, 200, 66, 0.15);
}

.panel h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.hidden {
  display: none !important;
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  min-height: 1.5rem;
}

.team-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.team-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.team-name {
  flex: 1;
  font-weight: 500;
}

.remove-team-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.empty-teams {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.team-list-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.import-section {
  margin-bottom: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.import-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.import-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0.5rem 0;
}

.import-tab {
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.import-tab.active {
  background: rgba(245, 200, 66, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.import-panel {
  display: none;
}

.import-panel.active {
  display: block;
}

.import-row,
.add-team-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.import-row input,
.add-team-row input,
textarea#yahoo-teams {
  flex: 1;
  min-width: 120px;
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
}

textarea#yahoo-teams {
  width: 100%;
  resize: vertical;
}

.setup-actions,
.results-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #1a1028;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Arena */
.arena-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 1.25rem;
}

.round-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  color: var(--gold);
  text-align: center;
}

.round-label.losers {
  color: #ff9e80;
}

.bracket-round--losers {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(255, 158, 128, 0.35);
}

.bracket-round--losers .bracket-round-title {
  color: #ff9e80;
}

.bracket-round--losers .bracket-match.active {
  background: rgba(255, 158, 128, 0.12);
  border: 1px solid rgba(255, 158, 128, 0.35);
}

.matchup-label {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.showdown-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
  min-height: 100px;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.team-card--a {
  border-color: rgba(100, 180, 255, 0.35);
}

.team-card--b {
  border-color: rgba(255, 180, 100, 0.35);
}

.team-card.winner {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(245, 200, 66, 0.3);
  transform: scale(1.03);
}

.team-card.loser {
  opacity: 0.45;
}

.team-card-side {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.team-card-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  word-break: break-word;
}

.coin-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.coin {
  width: 100px;
  height: 100px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.coin.flipping {
  transition-duration: 1.6s;
}

.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  backface-visibility: hidden;
  border: 4px solid var(--gold);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.4);
}

.coin-heads {
  background: linear-gradient(145deg, #f5d76e, #c9a020);
}

.coin-tails {
  background: linear-gradient(145deg, #c0c0c0, #808080);
  transform: rotateY(180deg);
}

.coin.show-heads {
  transform: rotateY(0deg);
}

.coin.show-tails {
  transform: rotateY(180deg);
}

.coin-result {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.btn-flip {
  display: block;
  margin: 0 auto;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  padding: 0.75rem 2.5rem;
  background: linear-gradient(135deg, var(--coral) 0%, #e04a3a 100%);
  color: white;
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(255, 107, 91, 0.4);
}

.btn-flip:hover:not(:disabled) {
  transform: scale(1.05);
}

.winner-callout {
  text-align: center;
  margin-top: 1rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  color: var(--gold);
}

.bracket-sidebar h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.15rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.sidebar-divider {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bracket-view {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.bracket-round {
  margin-bottom: 0.5rem;
}

.bracket-round-title {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.bracket-match {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.bracket-match.active {
  background: rgba(245, 200, 66, 0.12);
  border: 1px solid rgba(245, 200, 66, 0.3);
  color: var(--text);
}

.bracket-match.done {
  color: var(--text-muted);
}

.bracket-match .match-winner {
  color: var(--gold);
  font-weight: 600;
}

.live-draft-order,
.final-draft-order {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.live-draft-order li,
.final-draft-order li {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 0.82rem;
}

.pick-badge {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--gold);
  min-width: 1.4rem;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 35, 25, 0.95);
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--gold);
  z-index: 100;
}

@media (max-width: 750px) {
  .arena-layout {
    grid-template-columns: 1fr;
  }

  .showdown-stage {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .coin-stage {
    order: -1;
  }
}
