/* Calcio38 - Main Design System Stylesheet */

/* --- CSS VARIABLES & TOKENS --- */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono: 'Fira Code', monospace;

  /* Colors */
  --bg-dark: #070e0b;
  --bg-card: rgba(18, 38, 28, 0.65);
  --bg-card-hover: rgba(26, 54, 40, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(212, 175, 55, 0.4);
  
  --color-primary: #1b4332;
  --color-primary-light: #2d6a4f;
  --color-primary-dark: #081c15;
  --color-accent: #d4af37; /* Scudetto Gold */
  --color-accent-rgb: 212, 175, 55;
  
  --color-text-main: #f4f7f5;
  --color-text-muted: #a3b899;
  --color-text-dark: #081c15;
  
  --color-italy-green: #008c45;
  --color-italy-white: #f4f5f0;
  --color-italy-red: #cd212a;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.25);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
}

/* --- RESET & BASE STYLES --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--color-text-main);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(45, 106, 79, 0.35) 0%, transparent 70%),
    radial-gradient(circle at 10% 80%, rgba(205, 33, 42, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 140, 69, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-text-main);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary-light);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* --- APP CONTAINER & LAYOUT --- */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- HEADER --- */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-glass);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.logo-tricolore {
  display: inline-block;
  width: 16px;
  height: 24px;
  background: linear-gradient(to right, var(--color-italy-green) 33.3%, var(--color-italy-white) 33.3% 66.6%, var(--color-italy-red) 66.6%);
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
}

.header-logo h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--color-text-main);
}

.header-logo h1 span {
  color: var(--color-accent);
  font-style: italic;
  font-family: var(--font-sans);
  font-weight: 900;
  margin-left: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.header-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--color-text-main);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-normal);
  backdrop-filter: blur(8px);
}

.header-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
}

.hide {
  display: none !important;
}

/* Language Selector */
.language-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.lang-btn:hover {
  color: #fff;
}

.lang-btn.active {
  background: var(--color-accent);
  color: var(--color-text-dark);
}

/* --- BUTTONS --- */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, #a8851c 100%);
  color: var(--color-text-dark);
  border: none;
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
  background: linear-gradient(135deg, #e6c250 0%, var(--color-accent) 100%);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--color-text-main);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--color-text-muted);
  transform: translateY(-2px);
}

.btn-skip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--color-text-muted);
  padding: 10px 16px;
  font-size: 13px;
  border-radius: var(--radius-md);
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-skip:not(:disabled):hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

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

.btn-large {
  padding: 16px 36px;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.btn-full {
  width: 100%;
}

/* --- BADGES & LABELS --- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
}

/* --- CARDS & BLOCKS --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 22px;
  margin-bottom: 20px;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title i {
  color: var(--color-accent);
}

/* --- GAME VIEWPORT & SCREENS --- */
.game-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  min-height: 550px;
}

.game-screen {
  display: none;
  width: 100%;
  animation: fadeIn var(--transition-normal);
}

.game-screen.active {
  display: block;
}

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

/* --- SCREEN: HOME --- */
.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 0;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.hero-badge {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-gold);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 54px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--color-text-main);
  margin-bottom: 20px;
}

.highlight-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  color: var(--color-accent);
  background: linear-gradient(120deg, var(--color-accent) 0%, #e5c158 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--color-text-muted);
  max-width: 600px;
  margin-bottom: 36px;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 60px;
}

.hero-visual {
  position: relative;
  width: 100%;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stadium-glow {
  position: absolute;
  width: 500px;
  height: 150px;
  background: radial-gradient(ellipse, rgba(45, 106, 79, 0.6) 0%, transparent 70%);
  filter: blur(30px);
  z-index: 1;
}

.showcase-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  width: 260px;
  text-align: left;
  z-index: 2;
  box-shadow: var(--shadow-lg);
  transform: rotate(-4deg) translateY(0px);
  transition: transform var(--transition-normal);
  animation: floatCard 4s ease-in-out infinite;
}

.showcase-card:hover {
  transform: rotate(0deg) scale(1.05);
}

.showcase-club {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.showcase-player-name {
  font-family: var(--font-serif);
  font-size: 20px;
  color: #fff;
  margin-bottom: 12px;
}

.showcase-player-rating {
  font-size: 38px;
  font-weight: 900;
  color: var(--color-accent);
  line-height: 1;
}

@keyframes floatCard {
  0% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(-3deg) translateY(-8px); }
  100% { transform: rotate(-4deg) translateY(0); }
}

