:root {
  
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-alt: #f1f5f9;
  
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #2563eb;
  --primary-glow: rgba(29, 78, 216, 0.15);
  
  --accent: #0284c7;
  --accent-gold: #d97706;
  --accent-gold-hover: #b45309;
  --accent-green: #059669;
  --accent-red: #dc2626;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-inverse: #ffffff;

  --border-subtle: #e2e8f0;
  --border-focus: #2563eb;
  --border-card: #e2e8f0;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 18px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 36px -4px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 25px rgba(29, 78, 216, 0.18);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.container-narrow {
  max-width: 860px;
}

.section {
  padding-top: 80px;
  padding-bottom: 80px;
  position: relative;
}

.section-alt {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  margin-bottom: 16px;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  margin-bottom: 12px;
}

p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

p.lead {
  font-size: 1.2rem;
  color: #334155;
  line-height: 1.6;
}

.text-accent {
  color: var(--primary);
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 50px;
}

.section-tag {
  display: inline-block;
  padding: 6px 14px;
  background-color: rgba(29, 78, 216, 0.08);
  border: 1px solid rgba(29, 78, 216, 0.25);
  border-radius: var(--radius-full);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  transition: all var(--transition-normal);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  color: #ffffff;
  border: 1px solid rgba(29, 78, 216, 0.4);
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.35);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: rgba(29, 78, 216, 0.08);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 15px 32px;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: all var(--transition-normal);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.brand-logo svg {
  width: 32px;
  height: 32px;
  fill: var(--primary);
}

.brand-logo span.accent {
  color: var(--accent-gold);
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 24px;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  padding: 6px 0;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  outline: none;
  padding: 6px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-sm);
  -webkit-appearance: none;
  appearance: none;
}

.mobile-toggle:hover {
  background-color: #f1f5f9;
}

