:root {
  --bg-dark: #070b13;
  --bg-card: rgba(20, 27, 45, 0.7);
  --accent-green: #00ff87;
  --accent-gold: #ffbd00;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --border: rgba(255, 255, 255, 0.08);
  --glow-green: rgba(0, 255, 135, 0.15);
  --glow-gold: rgba(255, 189, 0, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    linear-gradient(rgba(7, 11, 19, 0.55), rgba(7, 11, 19, 0.78)),
    url('/stadium_bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Background gradient glows */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 20%, rgba(0, 255, 135, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 189, 0, 0.04) 0%, transparent 40%);
  pointer-events: none;
}

header {
  padding: 24px 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 11, 19, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  justify-content: flex-start;
}

.header-center {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 2px;
}

.header-right {
  display: flex;
  justify-content: flex-end;
}

.domain-logo {
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  transition: var(--transition);
}

.domain-logo:hover {
  color: var(--accent-green);
}

.gold { color: var(--accent-gold); }
.green { color: var(--accent-green); }

.gold-gradient {
  background: linear-gradient(45deg, #ffd700, #ffaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
  min-height: calc(100vh - 100px);
}

/* Screen Management */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Form Styles */
.form-group {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

input[type="text"] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: 8px;
  color: var(--text);
  font-size: 1.1rem;
  font-family: inherit;
  transition: var(--transition);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.2);
}

/* Buttons */
.btn {
  font-family: inherit;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-main {
  background: linear-gradient(135deg, var(--accent-green) 0%, #00d760 100%);
  color: #05070a;
  padding: 16px 32px;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(0, 255, 135, 0.3);
}

.btn-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 255, 135, 0.5);
}

.btn-roll {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #e6a100 100%);
  color: #05070a;
  padding: 14px 28px;
  font-size: 1rem;
  width: 100%;
  box-shadow: 0 4px 15px rgba(255, 189, 0, 0.3);
  margin-bottom: 20px;
}

.btn-roll:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 189, 0, 0.5);
}