/* --- SCREEN: SETUP --- */
.setup-card {
  max-width: 600px;
  margin: 0 auto;
}

.setup-group {
  margin-bottom: 24px;
}

.setup-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.setup-group input[type="text"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  transition: all var(--transition-normal);
}

.setup-group input[type="text"]:focus {
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.tactic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.tactic-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.tactic-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tactic-btn.active {
  background: rgba(212, 175, 55, 0.06);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-gold);
}

.tactic-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.tactic-btn.active .tactic-name {
  color: var(--color-accent);
}

.tactic-desc {
  font-size: 12px;
  color: var(--color-text-muted);
}

.mode-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-align: left;
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.mode-btn.active {
  background: rgba(212, 175, 55, 0.06);
  border-color: var(--color-accent);
}

.mode-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: all var(--transition-normal);
}

.mode-btn.active .mode-icon {
  background: var(--color-accent);
  color: var(--color-text-dark);
}

.mode-info {
  display: flex;
  flex-direction: column;
}

.mode-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.mode-desc {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* --- SCREEN: DRAFT --- */
.draft-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

.pitch-container {
  display: flex;
  flex-direction: column;
}

.squad-list-container {
  display: none;
}

/* Viewport height locking on desktop */
@media (min-width: 993px) {
  #screen-draft.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    max-height: 900px;
    min-height: 480px;
  }

  .draft-layout {
    height: 100%;
    min-height: 0;
    grid-template-columns: 270px 1fr 410px; /* wider right column gives the player list room for names */
  }

  .pitch-container {
    height: 100%;
    min-height: 0;
  }

  .squad-list-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 16px;
    min-height: 0;
  }

  .squad-slots-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
  }

  .squad-slot-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    font-size: 12px;
    min-height: 44px;
    transition: all var(--transition-fast);
  }

  .squad-slot-row.filled {
    background: rgba(255, 255, 255, 0.04);
  }

  .squad-slot-row.empty {
    border-style: dashed;
    opacity: 0.6;
  }

  .squad-slot-pos {
    display: inline-block;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    width: 82px;
    text-align: center;
    flex-shrink: 0;
  }

  .squad-slot-pos.pos-GK {
    background: rgba(230, 194, 80, 0.15);
    color: #e6c250;
    border: 1px solid rgba(230, 194, 80, 0.3);
  }

  .squad-slot-pos.pos-DEF {
    background: rgba(0, 102, 178, 0.15);
    color: #5cafff;
    border: 1px solid rgba(0, 102, 178, 0.3);
  }

  .squad-slot-pos.pos-MID {
    background: rgba(0, 140, 69, 0.15);
    color: #5effa2;
    border: 1px solid rgba(0, 140, 69, 0.3);
  }

  .squad-slot-pos.pos-ATT {
    background: rgba(205, 33, 42, 0.15);
    color: #ff6e75;
    border: 1px solid rgba(205, 33, 42, 0.3);
  }

  .squad-slot-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .squad-slot-player-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .squad-slot-rating {
    font-weight: 800;
    color: var(--color-accent);
    min-width: 16px;
  }

  .squad-slot-name {
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .squad-slot-club-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--color-text-muted);
    margin-top: 1px;
  }

  .squad-slot-flag {
    font-size: 11px;
  }

  .squad-slot-club {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .squad-slot-placeholder {
    color: var(--color-text-muted);
    font-style: italic;
  }

  .controls-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
  }

  .players-pool-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 240px;
    margin-bottom: 0;
    overflow: hidden;
  }

  .players-list-grid {
    flex: 1;
    overflow-y: auto;
    max-height: none;
  }

  /* Compact the roll/wheel box so the selection list gets more vertical room */
  .wheel-box {
    flex-shrink: 0;
    margin-bottom: 0;
  }

  .slot-machine-viewer {
    padding: 14px 16px;
    margin: 12px 0;
    min-height: 72px;
  }

  .skips-row {
    margin-top: 10px;
  }

  /* Tighten the pool header so more player rows are visible */
  .players-pool-box .box-title {
    margin: 0 0 6px;
  }

  .players-pool-box .pool-instructions {
    margin-bottom: 10px;
  }
}

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

