/* ===== 2026 World Cup Guide - Styles ===== */
:root {
  --bg-primary: #0a1628;
  --bg-secondary: #111d33;
  --bg-card: #162340;
  --bg-card-hover: #1c2d4f;
  --green-pitch: #1a8d3a;
  --green-light: #2ecc71;
  --green-dark: #145a27;
  --accent: #f5a623;
  --accent-light: #ffd700;
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --text-primary: #e8edf3;
  --text-secondary: #8899aa;
  --text-dim: #556677;
  --red: #e74c3c;
  --yellow: #f1c40f;
  --blue: #3498db;
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 60px;
  --header-height: 56px;
  --transition: 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
#header {
  height: var(--header-height);
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}

#page-title {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--green-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.lang-switch select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-secondary);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.lang-switch select:focus {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Content */
#content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.page {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: none;
  -webkit-overflow-scrolling: touch;
}

.page.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(46,204,113,0.3); }
  50% { box-shadow: 0 0 20px rgba(46,204,113,0.6); }
}

/* Bottom Nav */
#bottom-nav {
  height: var(--nav-height);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-width: 56px;
}

.nav-item:active { transform: scale(0.92); }

.nav-icon { font-size: 22px; }
.nav-label { font-size: 10px; color: var(--text-secondary); }

.nav-item.active .nav-label {
  color: var(--green-light);
  font-weight: 600;
}

.nav-item.active .nav-icon { transform: scale(1.1); }

/* ===== Home Page ===== */
.home-hero {
  text-align: center;
  padding: 30px 16px 20px;
  background: linear-gradient(180deg, rgba(26,141,58,0.15), transparent);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.hero-logo { font-size: 64px; animation: pulse 3s infinite; }
.home-hero h2 { font-size: 24px; margin: 12px 0 4px; color: var(--text-primary); }
.hero-sub { color: var(--text-secondary); font-size: 14px; }
.hero-date { color: var(--accent); font-size: 16px; font-weight: 600; margin-top: 8px; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
}

.stat-item { text-align: center; }
.stat-num { display: block; font-size: 28px; font-weight: 800; color: var(--green-light); }
.stat-label { font-size: 11px; color: var(--text-secondary); }

.home-quick h3, .home-groups h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.quick-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.04);
}

.quick-card:active { transform: scale(0.96); background: var(--bg-card-hover); }

.group-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.group-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.group-card:active { transform: scale(0.97); }
.group-card h4 { font-size: 13px; color: var(--green-light); margin-bottom: 6px; }
.group-card p { font-size: 11px; color: var(--text-secondary); line-height: 1.6; }

/* ===== Teams Page ===== */
.search-bar { margin-bottom: 12px; }
.search-bar input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.search-bar input:focus { border-color: var(--green-light); }
.search-bar input::placeholder { color: var(--text-dim); }

.group-tabs {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.group-tabs::-webkit-scrollbar { display: none; }

.group-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.group-tab.active { background: var(--green-pitch); color: #fff; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.team-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}

.team-card:active { transform: scale(0.96); }
.team-card .flag { font-size: 40px; display: block; margin-bottom: 8px; }
.team-card .team-name { font-size: 14px; font-weight: 600; }
.team-card .team-rank { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.team-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40px; height: 40px;
  background: linear-gradient(135deg, transparent 50%, rgba(46,204,113,0.08) 50%);
}

/* ===== Player Avatar (shared) ===== */
.avatar-placeholder {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-card-hover), var(--bg-card));
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.avatar-placeholder::after {
  content: '👤';
  font-size: 22px;
  opacity: 0.5;
}
.avatar-placeholder.sm { width: 36px; height: 36px; border-width: 1.5px; }
.avatar-placeholder.sm::after { font-size: 16px; }
.avatar-placeholder.lg { width: 80px; height: 80px; border-width: 3px; }
.avatar-placeholder.lg::after { font-size: 40px; opacity: 0.4; }
.avatar-placeholder.xl { width: 96px; height: 96px; border-width: 3px; }
.avatar-placeholder.xl::after { font-size: 48px; opacity: 0.35; }
.avatar-placeholder .av-num {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 20px; height: 20px;
  background: var(--green-pitch);
  border-radius: 50%;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary);
  color: #fff;
}
.avatar-placeholder.lg .av-num,
.avatar-placeholder.xl .av-num { width: 26px; height: 26px; font-size: 12px; bottom: -3px; right: -3px; }
.avatar-placeholder .av-ovr {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px; font-weight: 900;
  color: var(--accent);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.avatar-placeholder.lg .av-ovr { font-size: 22px; }
.avatar-placeholder.xl .av-ovr { font-size: 28px; }

/* ===== Player Card Image (webp avatar) ===== */
.player-card-img {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.player-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* No border, no border-radius — transparent background webp */
  border-radius: 0;
}
.player-card-img .av-num {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 20px; height: 20px;
  background: var(--green-pitch);
  border-radius: 50%;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary);
  color: #fff;
}
.player-card-img.sm { width: 36px; height: 36px; }
.player-card-img.sm .av-num { width: 16px; height: 16px; font-size: 8px; }
.player-card-img.lg { width: 80px; height: 80px; }
.player-card-img.lg .av-num { width: 26px; height: 26px; font-size: 12px; bottom: -3px; right: -3px; }
.player-card-img.xl { width: 96px; height: 96px; }
.player-card-img.xl .av-num { width: 26px; height: 26px; font-size: 12px; bottom: -3px; right: -3px; }

