@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Roboto:wght@300;400;700&display=swap');

:root {
  --gold: #CFB991;
  --black: #101010;
  --dark: #1a1a1a;
  --gray: #2a2a2a;
  --white: #FFFFFF;
  --gold-dim: #a89768;
}

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

body {
  font-family: 'Roboto', sans-serif;
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  width: 100%;
  background: linear-gradient(180deg, var(--dark) 0%, var(--black) 100%);
  border-bottom: 4px solid var(--gold);
  padding: 1.5rem 2rem;
  text-align: center;
}

header h1 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
}

header h1 span {
  color: var(--white);
}

.container {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  padding: 2rem;
  gap: 1.5rem;
  width: 100%;
  max-width: 1100px;
}

.card {
  background: var(--dark);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 2.5rem 3rem;
  text-align: center;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 0 40px rgba(207, 185, 145, 0.08);
}

.player-name {
  font-family: 'Oswald', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.player-info {
  font-size: 0.95rem;
  color: var(--gold-dim);
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

.stat-label {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: 'Oswald', sans-serif;
  font-size: 6rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.25rem;
  transition: opacity 0.3s;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.15em;
}

.stat-value .divider {
  font-size: 3rem;
  color: #555;
  font-weight: 400;
}

.stat-value .record {
  font-size: 2.8rem;
  color: #888;
  font-weight: 400;
}

.stat-value.loading {
  opacity: 0.3;
}

.record-holder {
  font-size: 0.75rem;
  color: #666;
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-top: 0.6rem;
}

.breakdown {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.75rem;
}

.breakdown span {
  color: #bbb;
}

.status-bar {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #666;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  animation: pulse-anim 2s infinite;
}

.pulse.error {
  background: #f44336;
  animation: none;
}

@keyframes pulse-anim {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.progress-bar {
  width: 100%;
  height: 18px;
  background: var(--gray);
  border-radius: 4px;
  margin-top: 1rem;
  overflow: hidden;
  position: relative;
  /* Railroad ties across the full bar */
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 8px,
    #5a4e3c 8px,
    #5a4e3c 12px
  );
  background-color: #2a2218;
}

/* Two steel rails running horizontally */
.progress-bar::before,
.progress-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: #888;
  border-radius: 1px;
  z-index: 1;
}
.progress-bar::before { top: 3px; }
.progress-bar::after  { bottom: 3px; }

.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  width: 0%;
  transition: width 1s linear;
  position: relative;
  z-index: 2;
  /* Freshly laid golden tracks */
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 8px,
    #b8a26e 8px,
    #b8a26e 12px
  );
  background-color: #CFB991;
}

/* Train engine leading the fill */
.progress-bar .fill::after {
  content: "🚂";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) scaleX(-1);
  font-size: 14px;
  line-height: 1;
  z-index: 3;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.6));
}

.error-msg {
  color: #f44336;
  font-size: 0.85rem;
  margin-top: 1rem;
  display: none;
}

.global-status {
  width: 100%;
  max-width: 1100px;
  padding: 0 2rem 1rem;
}

footer {
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: #555;
  letter-spacing: 0.05em;
  width: 100%;
  border-top: 1px solid #222;
}

footer a {
  color: var(--gold-dim);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--gold);
}

.footer-boiler {
  font-family: 'Oswald', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.footer-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gray);
  color: var(--gold-dim);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.footer-socials a:hover {
  background: var(--gold);
  color: var(--black);
  transform: scale(1.1);
}

.footer-handle {
  font-size: 0.85rem;
  color: #888;
  letter-spacing: 0.03em;
}

.footer-data {
  color: #444;
}

/* ── Next Game card ── */
.game-card { display: flex; flex-direction: column; }

.game-card .card-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 1.4rem;
}

.matchup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.matchup-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 90px;
}

.matchup-team img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--gray);
  padding: 4px;
}

.matchup-team .team-name {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white);
  line-height: 1.15;
}

.matchup-team .team-rank {
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  color: var(--gold);
}

.matchup-team .team-record {
  font-size: 0.75rem;
  color: #888;
}

.matchup-vs {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.game-details {
  text-align: left;
  font-size: 0.85rem;
  color: #aaa;
  line-height: 1.8;
}

.game-details .detail-row {
  display: flex;
  gap: 0.5rem;
}

.game-details .detail-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-dim);
  min-width: 70px;
  flex-shrink: 0;
}

.game-details .detail-value {
  color: #ccc;
}

.game-details .detail-value.live {
  color: #f44336;
  font-weight: 700;
}

.game-note {
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(207, 185, 145, 0.08);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-align: left;
}

.game-loading, .game-error {
  color: #666;
  font-size: 0.85rem;
  padding: 2rem 0;
}

.game-error { color: #f44336; }

/* ── Live Scoreboard ── */
.scoreboard {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--gray);
  border-radius: 8px;
}

.score-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--dark);
  padding: 3px;
}

.score-team-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.score-team-name {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white);
}

.score-team-record {
  font-size: 0.7rem;
  color: #888;
}

.score-value {
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #888;
  min-width: 60px;
  text-align: right;
  letter-spacing: 0.02em;
}

.score-value.winning {
  color: var(--gold);
}

.live-status {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  color: #f44336;
  text-align: center;
  letter-spacing: 0.05em;
  padding: 0.4rem 0;
}

.final-status {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  color: #888;
  text-align: center;
  letter-spacing: 0.05em;
  padding: 0.4rem 0;
}

.result-badge {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.result-badge.win {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.result-badge.loss {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

@media (max-width: 480px) {
  .card { padding: 2rem 1.5rem; }
  .player-name { font-size: 1.8rem; }
  .stat-value { font-size: 4.5rem; }
  .stat-value .divider { font-size: 2rem; }
  .stat-value .record { font-size: 1.8rem; }
  .matchup-team img { width: 44px; height: 44px; }
}

/* ── Notification Bell ── */
header {
  position: relative;
}

.notify-btn {
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1.5px solid var(--gold-dim);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-dim);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.notify-btn:hover {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
  transform: translateY(-50%) scale(1.1);
}

.notify-btn.subscribed {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

/* ── Share Button ── */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
  padding: 0.5rem 1.2rem;
  background: none;
  border: 1.5px solid var(--gold-dim);
  border-radius: 8px;
  color: var(--gold-dim);
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.share-btn:hover {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
  transform: scale(1.05);
}

.share-btn:active {
  transform: scale(0.97);
}

.share-btn svg {
  flex-shrink: 0;
}