.pitch-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pitch-title h4 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.pitch-progress {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.pitch-progress span {
  color: var(--color-accent);
}

/* Football Pitch Visual */
.football-pitch {
  width: 100%;
  max-width: 328px;
  max-height: 400px;
  aspect-ratio: 0.82;
  background-color: #1a4231;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 4px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-lg);
  position: relative;
  box-shadow: var(--shadow-lg), inset 0 0 60px rgba(0,0,0,0.5);
  overflow: hidden;
  margin: 0 auto;
}

/* Pitch Line Markings */
.football-pitch::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.3);
}

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

.penalty-box-top {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 15%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top: none;
  transform: translateX(-50%);
}

.penalty-box-bottom {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 50%;
  height: 15%;
  border: 2px solid rgba(255,255,255,0.3);
  border-bottom: none;
  transform: translateX(-50%);
}

/* Player node slots on pitch */
.pitch-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  transition: transform var(--transition-normal);
}

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

.node-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(8, 28, 21, 0.9);
  border: 2px dashed rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
}

.pitch-slot.active .node-circle {
  border-color: var(--color-accent);
  background: rgba(212, 175, 55, 0.15);
  box-shadow: var(--shadow-gold);
  border-style: solid;
  animation: pulseActive 2s infinite;
}

@keyframes pulseActive {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.6); }
  70% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.pitch-slot.filled .node-circle {
  border-style: solid;
  border-color: #fff;
  background: var(--player-club-bg, #000);
  color: var(--player-club-color, #fff);
  font-size: 15px;
  font-weight: 900;
  border-width: 2.5px;
}

.node-name {
  font-size: 9.5px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.75);
  padding: 1px 4px;
  border-radius: 4px;
  margin-top: 4px;
  color: #fff;
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  border: 1px solid var(--border-glass);
}

.pitch-slot.active .node-name {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* SLOT MACHINE VIEWER (Replaced circular wheel) */
.wheel-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
}

.slot-machine-viewer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: rgba(8, 28, 21, 0.95);
  border: 2px solid var(--color-primary-light);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  margin: 20px 0;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.8), var(--shadow-sm);
  overflow: hidden;
  min-height: 104px;
}

.slot-machine-viewer.spinning {
  border-color: var(--color-accent);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8), var(--shadow-gold);
}

.slot-reel {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 44px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  overflow: hidden;
  position: relative;
}

.reel-item {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  animation: reelStop 0.2s ease-out;
}

.slot-machine-viewer.spinning .reel-item {
  animation: reelSpin 0.15s linear infinite;
  filter: blur(2px);
  opacity: 0.7;
}

#reel-decade-name .reel-item {
  font-family: var(--font-sans);
  color: var(--color-accent);
}

@keyframes reelSpin {
  0% { transform: translateY(-30px); }
  100% { transform: translateY(30px); }
}

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

/* Result Banner */
.wheel-result-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-accent);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  width: 100%;
  animation: popIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.rolled-club-badge {
  font-size: 28px;
  display: flex;
  align-items: center;
}

.rolled-info {
  display: flex;
  flex-direction: column;
}

.rolled-club {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.rolled-decade {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
}

.skips-row {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 14px;
}

/* PLAYER SELECTION POOL */
.players-pool-box {
  margin-bottom: 20px;
  transition: all var(--transition-normal);
}



.position-target {
  font-size: 12px;
  background: var(--color-accent);
  color: var(--color-text-dark);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-left: 6px;
  font-weight: 800;
}

.pool-instructions {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.players-list-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Sleek Compact Player Row Design */
.player-row-container {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.player-row-container:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--color-accent);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.player-row-container.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.player-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13.5px;
  user-select: none;
  width: 100%;
  box-sizing: border-box;
}

.player-row-container.disabled .player-row-main {
  cursor: default;
}

.player-row-flag {
  font-size: 14px;
  flex-shrink: 0;
}

.player-row-pos-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
  flex-shrink: 0;
}

.player-row-pos-badge.pos-GK {
  background: rgba(230, 194, 80, 0.15);
  color: #e6c250;
  border: 1px solid rgba(230, 194, 80, 0.3);
}

.player-row-pos-badge.pos-DEF {
  background: rgba(0, 102, 178, 0.15);
  color: #5cafff;
  border: 1px solid rgba(0, 102, 178, 0.3);
}