/* ===== Team Detail ===== */
.team-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(26,141,58,0.12), transparent);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.team-flag-lg { font-size: 56px; line-height: 1; }
.team-info h2 { font-size: 22px; margin-bottom: 4px; }
.team-info p { font-size: 12px; color: var(--text-secondary); }
.team-stars { font-size: 12px; color: var(--accent); margin-top: 4px; }

/* Team/Player radar section */
.team-radar-section h3,
.player-radar-section h3 {
  font-size: 15px; font-weight: 600;
  margin-bottom: 12px; color: var(--text-secondary);
}
.radar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin: 12px 0;
}
/* Radar labels — 3x2 grid, not vertical list */
.radar-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px 16px;
  width: 100%;
  margin-top: 12px;
}
.radar-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}
.radar-stat span { font-size: 12px; color: var(--text-secondary); }
.radar-stat strong { font-size: 16px; font-weight: 800; }

/* Team actions */
.team-actions {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}
.btn {
  flex: 1;
  padding: 10px 8px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.btn:active { transform: scale(0.96); background: var(--bg-card-hover); }
.btn-danger {
  padding: 10px 24px;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; cursor: pointer;
}

/* ===== Squad Grid (Starting XI + Bench) ===== */
/* ===== Flag Image ===== */
.flag-img {
  height: 1em;
  width: auto;
  vertical-align: middle;
  margin-right: 2px;
  border-radius: 2px;
}
.tc-flag .flag-img { height: 28px; }
.my-team-flag .flag-img { height: 24px; }
.team-flag-lg .flag-img { height: 48px; }
.rank-flag .flag-img { height: 18px; }
.selected-flag .flag-img { height: 22px; }
.flag .flag-img { height: 32px; }
.ls-team .flag-img { height: 16px; }
.hp-team .flag-img { height: 14px; }
.pred-team .flag-img { height: 16px; }

.team-squad h3 {
  font-size: 15px; font-weight: 600;
  margin: 16px 0 10px; color: var(--text-secondary);
}
.squad-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 6px;
}
.player-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
  min-width: 0;
}
.player-card:active { background: var(--bg-card-hover); transform: scale(0.97); }
.player-card .pc-number { display: none; }
.player-card .avatar-placeholder.sm { width: 32px; height: 32px; flex-shrink: 0; }
.player-card .avatar-placeholder.sm::after { font-size: 14px; }
.player-card .avatar-placeholder.sm .av-num { width: 16px; height: 16px; font-size: 8px; }
.player-card .pc-info { flex: 1; min-width: 0; overflow: hidden; }
.player-card .pc-name {
  font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-card .pc-pos { font-size: 9px; color: var(--text-dim); margin-top: 1px; }
.player-card .pc-ovr {
  font-size: 14px; font-weight: 800;
  color: var(--accent); flex-shrink: 0;
  min-width: 22px; text-align: center;
}
.bench-card { opacity: 0.85; }
.omitted-card { opacity: 0.75; border-left: 2px solid var(--red); }
.omitted-card .pc-name::after { content: ' (落选)'; font-size: 9px; color: var(--red); margin-left: 3px; }

.team-hero {
  text-align: center;
  padding: 20px;
  background: linear-gradient(180deg, rgba(26,141,58,0.12), transparent);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.team-hero .flag { font-size: 64px; }
.team-hero h2 { margin: 8px 0 4px; font-size: 22px; }
.team-hero .rank-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent); color: #000;
  border-radius: 20px; font-size: 12px; font-weight: 700; margin-top: 6px;
}

.team-stats-row {
  display: flex; justify-content: space-around;
  margin: 16px 0; padding: 12px;
  background: var(--bg-card); border-radius: var(--radius-sm);
}
.team-stat { text-align: center; }
.team-stat .val { font-size: 20px; font-weight: 800; color: var(--green-light); }
.team-stat .lbl { font-size: 10px; color: var(--text-dim); }

.team-section-title {
  font-size: 15px; font-weight: 600; margin: 16px 0 10px;
  color: var(--text-secondary); display: flex; align-items: center; gap: 6px;
}