/* Landing Page Styles */
.hero-container {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

/* Simulated stadium lighting beams using radial gradients */
.hero-container::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 250px;
  background: 
    radial-gradient(ellipse at top, rgba(0, 255, 135, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 20% 0%, rgba(255, 189, 0, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(0, 255, 135, 0.08) 0%, transparent 40%);
  z-index: -1;
  pointer-events: none;
}

.hero-title {
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -1px;
  text-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.hero-subtitle {
  color: var(--text);
  font-size: 1.25rem;
  margin-bottom: 45px;
  line-height: 1.6;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.setup-box {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  text-align: left;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Tactics Selector */
.tactics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.tactic-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: var(--transition);
  font-family: inherit;
}

.tactic-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

.tactic-btn.active {
  background: rgba(0, 255, 135, 0.1);
  border-color: var(--accent-green);
  color: var(--accent-green);
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.2);
}

/* Custom Flag Designer */
.flag-customizer {
  margin-bottom: 24px;
}

.flag-customizer > label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.flag-creation-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.flag-preview-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flag-preview {
  width: 120px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: grid;
}

/* Horizontal Flag Stripe Layout */
.flag-preview.horizontal, .mini-flag.horizontal {
  grid-template-rows: repeat(3, 1fr);
}
.flag-preview.horizontal .stripe-1, .mini-flag.horizontal .stripe-1 { background-color: var(--f-c1, #ff0000); }
.flag-preview.horizontal .stripe-2, .mini-flag.horizontal .stripe-2 { background-color: var(--f-c2, #ffffff); }
.flag-preview.horizontal .stripe-3, .mini-flag.horizontal .stripe-3 { background-color: var(--f-c3, #0000ff); }

/* Vertical Flag Stripe Layout */
.flag-preview.vertical, .mini-flag.vertical {
  grid-template-columns: repeat(3, 1fr);
}
.flag-preview.vertical .stripe-1, .mini-flag.vertical .stripe-1 { background-color: var(--f-c1, #ff0000); }
.flag-preview.vertical .stripe-2, .mini-flag.vertical .stripe-2 { background-color: var(--f-c2, #ffffff); }
.flag-preview.vertical .stripe-3, .mini-flag.vertical .stripe-3 { background-color: var(--f-c3, #0000ff); }

/* Cross Flag Layout */
.flag-preview.cross, .mini-flag.cross {
  display: block;
  background-color: var(--f-c1, #ff0000);
}
.flag-preview.cross .stripe-1, .mini-flag.cross .stripe-1 {
  position: absolute;
  top: 35%;
  left: 0;
  width: 100%;
  height: 30%;
  background-color: var(--f-c2, #ffffff);
}
.flag-preview.cross .stripe-2, .mini-flag.cross .stripe-2 {
  position: absolute;
  top: 0;
  left: 35%;
  width: 20%;
  height: 100%;
  background-color: var(--f-c2, #ffffff);
}
.flag-preview.cross .stripe-3, .mini-flag.cross .stripe-3 {
  display: none;
}

/* Diagonal layout */
.flag-preview.diagonal, .mini-flag.diagonal {
  display: block;
  background-color: var(--f-c1, #ff0000);
}
.flag-preview.diagonal .stripe-1, .mini-flag.diagonal .stripe-1 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--f-c2, #ffffff) 50%, var(--f-c3, #0000ff) 50%);
}
.flag-preview.diagonal .stripe-2, .mini-flag.diagonal .stripe-2,
.flag-preview.diagonal .stripe-3, .mini-flag.diagonal .stripe-3 {
  display: none;
}

.flag-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-row label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

select {
  background: #0f131a;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: inherit;
}

.control-row.colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.control-row.colors div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 100%;
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* DRAFT SCREEN */
.draft-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  align-items: start;
}

/* Pitch styling */
.pitch-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.pitch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.team-identity-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-flag {
  width: 36px;
  height: 24px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  position: relative;
}

.mini-flag div {
  width: 100%;
  height: 100%;
}

.soccer-pitch {
  background: radial-gradient(circle, #256a37 30%, #174f26 100%);
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  height: 68vh;
  max-height: 650px;
  min-height: 450px;
  aspect-ratio: 3 / 4;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 100px rgba(0,0,0,0.5);
  margin: 0 auto;
}

/* Tactical lines on pitch */
.soccer-pitch::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
}

.soccer-pitch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 25%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pitch-position {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease;
}

.pitch-position:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

.pitch-position.active .pos-circle {
  border-color: var(--accent-green);
  box-shadow: 0 0 15px var(--accent-green);
}

.pos-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(10, 14, 23, 0.85);
  border: 2px dashed rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 6px;
  backdrop-filter: blur(4px);
  transition: var(--transition);
}

.pitch-position.filled .pos-circle {
  border-style: solid;
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, #24324f 0%, #0d121c 100%);
  color: #fff;
}

.pos-player-name {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0,0,0,0.6);
  padding: 2px 6px;
  border-radius: 4px;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.pos-player-ovr {
  font-size: 0.7rem;
  color: var(--accent-gold);
  font-weight: 800;
}

/* DRAFT ACTION PANEL */
.action-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.action-box h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.step-guide {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.rolled-team-banner {
  background: rgba(255, 189, 0, 0.08);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}

.rolled-team-banner.hide { display: none; }

.player-draft-pool {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 380px;
  margin-bottom: 20px;
}

.placeholder-pool {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
  margin: auto;
  padding: 20px;
  border: 2px dashed rgba(255,255,255,0.05);
  border-radius: 8px;
}

/* FIFA Card Style Row */
.player-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.player-row-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-green);
  transform: translateX(4px);
}

.player-row-card.legend-card {
  border-color: rgba(255, 189, 0, 0.4);
  background: linear-gradient(90deg, rgba(255, 189, 0, 0.03) 0%, rgba(0, 0, 0, 0.1) 100%);
}

.player-row-card.legend-card:hover {
  border-color: var(--accent-gold);
}

.player-info-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-ovr-tag {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  min-width: 36px;
}

.legend-card .player-ovr-tag {
  color: var(--accent-gold);
}

.player-name-details h4 {
  font-size: 1.05rem;
  font-weight: 700;
}

.player-name-details span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-badge {
  background: var(--accent-gold);
  color: #000;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  margin-left: 8px;
  display: inline-block;
  vertical-align: middle;
}

.player-pos-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Draft progress tracker */
.draft-progress-box {
  margin-top: auto;
  font-size: 0.9rem;
  font-weight: 600;
}

.progress-bar-container {
  background: rgba(255,255,255,0.05);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
  margin-bottom: 12px;
}

.progress-bar-fill {
  background: var(--accent-green);
  height: 100%;
  transition: width 0.3s ease;
}

.btn.hide { display: none; }

/* SIMULATION SCREEN */
.sim-container {
  max-width: 1000px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 20px;
}

.sim-stage-tracker {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  font-weight: 700;
  color: var(--text-muted);
}

.stage-tag {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.stage-tag.active {
  background: var(--accent-green);
  color: #000;
}

.sim-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
}

.match-simulator-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.match-simulator-box h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 20px;
}

/* Scoreboard */
.scoreboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.score-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 35%;
}

.score-team.home { text-align: center; }
.score-team.away { text-align: center; }

.team-name-display {
  font-weight: 800;
  font-size: 1.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.score-display {
  font-size: 2.5rem;
  font-weight: 900;
  text-align: center;
}

.match-time {
  font-size: 0.95rem;
  color: var(--accent-green);
  margin-top: 4px;
  font-weight: 800;
}

.match-events {
  width: 100%;
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  height: 200px;
  overflow-y: auto;
  margin-bottom: 24px;
  font-family: monospace;
  font-size: 0.9rem;
}

.match-event-row {
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}

.match-event-row span.time {
  color: var(--accent-green);
  font-weight: 700;
  margin-right: 8px;
}

.match-event-row span.event-text {
  color: var(--text);
}

.match-event-row.goal {
  background: rgba(255, 189, 0, 0.08);
  border-left: 3px solid var(--accent-gold);
  padding-left: 8px;
}

.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.sidebar-box h3 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* Standings Table */
.standings-table {
  width: 100%;
  border-collapse: collapse;
}

.standings-table th, .standings-table td {
  padding: 10px;
  text-align: left;
  font-size: 0.9rem;
}

.standings-table th {
  color: var(--text-muted);
  font-weight: 700;
}

.standings-table tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.standings-table tbody tr:nth-child(-n+2) {
  color: var(--accent-green);
}

.zone-rating-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.zone-rating-row strong {
  color: var(--accent-green);
}

.active-boosts-list {
  margin-top: 15px;
}

.boost-item {
  background: rgba(255, 189, 0, 0.1);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* RESULTS SCREEN */
.results-container {
  text-align: center;
  max-width: 650px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.trophy-display {
  margin-bottom: 30px;
}

.trophy-emoji {
  font-size: 5rem;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

.results-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 30px;
}

.result-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 12px;
}

.result-card h3 {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.result-card p {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.stats-summary-list {
  text-align: left;
  max-height: 150px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.85rem;
  padding: 10px;
  background: rgba(0,0,0,0.1);
  border-radius: 6px;
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 189, 0, 0.1); }
  50% { transform: scale(1.01); box-shadow: 0 0 20px rgba(255, 189, 0, 0.3); }
  100% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 189, 0, 0.1); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

/* Custom layout flags mini dimensions */
.opp-flag-placeholder {
  font-size: 1.5rem;
}

/* Tactic Preview Section */
.tactic-preview-box {
  margin-top: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mini-pitch-container {
  width: 100%;
  max-width: 240px;
  background: rgba(10, 15, 30, 0.6);
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.mini-soccer-pitch {
  background: radial-gradient(circle, #226132 30%, #13421f 100%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  aspect-ratio: 3 / 4;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 25px rgba(0,0,0,0.6);
  width: 100%;
}

.mini-soccer-pitch::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.mini-soccer-pitch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 25%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.mini-pos-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--accent-gold) 0%, #d49500 100%);
  border: 1.5px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(255, 189, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mini-pos-label {
  font-size: 7px;
  font-weight: 900;
  color: #000;
  pointer-events: none;
}

/* Disabled player draft rows */
.player-row-card.disabled-card {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.occupied-text {
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
  text-transform: uppercase;
}

/* 2-color Layout adjustments */
.flag-preview.horizontal.cols-2,
.mini-flag.horizontal.cols-2 {
  grid-template-rows: repeat(2, 1fr) !important;
}
.flag-preview.horizontal.cols-2 .stripe-3,
.mini-flag.horizontal.cols-2 .stripe-3 {
  display: none !important;
}

.flag-preview.vertical.cols-2,
.mini-flag.vertical.cols-2 {
  grid-template-columns: repeat(2, 1fr) !important;
}
.flag-preview.vertical.cols-2 .stripe-3,
.mini-flag.vertical.cols-2 .stripe-3 {
  display: none !important;
}

/* Penalty Shootout Styles */
.penalty-shootout-box {
  background: rgba(20, 27, 45, 0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.4s ease-out;
}

.penalty-shootout-box.hide {
  display: none;
}

.shootout-team-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shootout-team-name {
  font-weight: 700;
  min-width: 140px;
  color: var(--text);
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shootout-balls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.shootout-ball {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: transparent;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: scale(0.8);
}

.shootout-ball.scored {
  background: #00ff87;
  border-color: #00ff87;
  color: #070b13;
  transform: scale(1);
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.4);
}

.shootout-ball.missed {
  background: #ff3b30;
  border-color: #ff3b30;
  color: #ffffff;
  transform: scale(1);
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.4);
}

.shootout-ball.scored::after {
  content: '✓';
  font-size: 14px;
  color: #070b13;
  font-weight: 900;
}

.shootout-ball.missed::after {
  content: '✗';
  font-size: 14px;
  color: #ffffff;
  font-weight: 900;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design / Mobile Optimizations */
@media (max-width: 900px) {
  main {
    padding: 20px 12px;
  }
  
  header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding: 12px 20px;
  }
  
  .header-left, .header-center, .header-right {
    text-align: center;
    justify-content: center;
    width: 100%;
  }

  .header-center {
    font-size: 1.25rem;
  }

  .domain-logo {
    font-size: 1.1rem;
  }
  
  .hero-title {
    font-size: 2.2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 25px;
  }
  
  .setup-box {
    padding: 20px;
  }
  
  .tactics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .flag-creation-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 15px;
  }
  
  .flag-designer-options {
    width: 100%;
  }

  /* Draft Screen Responsive styling */
  .draft-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .pitch-container {
    padding: 12px;
  }
  
  .soccer-pitch {
    max-width: 100%;
    width: 440px;
    margin: 0 auto;
  }

  .pos-circle {
    width: 38px;
    height: 38px;
    font-size: 0.8rem;
    margin-bottom: 3px;
  }

  .pos-player-name {
    font-size: 0.65rem;
    padding: 1px 4px;
    max-width: 75px;
  }
  
  .action-box {
    padding: 16px;
    min-height: auto;
  }

  .player-draft-pool {
    max-height: 350px;
    overflow-y: auto;
  }
  
  /* Match Simulator Screen Responsive styling */
  .sim-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .sim-stage-tracker {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.75rem;
  }
  
  .scoreboard {
    gap: 10px;
  }
  
  .score-team {
    font-size: 0.85rem;
  }
  
  .score-display span {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }
  
  .soccer-pitch {
    width: 100%;
  }
  
  .pos-circle {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
    border-width: 1px;
  }
  
  .pos-player-name {
    font-size: 0.65rem;
    max-width: 60px;
  }
  
  .tactics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .scoreboard {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .score-team.home, .score-team.away {
    flex-direction: column;
    gap: 5px;
  }
}

/* Footer styling */
footer {
  text-align: center;
  padding: 30px 20px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: rgba(7, 11, 19, 0.85);
  font-size: 0.9rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition);
}

footer a:hover {
  color: var(--accent-green);
}

/* Rotating badge styles for Quiz menu link */
.badge-container {
  display: inline-flex;
  position: relative;
  width: 58px;
  height: 16px;
  margin-left: 5px;
  vertical-align: middle;
}

.badge-rotator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
  letter-spacing: 0.5px;
}

.badge-new {
  background: linear-gradient(135deg, #ff007f 0%, #ff003f 100%);
  box-shadow: 0 0 6px rgba(255, 0, 127, 0.4);
  animation: fadeNew 5s infinite;
}

.badge-hot {
  background: linear-gradient(135deg, #ff8c00 0%, #ff4500 100%);
  box-shadow: 0 0 6px rgba(255, 69, 0, 0.4);
  animation: fadeHot 5s infinite;
  opacity: 0;
}

@keyframes fadeNew {
  0%, 45% {
    opacity: 1;
    transform: scale(1);
  }
  50%, 95% {
    opacity: 0;
    transform: scale(0.85);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeHot {
  0%, 45% {
    opacity: 0;
    transform: scale(0.85);
  }
  50%, 95% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.85);
  }
}

@media (max-width: 600px) {
  .header-right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px !important;
  }
  .header-right .nav-link {
    font-size: 0.8rem !important;
  }
  .badge-container {
    width: 46px;
    height: 14px;
    margin-left: 2px;
  }
  .badge-rotator {
    font-size: 0.55rem;
  }
}

/* --- EKSTRAKLASA MODE STYLES --- */
body.ekstraklasa-mode {
  --bg-dark: #020914;
  --bg-card: rgba(3, 19, 43, 0.75);
  --accent-green: #00d584; /* PKO BP Ekstraklasa neon green */
  --accent-gold: #ffbe00; /* PKO BP Gold / League Gold */
  --border: rgba(0, 213, 132, 0.15);
  --glow-green: rgba(0, 213, 132, 0.2);
  --glow-gold: rgba(255, 190, 0, 0.2);
  
  background-image: 
    linear-gradient(rgba(2, 9, 20, 0.75), rgba(3, 18, 41, 0.9)),
    url('/stadium_bg.png') !important;
}

.mode-toggle-container {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 3px;
  gap: 2px;
}

.mode-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}

.mode-toggle-btn:hover {
  color: var(--text);
}

.mode-toggle-btn.active {
  background: var(--accent-green);
  color: #05070a;
  box-shadow: 0 2px 8px rgba(0, 255, 135, 0.3);
}

body.ekstraklasa-mode .mode-toggle-btn.active {
  background: #0055a5;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 85, 165, 0.3);
}

/* Emblem Designer Styles */
.emblem-preview {
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mini-emblem {
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mini-emblem svg {
  width: 100%;
  height: 100%;
}

.emblem-customizer {
  margin-bottom: 24px;
}

.emblem-customizer > label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

/* Winter Transfer Overlay Styles */
.transfer-window-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 7, 10, 0.9);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.transfer-window-overlay.hide {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.transfer-window-content {
  background: var(--bg-panel, #131926);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.transfer-window-content h2 {
  text-align: center;
  color: var(--accent-gold);
  font-weight: 900;
  letter-spacing: 1px;
}

.transfer-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.transfer-window-content .player-draft-pool {
  max-height: none;
  overflow-y: visible;
}

.transfer-player-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.transfer-player-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.transfer-player-card.to-remove {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.remove-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.transfer-player-card .ovr {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent-gold);
}

.transfer-player-card .name {
  font-size: 0.85rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-player-card .pos {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 800;
}

.transfer-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.transfer-draft-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.transfer-draft-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.disabled-card {
  opacity: 0.5;
  cursor: not-allowed !important;
}

.occupied-text {
  font-size: 0.75rem;
  color: #ef4444;
  font-weight: 400;
}