.player-row-pos-badge.pos-MID {
  background: rgba(0, 140, 69, 0.15);
  color: #5effa2;
  border: 1px solid rgba(0, 140, 69, 0.3);
}

.player-row-pos-badge.pos-ATT {
  background: rgba(205, 33, 42, 0.15);
  color: #ff6e75;
  border: 1px solid rgba(205, 33, 42, 0.3);
}

.player-row-rating {
  font-weight: 800;
  font-family: var(--font-sans);
  color: var(--color-accent);
  text-align: center;
  flex-shrink: 0;
}

.player-row-name {
  font-weight: 600;
  color: var(--color-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.player-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.player-row-main-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-row-main-stat-hidden {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 14px;
  padding-right: 8px;
}

.btn-expand-stats {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 11px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-expand-stats:hover {
  color: var(--color-accent);
  background: rgba(255, 255, 255, 0.08);
}

.player-stats-expanded-wrapper {
  display: none;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border-glass);
}

.player-row-container.expanded .player-stats-expanded-wrapper {
  display: block;
}

.player-stats-expanded {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
}

.stat-badge {
  font-size: 11px;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  padding: 2px 6px;
  border-radius: 4px;
}

.stat-badge.main {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.3);
  color: var(--color-accent);
}

.stat-badge strong {
  color: #ffffff;
}

/* Legend Player Card Design */
.player-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.player-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.player-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.player-card-meta {
  display: flex;
  flex-direction: column;
}

.player-card-flag {
  font-size: 11px;
  margin-bottom: 2px;
}

.player-card-pos {
  font-size: 10px;
  font-weight: 800;
  color: var(--color-text-muted);
  letter-spacing: 0.5px;
}

.player-card-rating {
  font-size: 20px;
  font-weight: 900;
  color: var(--color-accent);
}

.player-card-name {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card-club {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

/* Stats in classic mode */
.player-card-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 6px;
}

.stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-lbl {
  font-size: 8px;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.stat-num {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

/* Hidden Stats (Tifoso Mode) */
.player-card-stats-hidden {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 6px;
  text-align: center;
  font-size: 10px;
  font-style: italic;
  color: var(--color-accent);
}


/* --- SCREEN: SIMULATION --- */
.simulation-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

/* Standings table styling */
.table-container {
  overflow: hidden;
}

.table-responsive {
  max-height: 520px;
  overflow-y: auto;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.standings-table th, 
.standings-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.standings-table th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.col-pos { width: 30px; text-align: center; }
.col-team { font-weight: 600; }
.col-stat { width: 35px; text-align: center; }

.standings-table tbody tr {
  transition: background var(--transition-fast);
}

.standings-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.standings-table tbody tr.row-user {
  background: rgba(212, 175, 55, 0.08);
  border-left: 3px solid var(--color-accent);
}

.standings-table tbody tr.row-user td {
  color: var(--color-accent);
}

.table-team-badge {
  display: inline-block;
  margin-right: 6px;
  font-size: 12px;
}

/* Sim panels */
.sim-controls-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sim-panel {
  display: flex;
  flex-direction: column;
}

.sim-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.sim-progress-header h4 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.sim-status-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--color-accent);
  color: var(--color-text-dark);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent) 0%, #2d6a4f 100%);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.sim-speed-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.speed-buttons {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.speed-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.speed-btn:hover {
  color: #fff;
}

.speed-btn.active {
  background: var(--color-primary-light);
  color: #fff;
}

/* LIVE MATCH DISPLAY */
.sim-live-match {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.live-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40%;
}

.team-badge-large {
  font-size: 32px;
  margin-bottom: 6px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.team-name-large {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  white-space: nowrap;
}

.live-score {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: 4px;
}

.match-time-badge {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  width: fit-content;
  margin: 10px auto 0 auto;
  color: var(--color-text-muted);
}

/* Goal scorers under the live score */
.match-scorers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-top: 12px;
  min-height: 18px;
}

.scorers-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.scorers-col span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scorers-home {
  text-align: left;
  align-items: flex-start;
}

.scorers-away {
  text-align: right;
  align-items: flex-end;
}

/* Fixtures in current round */
.fixtures-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.fixture-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.fixture-teams {
  color: var(--color-text-muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.fixture-score {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-accent);
}

/* --- SCREEN: RESULTS --- */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.outcome-card {
  text-align: center;
  padding: 36px;
  position: relative;
  overflow: hidden;
}

.scudetto-animation {
  font-size: 72px;
  margin-bottom: 16px;
}

.scudetto-gold-icon {
  color: var(--color-accent);
  filter: drop-shadow(0 0 15px rgba(212,175,55,0.4));
  animation: shineGold 3s ease-in-out infinite;
}

@keyframes shineGold {
  0% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(212,175,55,0.4)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(212,175,55,0.7)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(212,175,55,0.4)); }
}

#results-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

#results-description {
  font-size: 14px;
  color: var(--color-text-muted);
  max-width: 500px;
  margin: 0 auto 24px auto;
}