.player-list { display: flex; flex-direction: column; gap: 8px; }
.player-row {
  display: flex; align-items: center;
  padding: 10px 12px; background: var(--bg-card);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: var(--transition); gap: 12px;
}
.player-row:active { background: var(--bg-card-hover); }
.player-number {
  width: 28px; height: 28px; background: var(--green-pitch);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.player-info { flex: 1; }
.player-name { font-size: 14px; font-weight: 600; }
.player-meta { font-size: 11px; color: var(--text-dim); }
.player-ovr {
  font-size: 18px; font-weight: 800;
  color: var(--accent); min-width: 36px; text-align: center;
}

/* ===== Player Detail ===== */
.player-hero {
  text-align: center;
  padding: 20px;
  background: linear-gradient(180deg, rgba(26,141,58,0.12), transparent);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

/* Player detail header */
.player-detail .player-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(26,141,58,0.12), transparent);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.player-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-card-hover), var(--bg-card));
  display: flex; align-items: center; justify-content: center;
  margin: 0;
  border: 3px solid var(--green-light);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.player-avatar::after {
  content: '👤';
  font-size: 36px;
  opacity: 0.4;
}
.player-avatar .pa-number {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 24px; height: 24px;
  background: var(--green-pitch);
  border-radius: 50%;
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary);
  color: #fff;
}
.player-avatar .pa-ovr {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px; font-weight: 900;
  color: var(--accent);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.player-header .player-info { flex: 1; }
.player-header .player-info h2 { font-size: 20px; margin-bottom: 4px; }
.player-header .player-info p { font-size: 12px; color: var(--text-secondary); }
.player-header .player-club { color: var(--text-dim) !important; }

.player-hero h2 { font-size: 20px; margin-bottom: 4px; }
.player-hero .player-pos { color: var(--accent); font-size: 14px; font-weight: 600; }
.player-hero .player-club { color: var(--text-dim); font-size: 12px; margin-top: 4px; }

/* Player stats bar chart */
.player-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}
.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-label {
  font-size: 12px; color: var(--text-secondary);
  width: 32px; text-align: right; flex-shrink: 0;
}
.stat-bar {
  flex: 1; height: 14px;
  background: var(--bg-secondary); border-radius: 7px; overflow: hidden;
}
.stat-fill {
  height: 100%; border-radius: 7px; transition: width 0.6s ease;
}
.stat-value {
  font-size: 13px; font-weight: 700;
  min-width: 28px; text-align: right; color: var(--accent);
}

.player-attrs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}

.attr-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}

.attr-label { font-size: 12px; color: var(--text-secondary); }
.attr-val { font-size: 16px; font-weight: 700; }

.attr-val.high { color: var(--green-light); }
.attr-val.mid { color: var(--accent); }
.attr-val.low { color: var(--red); }

.radar-container {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin: 16px 0;
}

.player-bio {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
}

.bio-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}

.bio-row:last-child { border: none; }
.bio-label { color: var(--text-secondary); }
.bio-val { font-weight: 600; }

/* ===== Match Page ===== */
.match-setup { text-align: center; }
.match-setup h2 { font-size: 20px; margin-bottom: 16px; }

