/* ─── Games & Predictor Styles ──────────────────────────────── */

.games-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.games-hero {
  text-align: center;
  padding: 2rem 0;
}

.games-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.games-hero h1 .accent {
  color: var(--green);
}

.games-hero p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ── Tabs ── */
.games-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.games-tab {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.2s;
}

.games-tab:hover {
  border-color: var(--green-b);
  background: var(--card-h);
}

.games-tab.active {
  background: var(--green-g);
  border-color: var(--green);
  color: var(--green);
}

/* ── Panels ── */
.game-panel {
  display: none;
}

.game-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ── Info Cards ── */
.game-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.game-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.game-info-card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.discount-banner {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--green-g);
  border: 1px solid var(--green);
  color: var(--green);
  font-size: 0.9rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ── 🎯 Penalty Pitch ── */
.pitch-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  max-width: 500px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
}

.soccer-pitch {
  width: 100%;
  height: 320px;
  background: radial-gradient(circle, #184618 0%, #0d2a0d 100%);
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* Pitch Field Markings */
.soccer-pitch::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  border-bottom: 4px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(transparent 50%, rgba(255, 255, 255, 0.03) 50%);
  background-size: 100% 40px;
  pointer-events: none;
}

/* Goalpost */
.pitch-goal {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 80px;
  border: 4px solid #ffffff;
  border-top: none;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  overflow: hidden;
}

.net-grid {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 6px 6px;
  pointer-events: none;
}

.goalkeeper {
  position: absolute;
  bottom: 8px;
  left: calc(50% - 35px);
  width: 70px;
  height: 30px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.15s linear;
  user-select: none;
  pointer-events: none;
  z-index: 10;
}

/* Clicking targets in the goal */
.goal-targets {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 20;
}

.goal-target {
  position: relative;
  flex: 1;
  height: 100%;
  cursor: pointer;
  transition: all 0.25s ease;
}

.goal-target::after {
  content: '🎯';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.75);
  opacity: 0.35;
  transition: all 0.2s ease;
  font-size: 1.2rem;
  pointer-events: none;
}

.goal-target:hover::after {
  transform: translate(-50%, -50%) scale(1.15);
  opacity: 1;
  text-shadow: 0 0 10px var(--green);
}

.goal-target:hover {
  background: rgba(34, 197, 94, 0.15);
}

/* Ball */
.penalty-spot {
  position: absolute;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

.pitch-ball {
  position: absolute;
  bottom: 30px;
  left: calc(50% - 15px);
  width: 30px;
  height: 30px;
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  user-select: none;
  pointer-events: none;
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Scoreboard */
.scoreboard {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}

.scoreboard-metric {
  text-align: center;
}

.scoreboard-metric label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.scoreboard-metric .metric-value {
  font-size: 1.4rem;
  font-weight: 800;
}

.scoreboard-tracker {
  display: flex;
  gap: 0.4rem;
}

.tracker-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background 0.2s;
}

.tracker-dot.goal {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.tracker-dot.miss {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.pitch-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--white);
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 40;
}

/* ── 🏆 Match Predictor Grid ── */
.predictor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.predictor-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s, transform 0.2s;
}

.predictor-card:hover {
  border-color: var(--green-b);
}

.predictor-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.predictor-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.predictor-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.predictor-team-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.predictor-team-flag {
  font-size: 1.5rem;
}

.predictor-score-input {
  width: 50px;
  padding: 0.4rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--white);
  text-align: center;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 800;
}

.predictor-score-input:focus {
  border-color: var(--green);
  outline: none;
}

.predictor-score-input:disabled {
  opacity: 0.8;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.predictor-card-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.predictor-submit-btn {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  background: var(--green);
  color: #000;
  transition: all 0.2s;
}

.predictor-submit-btn:hover {
  background: var(--green-d);
}

.predictor-submit-btn:disabled {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: not-allowed;
}

.prediction-result-banner {
  text-align: center;
  padding: 0.4rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.prediction-result-banner.exact {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid var(--green-b);
}

.prediction-result-banner.outcome {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.prediction-result-banner.wrong {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── 👥 Logged Out State ── */
.login-prompt {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 500px;
  margin: 2rem auto;
}

.lock-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.login-prompt h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.login-prompt p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* ── 📊 Leaderboard Styling ── */
.leaderboard-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--card);
  border: 1px solid var(--border);
  margin: 0 auto;
}

.leaderboard-rank.rank-1 {
  background: #f59e0b;
  color: #000;
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.leaderboard-rank.rank-2 {
  background: #94a3b8;
  color: #000;
  border-color: #94a3b8;
}

.leaderboard-rank.rank-3 {
  background: #b45309;
  color: #fff;
  border-color: #b45309;
}

/* Highlight user in the leaderboard */
tr.current-user-row {
  background: var(--green-g);
  border-left: 3px solid var(--green);
}

tr.current-user-row td {
  color: var(--green);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .games-container {
    padding: 1rem;
  }
  
  .games-tabs {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .games-tab {
    flex: 1 1 calc(50% - 0.5rem);
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    text-align: center;
  }
  
  .pitch-container {
    padding: 1rem;
  }
  
  .soccer-pitch {
    height: 260px;
  }
  
  .pitch-ball {
    bottom: 25px;
  }
  
  .goalkeeper {
    width: 60px;
    height: 25px;
    font-size: 1.1rem;
  }
  
  .predictor-grid {
    grid-template-columns: 1fr;
  }
}

.predictor-search-wrapper div:focus-within {
  border-color: var(--green) !important;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.15);
}

/* ── 📊 Leaderboard Box-Style Table ── */
.table-wrapper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  margin-top: 1rem;
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table-wrapper th,
.table-wrapper td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.table-wrapper th {
  background: rgba(255, 255, 255, 0.02);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1.2px;
  color: var(--muted);
}

.table-wrapper tr:last-child td {
  border-bottom: none;
}

.table-wrapper tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

.table-wrapper code {
  background: var(--surface);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--green);
  border: 1px solid var(--border);
}