.mobile-toggle span {
  display: block;
  height: 2px;
  width: 22px;
  background-color: var(--text-main);
  border-radius: 2px;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #ffffff;
  padding: 20px 24px 30px;
  flex-direction: column;
  z-index: 99999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-nav-close {
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.mobile-nav-close:hover {
  background-color: #e2e8f0;
  color: var(--primary);
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.mobile-nav-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  background-color: #f1f5f9;
  color: var(--primary);
}

.mobile-nav-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.hero-section {
  padding: 80px 0 60px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.hero-content {
  max-width: 640px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
  margin-bottom: 36px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.hero-stat-item h4 {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.hero-stat-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.hero-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent-gold));
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  align-items: start;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.feature-card {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: auto;
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  background-color: #ffffff;
}

.feature-icon-wrapper {
  width: 48px;
  height: 48px;
  background: rgba(29, 78, 216, 0.08);
  border: 1px solid rgba(29, 78, 216, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-icon-wrapper svg {
  width: 24px;
  height: 24px;
  fill: var(--primary);
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
  line-height: 1.6;
}

.team-builder-section {
  padding: 80px 0;
  background-color: #f1f5f9;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.builder-layout {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.roster-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background-color: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.filter-btn.active, .filter-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.builder-search-box {
  display: flex;
  align-items: center;
  background-color: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

.builder-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.9rem;
  width: 180px;
}

.player-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.player-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.player-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.player-card.is-selected {
  border-color: var(--accent-green);
  background: #f0fdf4;
}

.player-avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-avatar svg {
  width: 36px;
  height: 36px;
  fill: var(--text-subtle);
}

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

.player-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.player-team {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.player-pos-badge {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pos-hyokkaaja {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.pos-puolustaja {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.pos-maalivahti {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.player-stats-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin: 10px 0 14px;
  font-size: 0.82rem;
}

.player-stats-row span {
  color: var(--text-muted);
}

.player-stats-row strong {
  color: var(--text-main);
  display: block;
}

.player-action-btn {
  margin-top: auto;
  width: 100%;
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.player-card:not(.is-selected) .player-action-btn {
  background-color: var(--primary);
  color: #ffffff;
}

.player-card:not(.is-selected) .player-action-btn:hover {
  background-color: var(--primary-hover);
}

.player-card.is-selected .player-action-btn {
  background-color: #fee2e2;
  color: var(--accent-red);
  border: 1px solid #fca5a5;
}

.player-card.is-selected .player-action-btn:hover {
  background-color: var(--accent-red);
  color: #ffffff;
}

.user-team-panel {
  background: #ffffff;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.team-dock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.team-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
}

.selected-roster-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.roster-slot {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
}

.roster-slot.filled {
  border-style: solid;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.slot-placeholder {
  color: var(--text-subtle);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.slot-placeholder svg {
  width: 28px;
  height: 28px;
  fill: #94a3b8;
  margin: 0 auto 8px;
}

.slot-player-info {
  width: 100%;
}

.slot-player-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-player-role {
  font-size: 0.75rem;
  color: var(--primary);
  margin: 2px 0 8px;
}

.slot-remove-btn {
  padding: 4px 8px;
  font-size: 0.7rem;
  color: var(--accent-red);
  background: #fee2e2;
  border-radius: var(--radius-sm);
  border: 1px solid #fecaca;
  width: 100%;
}

.slot-remove-btn:hover {
  background: var(--accent-red);
  color: #ffffff;
}

.team-action-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.team-status-text {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.predictions-section {
  padding: 80px 0;
}

.prediction-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.prediction-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.league-tag {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.match-teams-box {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 20px;
}

.match-team {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
}

.match-vs {
  font-size: 0.8rem;
  color: var(--accent-gold);
  font-weight: 800;
}

.match-probabilities {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.prob-box {
  flex: 1;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
}

.prob-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.prob-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.prediction-insight {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  background: #f8fafc;
  padding: 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.form-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.form-feedback-success {
  margin-top: 16px;
  padding: 14px 18px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius-md);
  color: #166534;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 2px 6px rgba(22, 101, 52, 0.08);
  animation: formFeedbackFade 0.3s ease;
}

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

.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.4;
}

.form-checkbox-label input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFadeIn 0.3s ease;
}

.sim-scoreboard {
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.sim-team-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #f8fafc;
}

.sim-team-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2px;
}

.sim-score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sim-score-numbers {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 4px;
  line-height: 1;
}

.sim-period-badge {
  background: #1e293b;
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-top: 6px;
  text-transform: uppercase;
}

.sim-events-container {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.sim-event-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
}

.sim-event-item:last-child {
  border-bottom: none;
}

.sim-event-time {
  font-weight: 700;
  color: var(--primary);
  min-width: 45px;
}

.sim-event-text {
  color: var(--text-main);
  flex: 1;
}

.sim-event-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tag-goal { background: #dcfce7; color: #166534; }
.tag-save { background: #e0f2fe; color: #0369a1; }
.tag-assist { background: #fef3c7; color: #92400e; }

.sim-points-summary {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sim-points-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}

.team-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.metric-item-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.metric-bar-bg {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.25s ease;
}

.builder-quick-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.builder-quick-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.builder-quick-btn:hover {
  background: #f1f5f9;
  border-color: var(--primary);
  color: var(--primary);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: #e2e8f0;
}

.age-banner {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 8px 0;
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
}

.age-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #fbbf24;
  margin-right: 8px;
}

.cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--border-subtle);
  padding: 20px;
  z-index: 999;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  display: none;
}

.cookie-bar.active {
  display: block;
}

.cookie-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.cookie-text {
  flex: 1;
  min-width: 280px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.cookie-text a {
  color: var(--primary);
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 12px;
}

.site-footer {
  background-color: #0f172a;
  color: #f8fafc;
  border-top: 1px solid #1e293b;
  padding: 70px 0 30px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-brand .brand-logo {
  color: #ffffff;
}

.footer-brand p {
  font-size: 0.88rem;
  margin-top: 14px;
  margin-bottom: 20px;
  color: #94a3b8;
  max-width: 320px;
}

.footer-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 8px;
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 28px;
  height: 2px;
  background: var(--accent-gold);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  font-size: 0.88rem;
  color: #94a3b8;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: #60a5fa;
}

.footer-social-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #cbd5e1;
  padding: 6px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.social-item:hover {
  color: #ffffff;
  border-color: #60a5fa;
  background: #2563eb;
}

.footer-legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.badge-18 {
  background: #f59e0b;
  color: #000;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.badge-text {
  font-size: 0.78rem;
  color: #fde68a;
  line-height: 1.3;
}

.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.82rem;
  color: #64748b;
}

.org-info-box {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 14px;
  margin-bottom: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-main);
}

.site-footer .org-info-box {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  margin-bottom: 20px;
}

.policy-container {
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-md);
}

.clause-item {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.clause-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.clause-num {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}

.clause-item h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--text-main);
}

.clause-item p, .clause-item ul {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.clause-item ul {
  margin-left: 20px;
  margin-top: 10px;
  margin-bottom: 12px;
}

.clause-item li {
  margin-bottom: 6px;
}

.match-simulation-result {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 20px 0;
  text-align: center;
}

.sim-score-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 16px 0;
}

.sim-team-box {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.sim-score-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
}

.sim-points-awarded {
  display: inline-block;
  padding: 4px 14px;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
}

@media (max-width: 1200px) {
  .main-nav, .header-actions .btn {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .player-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .selected-roster-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .section {
    padding-top: 50px;
    padding-bottom: 50px;
  }

  .grid-3, .grid-2, .grid-4 {
    grid-template-columns: 1fr;
  }

  .player-cards-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .player-card {
    min-width: 250px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }

  .selected-roster-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .roster-slot {
    min-width: 140px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .policy-container {
    padding: 24px;
  }

  .cookie-content {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-buttons {
    width: 100%;
  }

  .cookie-buttons button {
    flex: 1;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-box {
    padding: 22px 16px;
    border-radius: var(--radius-md);
    max-height: 94vh;
  }

  .modal-close-btn {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    z-index: 10;
  }

  .modal-box .section-tag {
    font-size: 0.7rem;
    padding: 4px 10px;
    margin-bottom: 8px;
    max-width: calc(100% - 45px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }

  .sim-scoreboard {
    padding: 14px 8px;
    gap: 6px;
    margin-bottom: 14px;
  }

  .sim-team-name {
    font-size: 0.82rem;
    line-height: 1.25;
    word-break: break-word;
  }

  .sim-team-sub {
    font-size: 0.7rem;
  }

  .sim-score-numbers {
    font-size: 1.7rem;
    letter-spacing: 2px;
    white-space: nowrap;
  }

  .sim-period-badge {
    font-size: 0.65rem;
    padding: 3px 6px;
    white-space: nowrap;
  }

  .sim-events-container {
    padding: 10px 8px;
    max-height: 140px;
    margin-bottom: 14px;
  }

  .sim-event-item {
    font-size: 0.78rem;
    gap: 6px;
    padding: 6px 0;
  }

  .sim-event-time {
    min-width: 36px;
    font-size: 0.78rem;
  }

  .sim-event-tag {
    font-size: 0.65rem;
    padding: 2px 5px;
  }

  .sim-points-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
  }

  .sim-points-value {
    font-size: 1.4rem;
    white-space: nowrap;
    align-self: flex-start;
  }

  #btn-proceed-to-save {
    font-size: 0.92rem;
    padding: 14px 12px;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  width: calc(100% - 48px);
  pointer-events: none;
}

.floating-toast {
  pointer-events: auto;
  background: #ffffff;
  border-left: 4px solid var(--primary);
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  color: var(--text-main);
  position: relative;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

.floating-toast.toast-hiding {
  opacity: 0;
  transform: translateX(30px);
}

.toast-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.toast-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

.toast-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  margin-left: 10px;
}

.toast-close-btn:hover {
  color: var(--text-main);
}

.toast-body {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
