/* Scorecast 2026 - Main Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: 'Georgia', serif; background: var(--bg); color: var(--text); min-height: 100vh; }
body { background: linear-gradient(135deg, var(--bg) 0%, var(--bg2) 50%, var(--bg3) 100%); background-attachment: fixed; }

.gold-stripe { height: 3px; background: linear-gradient(90deg, #9a1736, #1b9ed3, #6682cc, #b07d52); }

/* Header */
header {
  background: var(--header-bg); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(27,158,211,0.2);
  padding: 12px 20px; display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 10px;
  position: sticky; top: 0; z-index: 100;
}
.header-eyebrow { font-size: 10px; letter-spacing: 3px; color: var(--gold); text-transform: uppercase; margin-bottom: 2px; }
.header-title { font-size: 18px; font-weight: bold; }
.header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-btn {
  padding: 8px 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.07); color: var(--text); font-size: 13px;
  font-family: 'Georgia', serif; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.nav-btn:hover { background: rgba(255,255,255,0.13); }
.nav-btn.active { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--bg); border-color: var(--gold); font-weight: bold; }

/* User chip */
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px; font-size: 13px;
}
.user-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(27,158,211,0.4); }
.user-avatar-placeholder {
  width: 26px; height: 26px; border-radius: 50%; background: rgba(27,158,211,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: bold; color: var(--gold); flex-shrink: 0;
}
.sign-out-btn { background: none; border: none; color: #777; font-size: 11px; cursor: pointer; font-family: 'Georgia', serif; text-decoration: underline; }
.sign-out-btn:hover { color: #bbb; }

/* Lock banner */
#lock-banner {
  display: none; background: rgba(231,76,60,0.12); border-bottom: 1px solid rgba(231,76,60,0.25);
  padding: 9px 20px; text-align: center; font-size: 13px; color: #e74c3c;
}
#lock-banner.show { display: block; }

/* Main */
main { max-width: 1060px; margin: 0 auto; padding: 28px 16px 60px; }
.view { display: none; }
.view.active { display: block; }

/* Sign-in screen */
.signin-wrap { max-width: 440px; margin: 40px auto; padding: 0 16px; text-align: center; }
.signin-card { background: var(--card-bg); border: 1px solid rgba(27,158,211,0.2); border-radius: 16px; padding: 36px 32px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px 24px; background: #fff; color: #333;
  border: none; border-radius: 8px; font-size: 15px; font-weight: bold;
  font-family: 'Georgia', serif; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3); transition: all 0.15s;
}
.google-btn:hover { background: #f5f5f5; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
.entry-badge { display: inline-block; padding: 6px 18px; margin-bottom: 24px; background: rgba(27,158,211,0.15); border: 1px solid rgba(27,158,211,0.4); border-radius: 20px; color: var(--gold); font-size: 13px; font-weight: bold; }
.auth-tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 20px; }
.auth-tab { flex: 1; padding: 10px; font-size: 13px; font-family: 'Georgia', serif; background: none; border: none; color: #666; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; }
.auth-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.auth-panel { display: none; text-align: left; }
.auth-panel.active { display: block; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: #444; font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08); }
.auth-input { width: 100%; padding: 12px 16px; margin-bottom: 10px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 8px; color: var(--text); font-size: 15px; font-family: 'Georgia', serif; transition: border-color 0.2s; display: block; }
.auth-input:focus { outline: none; border-color: rgba(27,158,211,0.6); }
.auth-input::placeholder { color: #555; }
.auth-label { font-size: 11px; color: #888; margin-bottom: 4px; display: block; letter-spacing: 0.5px; text-transform: uppercase; }
.auth-error { color: #e74c3c; font-size: 12px; margin-bottom: 10px; min-height: 16px; }
.auth-forgot { font-size: 12px; color: #555; text-align: right; margin-top: -6px; margin-bottom: 14px; }
.auth-forgot button { background: none; border: none; color: #888; font-family: 'Georgia', serif; font-size: 12px; cursor: pointer; text-decoration: underline; }
.auth-forgot button:hover { color: var(--gold); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.card-header { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }

/* Fixture rows */
.fixture-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.04); transition: background 0.1s;
}
.fixture-row:last-child { border-bottom: none; }
.fixture-row:hover { background: rgba(255,255,255,0.02); }
.fixture-date { font-size: 11px; color: var(--muted); width: 52px; flex-shrink: 0; }
.fixture-team { flex: 1; display: flex; align-items: center; gap: 7px; min-width: 80px; font-size: 13px; }
.fixture-team.right { justify-content: flex-end; text-align: right; }
.score-inputs { display: flex; align-items: center; gap: 5px; }
.score-input {
  width: 48px; text-align: center; padding: 8px 4px;
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 6px; color: var(--text); font-size: 20px; font-family: 'Georgia', serif;
  transition: border-color 0.2s, background 0.2s;
}
.score-input:focus { outline: none; border-color: rgba(27,158,211,0.7); background: rgba(27,158,211,0.1); }
.score-input::placeholder { color: #333; }
.score-input.admin-input { border-color: rgba(27,158,211,0.45); }
.score-input.locked { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.07); color: #888; pointer-events: none; cursor: default; }
.score-sep { color: #444; font-weight: bold; font-size: 16px; }
.pts-badge { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; flex-shrink: 0; }

/* Points badge animation */
.pts-badge.animate-in {
  animation: ptsPopIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
@keyframes ptsPopIn {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* Match status indicators */
.match-status {
  width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 10px; flex-shrink: 0;
}
.match-status.completed { background: rgba(46,204,113,0.2); color: #2ecc71; }
.match-status.live { background: rgba(46,204,113,0.3); color: #2ecc71; animation: livePulse 1.5s infinite; }
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(46,204,113,0); }
}

/* Matchday / group tabs */
.matchday-label { padding: 7px 18px; background: rgba(255,255,255,0.02); font-size: 10px; color: #444; letter-spacing: 2px; text-transform: uppercase; }
.group-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.group-tab { padding: 7px 12px; border-radius: 5px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.05); color: #bbb; font-size: 12px; font-weight: bold; font-family: 'Georgia', serif; cursor: pointer; transition: all 0.15s; }

/* Buttons */
.btn-primary {
  padding: 13px 32px; font-size: 15px; font-weight: bold;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--bg); border: none; border-radius: 8px; font-family: 'Georgia', serif;
  cursor: pointer; transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost { padding: 8px 16px; background: rgba(255,255,255,0.07); color: #aaa; border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; font-size: 13px; font-family: 'Georgia', serif; cursor: pointer; transition: all 0.15s; }
.btn-ghost:hover { background: rgba(255,255,255,0.12); color: #ddd; }

/* Progress bar */
.progress-track { height: 4px; width: 260px; max-width: 100%; background: rgba(255,255,255,0.08); border-radius: 2px; margin-top: 8px; }
.progress-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--gold), #2ecc71); transition: width 0.3s; }

/* Leaderboard */
.lb-row { border-radius: 10px; padding: 13px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; transition: transform 0.2s; }
.lb-row:hover { transform: translateX(2px); }
.lb-rank { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; }
.group-pts-chip { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: bold; }

/* Perfect score badge */
.perfect-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px;
  background: rgba(241,196,15,0.2); color: #f1c40f; border: 1px solid rgba(241,196,15,0.3);
  margin-left: 6px; font-weight: bold;
}

/* Position change indicators */
.pos-change { font-size: 11px; font-weight: bold; width: 30px; text-align: center; flex-shrink: 0; }
.pos-change.up { color: #2ecc71; }
.pos-change.down { color: #e74c3c; }
.pos-change.same { color: #555; }

/* Rules */
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 13px; margin-bottom: 28px; }
.rule-card { border-radius: 8px; padding: 15px; border-left: 4px solid; }
.info-box { background: rgba(27,158,211,0.08); border: 1px solid rgba(27,158,211,0.3); border-radius: 10px; padding: 20px; }
.result-score { padding: 5px 14px; border-radius: 6px; min-width: 70px; text-align: center; font-size: 17px; font-weight: bold; }

/* Admin */
.admin-code-input { flex: 1; padding: 11px 15px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 7px; color: var(--text); font-family: 'Georgia', serif; font-size: 15px; }
.admin-code-input:focus { outline: none; border-color: rgba(27,158,211,0.6); }

/* Toast */
#toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-6px);
  padding: 13px 26px; border-radius: 8px; font-weight: bold; font-size: 14px;
  font-family: 'Georgia', serif; z-index: 9999; box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Footer */
footer { border-top: 1px solid rgba(255,255,255,0.05); padding: 16px 20px; text-align: center; color: #333; font-size: 12px; }

/* Countdown timer */
.countdown-timer { font-size: 12px; text-align: center; padding: 6px 16px; color: var(--gold); letter-spacing: 0.5px; }

/* Live ticker */
.live-ticker {
  background: rgba(46,204,113,0.08); border-bottom: 1px solid rgba(46,204,113,0.2);
  padding: 6px 16px; overflow: hidden;
}
.ticker-inner { display: flex; align-items: center; gap: 10px; }
.ticker-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; animation: livePulse 1.5s infinite; flex-shrink: 0; }
.ticker-label { font-size: 10px; font-weight: bold; color: #2ecc71; letter-spacing: 1px; flex-shrink: 0; }
.ticker-scroll { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; font-size: 13px; color: #ccc; }
.ticker-scroll::-webkit-scrollbar { display: none; }
.ticker-match { white-space: nowrap; }
.ticker-minute { color: #2ecc71; font-size: 11px; }
.ticker-sep { color: #333; }

/* Player profile / digest modal */
.profile-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7); display: flex; align-items: center;
  justify-content: center; z-index: 5000; padding: 20px;
}
.profile-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  max-width: 600px; width: 100%; max-height: 80vh; overflow-y: auto;
}
.profile-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.profile-header h2 { color: var(--gold); font-size: 18px; }
.profile-close { background: none; border: none; color: #555; font-size: 20px; cursor: pointer; font-family: Georgia; }
.profile-close:hover { color: #aaa; }
.profile-stats {
  display: flex; gap: 12px; flex-wrap: wrap; padding: 16px 20px;
  justify-content: center; border-bottom: 1px solid var(--border);
}
.stat-box { text-align: center; min-width: 70px; }
.stat-value { font-size: 22px; font-weight: bold; color: var(--gold); }
.stat-label { font-size: 10px; color: #555; text-transform: uppercase; letter-spacing: 0.5px; }
.profile-groups { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.profile-predictions { padding: 16px 20px; }

/* Stats mini cards */
.stat-mini { text-align: center; min-width: 80px; padding: 12px; background: rgba(255,255,255,0.03); border-radius: 8px; border: 1px solid var(--border); }
.stat-mini-val { font-size: 24px; font-weight: bold; color: var(--gold); }
.stat-mini-lbl { font-size: 10px; color: #555; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* Skeleton loading */
.skeleton {
  position: relative; overflow: hidden;
  background: rgba(255,255,255,0.04); border-radius: 8px;
}
.skeleton::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Pull to refresh */
.ptr-indicator {
  text-align: center; font-size: 12px; color: #555; overflow: hidden;
  height: 0; opacity: 0; transition: height 0.2s, opacity 0.2s;
  display: flex; align-items: center; justify-content: center;
}

/* Theme toggle button */
.theme-btn { font-size: 16px !important; line-height: 1; }

/* Mobile */
@media (max-width: 600px) {
  header { padding: 10px 12px; gap: 8px; }
  .header-eyebrow { display: none; }
  .header-title { font-size: 15px; }
  .header-right { width: 100%; justify-content: space-between; }
  nav { flex: 1; justify-content: space-between; }
  .nav-btn { flex: 1; padding: 8px 4px; font-size: 11px; text-align: center; }
  .user-chip { font-size: 12px; padding: 5px 10px; }
  main { padding: 16px 12px 80px; }
  .fixture-row { padding: 11px 12px; gap: 6px; }
  .fixture-date { width: 38px; font-size: 10px; }
  .fixture-team { font-size: 12px; gap: 4px; min-width: 60px; }
  .score-input { width: 46px; height: 46px; font-size: 20px; padding: 4px; border-radius: 8px; }
  .group-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; }
  .group-tabs::-webkit-scrollbar { display: none; }
  .group-tab { flex-shrink: 0; padding: 8px 11px; min-height: 36px; }
  .btn-primary { font-size: 15px; padding: 14px 24px; }
  .lb-row { padding: 11px 12px; gap: 10px; }
  .lb-rank { width: 30px; height: 30px; font-size: 13px !important; }
  .group-pts-chip-wrap { display: none; }
  .rules-grid { grid-template-columns: 1fr; }
  .progress-track { width: 100%; }
  .result-score { min-width: 58px; font-size: 15px; padding: 5px 8px; }
  #toast { width: calc(100% - 32px); text-align: center; }
  .signin-card { padding: 28px 20px; }
  .profile-card { max-height: 90vh; }
  .stat-mini { min-width: 65px; padding: 8px; }
  .stat-mini-val { font-size: 18px; }
}
@media (max-width: 600px) {
  input[type="text"], input[type="password"] { font-size: 16px !important; }
}
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  main { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  footer { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