.match-teams-select {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.team-select-card {
  width: 120px;
  padding: 20px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  border: 2px dashed rgba(255,255,255,0.1);
  text-align: center;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-select-card.selected { border-style: solid; border-color: var(--green-light); }
.team-select-card .select-placeholder { color: var(--text-dim); font-size: 13px; }
.team-select-card .selected-flag { font-size: 36px; display: block; }
.team-select-card .selected-name { font-size: 12px; margin-top: 6px; font-weight: 600; }

.vs-badge {
  font-size: 24px;
  font-weight: 900;
  color: var(--accent);
}

.match-options {
  margin: 16px 0;
  text-align: left;
}

.match-options label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }

.toggle-group { display: flex; gap: 8px; }

.toggle-btn {
  flex: 1;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-btn.active {
  background: var(--green-pitch);
  color: #fff;
  border-color: var(--green-light);
}

/* btn-primary, btn-secondary, btn-danger moved to Team Detail section above */

/* Match Result */
.match-result {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
  text-align: center;
}

.result-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 16px 0;
}

.result-team { text-align: center; min-width: 80px; }
.result-team .flag { font-size: 40px; }
.result-team .name { font-size: 13px; margin-top: 4px; font-weight: 600; }

.result-score-num {
  font-size: 40px;
  font-weight: 900;
  color: var(--accent);
  min-width: 80px;
  text-align: center;
}

.result-events {
  text-align: left;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.event-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}

.event-time { color: var(--text-dim); min-width: 36px; font-weight: 600; }
.event-icon { font-size: 16px; }
.event-text { color: var(--text-secondary); }

/* Live Match */
.match-live {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}

.live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.live-time { font-size: 20px; font-weight: 800; color: var(--accent); }
.live-status { font-size: 12px; padding: 4px 8px; border-radius: 4px; }
.live-status.playing { background: var(--green-pitch); color: #fff; animation: glow 2s infinite; }
.live-status.halftime { background: var(--accent); color: #000; }
.live-status.finished { background: var(--text-dim); color: #fff; }

.live-events {
  max-height: 300px;
  overflow-y: auto;
}

.live-event {
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  animation: fadeIn 0.3s ease;
  font-size: 13px;
}

.live-event .time { color: var(--accent); font-weight: 700; margin-right: 8px; }

/* ===== Formation Page ===== */
.formation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.formation-header h2 { font-size: 18px; }

.formation-ctrl {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.formation-ctrl label { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

.select-box {
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  flex: 1;
}

.formation-pitch {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(180deg, var(--green-dark), var(--green-pitch), var(--green-dark));
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.15);
  max-height: 50vh;
}

.formation-pitch::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 1px;
  background: rgba(255,255,255,0.2);
}

.formation-pitch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
}

.pitch-player {
  position: absolute;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  text-align: center;
  cursor: grab;
  z-index: 10;
  transition: none;
  touch-action: none;
}

.pitch-player:active { cursor: grabbing; z-index: 20; }

.pitch-player .p-avatar {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}
.pitch-player .p-avatar img {
  width: 100%; height: 100%;
  object-fit: contain;
  border: none;
  border-radius: 0;
}
.pitch-player .p-avatar .p-noimg {
  width: 100%; height: 100%;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--bg-card-hover), var(--bg-card));
  border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.pitch-player .p-avatar:has(img) .p-noimg { display: none; }
.pitch-player .p-name {
  font-size: 9px;
  color: #fff;
  margin-top: 2px;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.formation-bench {
  margin-top: 12px;
  padding: 10px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.formation-bench h4 {
  font-size: 13px; color: var(--text-secondary); margin-bottom: 8px;
}
.bench-list {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 6px;
}
.bench-player {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  min-width: 0;
}
.bench-player .bp-avatar {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.bench-player .bp-avatar img {
  width: 100%; height: 100%;
  object-fit: contain;
  border: none;
  border-radius: 0;
}
.bench-player .bp-avatar .bp-noimg {
  width: 100%; height: 100%;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--bg-card-hover), var(--bg-card));
  border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800;
  color: var(--accent);
}
.bench-player .bp-avatar:has(img) .bp-noimg { display: none; }
.bench-player .bp-info {
  flex: 1; min-width: 0;
  overflow: hidden;
}
.bench-player .bp-name {
  font-size: 11px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bench-player .bp-meta {
  font-size: 9px; color: var(--text-dim);
}
.bench-player:active { background: var(--bg-card-hover); }

/* ===== Prediction Page ===== */
.predict-ctrl {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 12px 0 16px;
}

.predict-ctrl label { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

.predict-results {
  margin-bottom: 20px;
}

.predict-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.predict-bar-row .flag { font-size: 20px; min-width: 24px; }
.predict-bar-row .name { min-width: 60px; font-size: 12px; }

.predict-bar-track {
  flex: 1;
  height: 20px;
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
}

.predict-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.8s ease;
  background: linear-gradient(90deg, var(--green-pitch), var(--green-light));
}

.predict-bar-row .pct { min-width: 40px; font-size: 13px; font-weight: 700; text-align: right; color: var(--accent); }

/* Bracket */
.predict-bracket { overflow-x: auto; padding-bottom: 20px; }
.bracket-table { width: 100%; min-width: 600px; }
.bracket-round {
  display: inline-block;
  vertical-align: top;
  width: 140px;
  margin-right: 8px;
}
.bracket-round-title {
  text-align: center;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
  padding: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.bracket-match {
  padding: 6px 8px;
  margin-bottom: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bracket-match .winner { color: var(--green-light); font-weight: 700; }
.bracket-match .loser { color: var(--text-dim); }

/* ===== Modal ===== */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 { font-size: 16px; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.team-picker-content { max-width: 600px; }
.picker-grid { max-height: 60vh; overflow-y: auto; }

/* ===== Utilities ===== */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }

/* Back button */
.back-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  margin-right: 8px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Responsive */
@media (min-width: 768px) {
  .team-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .group-summary { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .player-attrs { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Home Sections (New) ===== */
.home-section { margin-bottom: 20px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-header h3 { font-size: 16px; color: var(--text-secondary); font-weight: 600; }
.section-more { font-size: 12px; color: var(--accent); cursor: pointer; }
.section-more:active { opacity: 0.7; }

/* ===== Buttons (New) ===== */
.btn-sm { padding: 4px 12px; background: var(--bg-card); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; color: var(--green-light); font-size: 12px; cursor: pointer; transition: var(--transition); }
.btn-sm:active { transform: scale(0.94); background: var(--bg-card-hover); }
.btn-primary { padding: 10px 24px; background: var(--green-pitch); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; cursor: pointer; transition: var(--transition); text-align: center; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary:active:not(:disabled) { transform: scale(0.96); }
.btn-secondary { padding: 10px 24px; background: var(--bg-card); color: var(--text-primary); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm); font-size: 14px; cursor: pointer; transition: var(--transition); text-align: center; }
.btn-secondary:active { transform: scale(0.96); background: var(--bg-card-hover); }
.btn-danger { padding: 10px 24px; background: var(--red); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; cursor: pointer; transition: var(--transition); }
.btn-danger:active { transform: scale(0.96); }

/* ===== My Teams (Home + Profile) ===== */
.my-teams-bar { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.my-teams-bar::-webkit-scrollbar { display: none; }
.my-team-card { flex-shrink: 0; width: 80px; padding: 10px 6px; background: var(--bg-card); border-radius: var(--radius-sm); text-align: center; cursor: pointer; border: 1px solid rgba(255,255,255,0.04); transition: var(--transition); }
.my-team-card:active { transform: scale(0.95); background: var(--bg-card-hover); }
.my-team-flag { font-size: 28px; }
.my-team-name { font-size: 10px; margin-top: 4px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-team-empty { padding: 16px; text-align: center; color: var(--text-dim); font-size: 13px; background: var(--bg-card); border-radius: var(--radius-sm); border: 1px dashed rgba(255,255,255,0.08); cursor: pointer; }
.my-team-empty:active { background: var(--bg-card-hover); }

/* ===== Hot Players ===== */
.hot-players-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.hot-players-row::-webkit-scrollbar { display: none; }
.hot-player-card { flex-shrink: 0; width: 100px; padding: 12px 8px; background: var(--bg-card); border-radius: var(--radius-sm); text-align: center; cursor: pointer; border: 1px solid rgba(255,255,255,0.04); transition: var(--transition); }
.hot-player-card:active { transform: scale(0.95); background: var(--bg-card-hover); }
.hp-avatar { width: 48px; height: 48px; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; position: relative; }
.hp-avatar img { width: 100%; height: 100%; object-fit: contain; border: none; }
.hp-avatar .hp-noimg { width: 48px; height: 48px; border-radius: 4px; background: linear-gradient(135deg, var(--bg-card-hover), var(--bg-card)); border: 1px solid var(--accent); display: flex; align-items: center; justify-content: center; }
.hp-avatar .hp-noimg .hp-ovr { font-size: 13px; font-weight: 900; color: var(--accent); text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
.hp-ovr { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 13px; font-weight: 900; color: var(--accent); text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
.hp-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-team { font-size: 9px; color: var(--text-dim); margin-top: 2px; }
.hp-likes { font-size: 10px; color: var(--red); margin-top: 4px; }

/* ===== Like Button ===== */
.like-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; background: var(--bg-card); border: 1px solid rgba(231,76,60,0.3); border-radius: 20px; color: var(--red); font-size: 13px; cursor: pointer; transition: var(--transition); }
.like-btn.liked { background: rgba(231,76,60,0.15); border-color: var(--red); transform: scale(1.05); }
.like-btn:active { transform: scale(0.94); }
.like-count { font-weight: 600; }

/* ===== Team Detail Additions ===== */
.myteam-badge { display: inline-block; font-size: 11px; padding: 2px 8px; background: rgba(231,76,60,0.2); color: var(--red); border-radius: 10px; margin-left: 6px; vertical-align: middle; }
.team-actions { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.team-actions .btn { flex: 1; min-width: 0; }
.team-actions .share-btn { flex: 0 0 auto; }

/* ===== Player Detail Additions ===== */
.player-actions { display: flex; gap: 8px; margin: 12px 0; }

/* ===== Rankings ===== */
.rank-tabs { display: flex; overflow-x: auto; gap: 6px; margin-bottom: 14px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.rank-tabs::-webkit-scrollbar { display: none; }
.rank-tab { flex-shrink: 0; padding: 6px 14px; border-radius: 20px; background: var(--bg-card); color: var(--text-secondary); font-size: 13px; cursor: pointer; border: 1px solid transparent; transition: var(--transition); }
.rank-tab.active { background: var(--green-pitch); color: #fff; }
.rank-tab:active { transform: scale(0.95); }
.rank-content { margin-bottom: 20px; }
.rank-list { display: flex; flex-direction: column; gap: 4px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.04); transition: var(--transition); cursor: pointer; }
.rank-item:active { background: var(--bg-card-hover); }
.rank-num { font-size: 16px; font-weight: 800; min-width: 28px; text-align: center; }
.rank-num.gold { color: var(--gold); }
.rank-num.silver { color: var(--silver); }
.rank-num.bronze { color: var(--bronze); }
.rank-flag { font-size: 24px; }
.rank-info { flex: 1; min-width: 0; }
.rank-info .name { font-size: 14px; font-weight: 600; }
.rank-info .sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.rank-val { font-size: 16px; font-weight: 800; color: var(--green-light); min-width: 50px; text-align: right; }
.rank-support-badge { font-size: 10px; padding: 2px 6px; background: var(--green-pitch); color: #fff; border-radius: 10px; margin-left: 6px; white-space: nowrap; }

/* ===== Share ===== */
.share-btn { padding: 6px 14px; background: none; border: 1px solid var(--text-dim); border-radius: 16px; color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: var(--transition); }
.share-btn:active { border-color: var(--accent); color: var(--accent); }
.share-content { max-width: 380px; }
.share-card { padding: 16px; background: var(--bg-primary); border-radius: var(--radius); text-align: center; border: 1px solid rgba(255,255,255,0.06); margin-bottom: 16px; white-space: pre-line; line-height: 1.8; font-size: 14px; }
.share-actions { display: flex; gap: 10px; }
.share-actions .btn-primary,
.share-actions .btn-secondary { flex: 1; }

/* ===== Profile ===== */
.profile-my-teams { margin: 16px 0; }
.profile-my-teams-section h3 { font-size: 14px; color: var(--text-secondary); margin-bottom: 10px; }
.profile-team-list { display: flex; flex-direction: column; gap: 6px; }
.pt-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-card); border-radius: var(--radius-sm); }
.pt-item .flag { font-size: 24px; }
.pt-item .name { font-size: 13px; font-weight: 600; }

/* ===== My Team Picker Modal ===== */
.my-team-picker-content { max-width: 600px; }
.my-team-hint { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.myteam-selected { border-color: var(--green-light) !important; background: rgba(46,204,113,0.1) !important; }
.myteam-check { position: absolute; top: 8px; right: 8px; font-size: 16px; color: var(--green-light); }
.team-card { position: relative; }
.picker-card { cursor: pointer; }

/* ===== Modal Footer ===== */
.modal-footer { margin-top: 16px; display: flex; justify-content: flex-end; gap: 8px; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: var(--bg-secondary); color: var(--text-primary); padding: 10px 20px; border-radius: 20px; font-size: 13px; z-index: 2000; animation: fadeIn 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }

/* ===== Match Result Additions ===== */
.result-score { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 16px 0; }
.result-team { text-align: center; min-width: 80px; }
.result-team .flag { font-size: 40px; }
.result-team .name { font-size: 13px; margin-top: 4px; font-weight: 600; }
.result-score-num { font-size: 40px; font-weight: 900; color: var(--accent); min-width: 80px; text-align: center; }
.result-winner { text-align: center; font-size: 18px; font-weight: 700; color: var(--green-light); margin: 12px 0; }
.result-radar { margin: 16px 0; text-align: center; }
.result-events { text-align: left; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.06); }
.result-actions { display: flex; gap: 10px; margin-top: 16px; }
.result-actions .btn { flex: 1; }

/* ===== Live Scoreboard ===== */
.live-scoreboard { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: var(--bg-card); border-radius: var(--radius); margin-bottom: 12px; }
.ls-team { font-size: 14px; font-weight: 600; }
.ls-score { font-size: 32px; font-weight: 900; color: var(--accent); }
.ls-minute { font-size: 14px; color: var(--text-dim); }

/* ===== Match Events ===== */
.match-events { max-height: 300px; overflow-y: auto; }
.event-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.event-row.goal { background: rgba(46,204,113,0.08); }
.event-row.card { background: rgba(231,76,60,0.08); }
.ev-min { color: var(--accent); font-weight: 700; min-width: 36px; }
.ev-icon { font-size: 16px; }
.ev-text { color: var(--text-secondary); }

/* ===== Predict Additions ===== */
.pred-table { width: 100%; }
.pred-header { display: flex; align-items: center; padding: 8px 12px; font-size: 11px; color: var(--text-dim); border-bottom: 1px solid rgba(255,255,255,0.06); }
.pred-header span { flex: 1; }
.pred-header span:first-child { flex: 0 0 28px; }
.pred-header span:last-child { flex: 0 0 60px; }
.pred-row { display: flex; align-items: center; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.03); cursor: pointer; transition: var(--transition); }
.pred-row:active { background: var(--bg-card-hover); }
.pred-rank { flex: 0 0 28px; font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.pred-team { flex: 1; font-size: 13px; font-weight: 600; }
.pred-pct { flex: 0 0 48px; font-size: 12px; font-weight: 700; text-align: right; }
.pred-pct.win { color: var(--green-light); }
.pred-bar { flex: 0 0 60px; height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; margin-left: 8px; }
.pred-bar-fill { height: 100%; border-radius: 4px; transition: width 0.8s ease; }

/* ===== Path Steps ===== */
.path-steps { margin-top: 12px; }
.path-step { margin-bottom: 8px; }
.ps-round { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.ps-bar-container { display: flex; align-items: center; gap: 8px; }
.ps-bar { flex: 1; height: 12px; border-radius: 6px; background: var(--bg-card); overflow: hidden; position: relative; }
.ps-bar > div { height: 100%; border-radius: 6px; transition: width 0.8s ease; }
.ps-pct { font-size: 12px; font-weight: 700; min-width: 40px; text-align: right; }

/* ===== Team Picker (Match) ===== */
.team-select-card { width: 120px; padding: 20px 12px; background: var(--bg-card); border-radius: var(--radius); cursor: pointer; transition: var(--transition); border: 2px dashed rgba(255,255,255,0.1); text-align: center; min-height: 100px; display: flex; align-items: center; justify-content: center; }
.team-select-card.selected { border-style: solid; border-color: var(--green-light); }
.team-select-card:active { transform: scale(0.96); }
.select-placeholder { color: var(--text-dim); font-size: 13px; }
.selected-flag { font-size: 36px; display: block; }
.selected-name { font-size: 12px; margin-top: 6px; font-weight: 600; }
.vs-badge { font-size: 24px; font-weight: 900; color: var(--accent); }

/* ===== Formation Additions ===== */
.formation-pitch { position: relative; }
.pitch-player { position: absolute; width: 44px; height: 44px; transform: translate(-50%,-50%); text-align: center; cursor: grab; z-index: 10; transition: none; touch-action: none; }
.pitch-player:active { cursor: grabbing; z-index: 20; }
/* p-avatar styles are defined above in Formation Player section */
.p-num-badge { position: absolute; bottom: -1px; right: -1px; width: 16px; height: 16px; background: var(--green-pitch); border-radius: 50%; font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--green-dark); color: #fff; }
.p-name { font-size: 9px; color: #fff; margin-top: 2px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.formation-bench { margin-top: 12px; padding: 10px; background: var(--bg-card); border-radius: var(--radius-sm); }
.formation-bench h4 { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.bench-list { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 6px; }
.bench-player { display: flex; align-items: center; gap: 5px; padding: 6px; background: var(--bg-secondary); border-radius: var(--radius-sm); font-size: 11px; cursor: pointer; border: 1px solid rgba(255,255,255,0.06); overflow: hidden; min-width: 0; }
.bench-player:active { background: var(--bg-card-hover); }
/* bp-avatar styles are defined above in Bench Player section */
.bp-info { flex: 1; min-width: 0; overflow: hidden; }
.bp-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-meta { font-size: 9px; color: var(--text-dim); }

/* ===== Responsive Additions ===== */
@media (max-width: 374px) {
  .nav-item { padding: 6px 8px; min-width: 48px; }
  .nav-label { font-size: 9px; }
  .nav-icon { font-size: 20px; }
  .home-hero { padding: 20px 12px 16px; }
  .hero-logo { font-size: 48px; }
  .home-hero h2 { font-size: 20px; }
  .stat-num { font-size: 22px; }
  .quick-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hot-player-card { width: 90px; }
  .my-team-card { width: 72px; }
}

/* ===== Bracket Page ===== */
.bracket-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.bracket-header h2 { font-size: 18px; margin: 0; }
.bracket-actions { display: flex; gap: 6px; }
.bracket-views { display: flex; gap: 6px; margin-bottom: 16px; }
.bracket-tab {
  flex: 1; padding: 8px 4px; background: var(--bg-card); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 13px;
  cursor: pointer; text-align: center; transition: var(--transition);
}
.bracket-tab.active { background: var(--green-pitch); color: #fff; border-color: var(--green-light); }
.bracket-view { display: none; }
.bracket-view.active { display: block; animation: fadeIn 0.25s ease; }

.bracket-group-card {
  background: var(--bg-card); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 10px; overflow-x: auto;
}
.bracket-group-card h4 {
  font-size: 14px; color: var(--green-light); margin-bottom: 8px;
}
.bracket-group-card .bracket-table {
  width: 100%; border-collapse: collapse; font-size: 11px; min-width: 360px;
}
.bracket-group-card .bracket-table th {
  padding: 4px 6px; text-align: center; color: var(--text-dim);
  font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}
.bracket-group-card .bracket-table td {
  padding: 6px 6px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.03);
  white-space: nowrap;
}
.bracket-group-card .bracket-table td:nth-child(2) { text-align: left; }
.bracket-group-card .bracket-table td strong { color: var(--green-light); }
.bracket-group-card .bracket-table tr.qualified td { background: rgba(46,204,113,0.06); }
.bracket-group-card .bracket-table tr.third td { background: rgba(245,166,35,0.06); }
.bracket-group-card .bracket-table tr.eliminated td { opacity: 0.5; }

.bracket-third-section {
  background: var(--bg-card); border-radius: var(--radius-sm);
  padding: 12px; margin-top: 12px;
}
.bracket-third-section h4 { font-size: 14px; color: var(--accent); margin-bottom: 8px; }
.third-list { display: flex; flex-direction: column; gap: 4px; }
.third-item { padding: 6px 10px; font-size: 12px; border-radius: 4px; }
.third-item.qualified { background: rgba(46,204,113,0.1); color: var(--green-light); }
.third-item.eliminated { background: rgba(231,76,60,0.06); color: var(--text-dim); }

.bracket-tree-container { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 20px; }
.bracket-rounds { display: flex; gap: 12px; min-width: max-content; }
.bt-round { min-width: 140px; }
.bt-round h5 {
  text-align: center; font-size: 12px; color: var(--accent); font-weight: 700;
  margin-bottom: 8px; padding: 4px; background: var(--bg-card); border-radius: var(--radius-sm);
}
.bt-match {
  padding: 6px 8px; margin-bottom: 6px; background: var(--bg-card);
  border-radius: var(--radius-sm); font-size: 11px;
  border: 1px solid rgba(255,255,255,0.04); transition: var(--transition);
}
.bt-match.played { border-color: rgba(46,204,113,0.3); }
.bt-match.final { border-color: var(--gold); background: rgba(255,215,0,0.05); }
.bt-team { display: flex; align-items: center; gap: 4px; padding: 3px 0; color: var(--text-secondary); }
.bt-team.winner { color: var(--green-light); font-weight: 700; }
.bt-vs { text-align: center; font-size: 9px; color: var(--text-dim); padding: 1px 0; }

.bracket-input-section h4 { font-size: 15px; color: var(--text-secondary); margin: 16px 0 10px; }
.input-group-block {
  background: var(--bg-card); border-radius: var(--radius-sm);
  padding: 10px; margin-bottom: 10px;
}
.input-group-block h5 { font-size: 13px; color: var(--green-light); margin-bottom: 8px; }
.input-match-row {
  display: flex; align-items: center; gap: 4px; padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 12px; flex-wrap: nowrap;
}
.im-team { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.im-score {
  width: 36px; padding: 4px; text-align: center; background: var(--bg-secondary);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 4px; color: var(--text-primary);
  font-size: 13px; font-weight: 700; outline: none;
}
.im-score:focus { border-color: var(--green-light); }
.im-vs { font-size: 12px; color: var(--text-dim); font-weight: 700; }

@media (max-width: 374px) {
  .bracket-group-card { padding: 8px; }
  .bracket-group-card .bracket-table { font-size: 10px; }
  .bt-round { min-width: 120px; }
}
/* ===== Standings Table Styles (A-L groups) ===== */
.group-standings {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.group-standings-title {
  font-size: 14px;
  color: var(--green-light);
  margin-bottom: 8px;
  font-weight: 700;
}
.standings-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}
.standings-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 12px;
  transition: background 0.15s;
}
.standings-row:hover { background: rgba(255,255,255,0.03); }
.standings-row.advance-first { background: rgba(46,204,113,0.06); }
.standings-row.advance-first .col-pts { color: var(--green-light); font-weight: 700; }
.standings-row.advance-second { background: rgba(46,204,113,0.03); }
.standings-row.advance-third { background: rgba(245,166,35,0.05); }

.col-rank { width: 24px; text-align: center; font-weight: 700; color: var(--text-dim); flex-shrink: 0; }
.col-team { flex: 1; min-width: 0; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.col-team .flag-img { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; }
.col-num { width: 28px; text-align: center; flex-shrink: 0; color: var(--text-secondary); }
.col-pts { width: 32px; text-align: center; flex-shrink: 0; font-weight: 700; color: var(--accent-light); }

/* ===== Advancing Summary Tags ===== */
.advancing-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.advancing-block {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.advancing-block h4 {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}
.advance-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin: 2px 3px 2px 0;
  white-space: nowrap;
}
.advance-tag.first { background: rgba(46,204,113,0.12); color: var(--green-light); }
.advance-tag.second { background: rgba(52,152,219,0.12); color: #5dade2; }
.advance-tag.third { background: rgba(245,166,35,0.12); color: var(--accent); }

/* ===== Bracket Tree (FIFA-style knockout) ===== */
.bracket-round-col {
  min-width: 150px;
  flex-shrink: 0;
}
.bracket-round-title {
  text-align: center;
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
  padding: 5px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  letter-spacing: 1px;
}
.bracket-match {
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 11px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.2s;
}
.bracket-match:hover { border-color: rgba(255,255,255,0.12); transform: translateX(2px); }
.bracket-match-played { border-color: rgba(46,204,113,0.25); }
.match-teams { display: flex; flex-direction: column; gap: 4px; }
.bracket-team {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 0;
  color: var(--text-secondary);
  font-size: 12px;
}
.bracket-team.bracket-winner { color: var(--green-light); font-weight: 700; }
.bracket-flag { font-size: 14px; flex-shrink: 0; }
.bracket-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-score {
  margin-left: auto;
  font-weight: 800;
  font-size: 13px;
  min-width: 20px;
  text-align: right;
  color: var(--text-primary);
  flex-shrink: 0;
}
.bracket-extra {
  text-align: center;
  font-size: 9px;
  color: var(--yellow);
  margin-top: 2px;
}

/* Bracket simulate actions */
.bracket-sim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Input hint */
.input-hint {
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 10px;
  background: rgba(245,166,35,0.06);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Bracket share */
.bracket-share { margin-top: 16px; }

@media (max-width: 480px) {
  .col-rank { width: 20px; font-size: 11px; }
  .col-num { width: 22px; font-size: 10px; }
  .col-pts { width: 26px; font-size: 10px; }
  .col-team { font-size: 11px; }
  .bracket-round-col { min-width: 130px; }
  .bracket-match { padding: 6px 8px; }
  .bracket-name { max-width: 60px; }
}

/* ===== Best XI / Team XI ===== */
.xi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.xi-header h2 { margin: 0; }
.xi-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.xi-ctrl label { color: var(--text-dim); font-size: 13px; }
.xi-pitch {
  position: relative;
  width: 100%;
  height: 420px;
  background: linear-gradient(180deg, #1a472a 0%, #2d6a4f 30%, #2d6a4f 70%, #1a472a 100%);
  border-radius: 12px;
  border: 2px solid #40916c;
  overflow: hidden;
  margin-bottom: 12px;
}
.xi-pitch::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.2);
}
.xi-pitch::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
}
.xi-slot {
  position: absolute;
 transform: translate(-50%, -50%);
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s;
}
.xi-slot:hover { transform: translate(-50%, -50%) scale(1.1); }
.xi-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.xi-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.3);
  overflow: hidden;
}
.xi-avatar img { width: 100%; height: 100%; object-fit: contain; border: none; }
.xi-avatar:has(img) { border: none; background: transparent; }
.xi-ovr {
  font-size: 16px;
  font-weight: 800;
}
.xi-pname {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xi-team {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
}
.xi-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.xi-pos {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  font-weight: 700;
}
.xi-plus {
  font-size: 20px;
  color: rgba(255,255,255,0.4);
}
.xi-summary {
  margin-bottom: 12px;
}
.xi-stats-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--card-bg);
  border-radius: 8px;
  font-size: 14px;
}
.xi-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.xi-picker-content {
  max-width: 420px;
}
.xi-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}
.xi-candidate {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid var(--border);
}
.xi-candidate:hover { background: var(--card-hover, #3a3a4a); }
.xi-candidate:active { transform: scale(0.96); }
.xi-cand-ovr {
  font-size: 18px;
  font-weight: 800;
}
.xi-cand-name {
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}
.xi-cand-team {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

@media (max-width: 480px) {
  .xi-pitch { height: 360px; }
  .xi-avatar { width: 36px; height: 36px; }
  .xi-ovr { font-size: 13px; }
  .xi-pname { font-size: 10px; max-width: 60px; }
  .xi-picker-grid { grid-template-columns: repeat(2, 1fr); }
}