.results-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.results-stats-grid .stat-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.stat-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-accent);
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

/* --- RULES MODAL --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  max-width: 600px;
  width: 100%;
  position: relative;
  animation: modalIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalIn {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: #fff;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 14px;
}

.modal-title i {
  color: var(--color-accent);
}

.rules-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.rules-section h5 {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.rules-section p, 
.rules-section ul {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.rules-section ul {
  padding-left: 20px;
  margin-top: 6px;
}

.rules-section li {
  margin-bottom: 4px;
}

/* --- FOOTER --- */
.main-footer {
  text-align: center;
  padding: 40px 0 20px 0;
  border-top: 1px solid var(--border-glass);
  margin-top: auto;
}

.main-footer p {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.main-footer .footer-disclaimer {
  font-size: 10px;
  opacity: 0.5;
}

/* --- LIGHT THEME OVERRIDES --- */
body.light-theme {
  --bg-dark: #f0f7f4;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-glass: rgba(0, 0, 0, 0.1);
  --border-focus: rgba(212, 175, 55, 0.6);
  
  --color-primary: #d8f3dc;
  --color-primary-light: #52b788;
  --color-primary-dark: #e8f5e9;
  
  --color-text-main: #1b4332;
  --color-text-muted: #52796f;
  
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(82, 183, 136, 0.2) 0%, transparent 70%),
    radial-gradient(circle at 10% 80%, rgba(205, 33, 42, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 140, 69, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
}

body.light-theme .main-header h1 {
  color: #1b4332;
}

body.light-theme .hero-title {
  color: #1b4332;
}

body.light-theme .section-title {
  color: #1b4332;
}

body.light-theme .tactic-name {
  color: #1b4332;
}
body.light-theme .tactic-btn.active .tactic-name {
  color: var(--color-accent);
}

body.light-theme .mode-title {
  color: #1b4332;
}

body.light-theme .pitch-title h4 {
  color: #1b4332;
}

body.light-theme .pitch-progress {
  color: var(--color-text-muted);
}

body.light-theme .slot-reel {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .reel-item {
  color: #1b4332;
}

body.light-theme #reel-decade-name .reel-item {
  color: var(--color-accent);
}

body.light-theme .rolled-club {
  color: #1b4332;
}

body.light-theme .player-card {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}
body.light-theme .player-card:hover {
  background: rgba(0, 0, 0, 0.06);
}
body.light-theme .player-card-name {
  color: #1b4332;
}
body.light-theme .stat-num {
  color: #1b4332;
}

body.light-theme .node-circle {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.3);
  color: #1b4332;
}
body.light-theme .pitch-slot.active .node-circle {
  border-color: var(--color-accent);
  background: rgba(212, 175, 55, 0.25);
  box-shadow: var(--shadow-gold);
}
body.light-theme .pitch-slot.filled .node-circle {
  border-color: #ffffff;
  background: var(--player-club-bg);
  color: var(--player-club-color);
}
body.light-theme .node-name {
  background: #ffffff;
  color: #1b4332;
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .setup-group input[type="text"] {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1b4332;
}
body.light-theme .setup-group input[type="text"]:focus {
  background: #ffffff;
  border-color: var(--color-accent);
}

body.light-theme .standings-table th {
  color: var(--color-text-muted);
}
body.light-theme .standings-table td {
  border-bottom-color: rgba(0, 0, 0, 0.06);
  color: #1b4332;
}
body.light-theme .standings-table tbody tr.row-user {
  background: rgba(212, 175, 55, 0.12);
}
body.light-theme .standings-table tbody tr.row-user td {
  color: #1b4332;
  font-weight: 700;
}

body.light-theme .fixture-row {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
body.light-theme .fixture-teams {
  color: #1b4332;
}

body.light-theme #results-title {
  color: #1b4332;
}

body.light-theme .modal-title {
  color: #1b4332;
  border-bottom-color: rgba(0,0,0,0.06);
}
body.light-theme .modal-close {
  color: var(--color-text-muted);
}
body.light-theme .modal-close:hover {
  color: #1b4332;
}
body.light-theme .rules-section h5 {
  color: #1b4332;
}

body.light-theme .header-btn {
  background: var(--bg-card);
  border-color: var(--border-glass);
  color: #1b4332;
}
body.light-theme .header-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

body.light-theme .btn-secondary {
  color: #1b4332;
}
body.light-theme .btn-secondary:hover {
  background: var(--bg-card-hover);
  color: #1b4332;
}

body.light-theme .player-row-container {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .player-row-container:hover:not(.disabled) {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--color-accent);
}

body.light-theme .player-row-name {
  color: #1b4332;
}

body.light-theme .stat-badge {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
  color: #52796f;
}

body.light-theme .stat-badge.main {
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.4);
  color: #b0870c;
}

body.light-theme .stat-badge strong {
  color: #1b4332;
}

body.light-theme .player-stats-expanded-wrapper {
  background: rgba(0, 0, 0, 0.02);
  border-top-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .btn-expand-stats {
  color: #52796f;
}

body.light-theme .btn-expand-stats:hover {
  color: var(--color-accent);
  background: rgba(0, 0, 0, 0.04);
}

body.light-theme .squad-slot-row {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .squad-slot-row.filled {
  background: rgba(0, 0, 0, 0.04);
}

body.light-theme .squad-slot-name {
  color: #1b4332;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 992px) {
  .draft-layout,
  .simulation-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .football-pitch {
    max-width: 328px;
    margin: 0 auto;
  }
  
  .controls-container {
    height: auto;
    overflow: visible;
  }
  
  .players-pool-box {
    height: auto;
    display: flex;
    flex-direction: column;
  }
  
  .players-list-grid {
    max-height: 320px;
    overflow-y: auto;
  }
}

@media (max-width: 600px) {
  body {
    padding: 0 10px;
  }
  
  .hero-title {
    font-size: 36px;
  }
  
  .tactic-grid {
    grid-template-columns: 1fr;
  }
  
  .results-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .roster-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .players-list-grid {
    grid-template-columns: 1fr;
  }
  
  .main-header h1 {
    font-size: 20px;
  }

  /* Header: let it wrap and tighten spacing so nothing (e.g. Reiniciar) is
     cut off on narrow screens. */
  .main-header {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    padding: 14px 0;
  }

  .header-right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 10px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-btn {
    padding: 7px 12px;
    font-size: 13px;
  }
}

/* Toast notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}

.toast {
  background: rgba(20, 38, 30, 0.96);
  border: 1px solid var(--color-accent);
  color: var(--color-text-main);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.4));
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  max-width: 90vw;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-error {
  border-color: var(--color-italy-red);
}

body.light-theme .toast {
  background: rgba(255, 255, 255, 0.98);
  color: #1b4332;
}

/* Visible keyboard focus (does not affect mouse users) */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Cookie consent banner (LGPD) */
.consent-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 100001;
  width: min(680px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
  padding: 14px 18px;
  background: rgba(20, 38, 30, 0.98);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.consent-banner p {
  flex: 1;
  min-width: 200px;
  margin: 0;
  font-size: 13px;
  color: var(--color-text-main);
}

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

.consent-btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.consent-btn.consent-accept {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #15241c;
}

.consent-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.consent-btn.consent-accept:hover {
  color: #15241c;
  filter: brightness(1.05);
}

body.light-theme .consent-banner {
  background: rgba(255, 255, 255, 0.98);
}

/* Community links on the results screen (feedback highlighted, coffee discreet) */
.community-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 16px;
  margin: 0 auto 16px;
}

/* Feedback — a bit more prominent: an accent-outlined chip */
.feedback-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: var(--color-accent);
  text-decoration: none;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: var(--radius-pill);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.feedback-link:hover {
  background: rgba(212, 175, 55, 0.16);
  transform: translateY(-1px);
}

/* Discreet "buy me a coffee" support link */
.coffee-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius-pill);
  opacity: 0.7;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.coffee-link:hover {
  opacity: 1;
  color: var(--color-accent);
}
