/* Game details hero: icon on the left, name/version/stage/description stacked to
   its right, Play button on the far right. */
.game-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem; /* space under the hero, above the leaderboard */
}
.game-hero-main {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  min-width: 0;
}
.game-hero-icon {
  flex: none;
  width: 96px;
  height: 96px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.4rem;
  line-height: 1;
}
.game-hero-icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.game-hero-text {
  min-width: 0;
}
.game-hero-name {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}
/* Version + stage now sit BELOW the description; tight, no bottom margin. */
.game-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}
.game-hero-version {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}
.game-hero-stage {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.16rem 0.5rem;
  border-radius: 6px;
}
.game-hero-stage.alpha {
  color: #ffc196;
  background: rgba(255, 120, 40, 0.22);
  border: 1px solid rgba(255, 140, 60, 0.55);
}
.game-hero-stage.beta {
  color: #aebdff;
  background: rgba(90, 120, 255, 0.22);
  border: 1px solid rgba(110, 140, 255, 0.55);
}
.game-hero-desc {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
  margin: 0 0 0.3rem;
  max-width: 60ch;
}
.game-play {
  flex: none;
  display: inline-block;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.7rem 2rem;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: background 0.15s;
}
.game-play:hover {
  background: var(--accent-hover);
}
.game-play.disabled {
  background: var(--btn);
  color: var(--muted);
  cursor: default;
}
/* Play button + a live "N Playing" count centered beneath it. */
.game-play-wrap {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.game-playing {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* Stack the Play button under the hero on narrow screens. */
@media (max-width: 560px) {
  .game-hero {
    gap: 1.1rem;
  }
  .game-play-wrap {
    width: 100%;
  }
  .game-play {
    width: 100%;
    text-align: center;
  }
}

/* Trophies as a single horizontally-scrolling row of fixed-width cards. */
.trophy-row {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.trophy-row .trophy {
  flex: 0 0 min(280px, 80vw);
  scroll-snap-align: start;
}
.trophy-row .trophy-empty {
  padding: 1rem 0.2rem;
}

/* Player (username) column in the global "Every score" table. */
.score-table td.score-player a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}
.score-table td.score-player a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.section-title {
  font-size: 1.25rem;
  margin: 2rem 0 1rem;
}
.btn-primary {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 9px;
  margin-top: 1rem;
  text-decoration: none;
  display: inline-block;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

/* Panels, the scale select, and trophy cards are shared with the profile;
   their styles live in /styles.css. */

/* ---- leaderboard ---- */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.lb-table th,
.lb-table td {
  text-align: left;
  padding: 0.6rem 0.6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.lb-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lb-table tbody tr:last-child td {
  border-bottom: none;
}
.lb-rank,
.lb-table th.num,
.lb-table td.num {
  text-align: right;
}
.lb-table td.num {
  font-family: "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}
.lb-rank {
  width: 3.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.lb-medal {
  font-size: 1.25rem;
}
.lb-pos {
  color: var(--muted);
  font-weight: 700;
}
.lb-player a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}
.lb-player a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.lb-you {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.lb-me td {
  background: rgba(108, 92, 231, 0.1);
}
.lb-gap td {
  text-align: center;
  color: var(--muted);
  padding: 0.2rem;
  border-bottom: none;
  letter-spacing: 0.2em;
}
.lb-empty {
  color: var(--muted);
  padding: 1.2rem 0.2rem;
}

/* ---- graphs ---- */
.graph-box {
  width: 100%;
}
.graph-svg {
  display: block;
  width: 100%;
  height: auto;
}
.graph-grid {
  stroke: var(--border);
  stroke-width: 1;
}
.graph-ylabel,
.graph-xlabel {
  fill: var(--muted);
  font-size: 11px;
  font-family: "Courier New", monospace;
}
.graph-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.graph-area {
  fill: rgba(108, 92, 231, 0.12);
  stroke: none;
}
.graph-dot {
  fill: var(--accent);
}
.graph-dot-max {
  fill: #ffd166;
  stroke: var(--panel);
  stroke-width: 1;
}
.graph-empty {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1rem;
}

/* ---- score table ---- */
.table-wrap {
  overflow-x: auto;
}
.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.score-table th,
.score-table td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.score-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.score-table td.num,
.score-table th.num {
  text-align: right;
  font-family: "Courier New", monospace;
}
.score-table tbody tr:hover {
  background: var(--btn);
}
.score-empty {
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem;
}

/* ---- pager ---- */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1rem;
}
.pager .page-info {
  color: var(--muted);
  font-size: 0.85rem;
}
.pager button {
  font: inherit;
  cursor: pointer;
  color: var(--fg);
  background: var(--btn);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
}
.pager button:hover:not(:disabled) {
  background: var(--btn-hover);
}
.pager button:disabled {
  opacity: 0.45;
  cursor: default;
}
