.game-page-content {
  max-width: 1120px;
  margin: 0 auto;
}

.game-page-body {
  max-width: none;
  background: transparent;
  border: 0;
  padding: 0;
}

.match-game,
.quiz-game {
  --match-card: minmax(64px, 1fr);
  display: grid;
  gap: 1.5rem;
}

.quiz-game {
  margin-top: 2rem;
}

.match-hero,
.quiz-hero {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-end;
  background: linear-gradient(135deg, rgba(30,46,38,.92), rgba(17,26,22,.92));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem;
}

.match-kicker {
  color: var(--jade);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .35rem;
}

.match-hero h2,
.quiz-hero h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.15;
  color: var(--ivory);
  margin: 0 0 .75rem;
}

.match-hero p,
.quiz-hero p {
  max-width: 640px;
  color: var(--text-dim);
  margin: 0;
}

.match-actions {
  display: inline-flex;
  gap: .35rem;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .3rem;
}

.match-pill {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  border-radius: 999px;
  padding: .48rem .85rem;
  font: 700 .82rem var(--font-sans);
  cursor: pointer;
}

.match-pill.active {
  background: var(--jade-dim);
  color: var(--ivory);
}

.match-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.match-panel,
.match-board-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.match-panel {
  padding: 1.25rem;
  display: grid;
  gap: 1.25rem;
}

.match-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: .6rem;
}

.match-stat,
.match-current {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .75rem;
}

.match-stat span,
.match-current span {
  display: block;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  margin-bottom: .25rem;
}

.match-stat strong,
.match-current strong {
  color: var(--ivory);
  font-size: 1.05rem;
}

.match-new {
  width: 100%;
}

.match-reference h3 {
  font-family: var(--font-serif);
  color: var(--ivory);
  font-size: 1.05rem;
  margin: 0 0 .75rem;
}

.match-reference-grid {
  display: grid;
  gap: .6rem;
}

.match-reference-tiles {
  grid-template-columns: 1fr;
}

.match-reference-set {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .6rem;
}

.match-reference-label {
  display: block;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 800;
  margin-bottom: .35rem;
}

.match-reference-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .32rem;
}

.match-reference-row span {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  min-height: 34px;
  border-radius: .35rem;
  border: 1px solid rgba(21,35,29,.15);
  background: #f5f0e8;
  color: #18231e;
  font-family: "Apple Symbols", "Noto Sans Symbols 2", serif;
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  line-height: 1;
  box-shadow: inset 0 -3px 0 rgba(26,140,102,.12);
}

.match-board-wrap {
  padding: 1.25rem;
  min-width: 0;
  overflow: hidden;
}

.match-board {
  display: grid;
  grid-template-columns: repeat(var(--match-cols, 4), var(--match-card));
  gap: .65rem;
  max-width: 100%;
}

.match-card {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 78px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  cursor: pointer;
  perspective: 800px;
}

.match-card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .28s var(--ease);
}

.match-card.is-open .match-card-inner,
.match-card.is-matched .match-card-inner {
  transform: rotateY(180deg);
}

.match-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.match-back {
  color: var(--jade);
  background:
    linear-gradient(135deg, rgba(45,212,160,.16), rgba(212,167,45,.08)),
    var(--surface);
  font-size: clamp(1.5rem, 5vw, 2.3rem);
}

.match-front {
  transform: rotateY(180deg);
  flex-direction: column;
  gap: .2rem;
  background: #f5f0e8;
  color: #1b241f;
  box-shadow: inset 0 -5px 0 rgba(26,140,102,.16);
}

.match-glyph {
  font-family: "Apple Symbols", "Noto Sans Symbols 2", serif;
  font-size: clamp(2rem, 7vw, 3.2rem);
  line-height: 1;
}

.match-name {
  max-width: 90%;
  color: #375044;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.match-card.is-matched .match-front {
  border-color: var(--jade);
  box-shadow: 0 0 0 2px rgba(45,212,160,.22), inset 0 -5px 0 rgba(26,140,102,.22);
}

.match-message {
  min-height: 1.6rem;
  margin-top: 1rem;
  color: var(--text-dim);
  text-align: center;
  font-weight: 600;
}

.match-learn {
  display: flex;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.match-learn a {
  color: var(--jade);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .55rem 1rem;
  font-weight: 700;
  text-decoration: none;
}

.match-learn a:hover {
  border-color: var(--jade);
  color: var(--ivory);
}

.quiz-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.quiz-panel,
.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.quiz-panel {
  padding: 1.25rem;
  display: grid;
  gap: 1.25rem;
}

.quiz-card {
  min-width: 0;
  padding: 1.5rem;
  text-align: center;
}

.quiz-prompt {
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 1rem;
}

.quiz-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(42vw, 190px);
  aspect-ratio: 3 / 4;
  margin: 0 auto 1.25rem;
  background: #f5f0e8;
  color: #1b241f;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: inset 0 -7px 0 rgba(26,140,102,.16);
  font-family: "Apple Symbols", "Noto Sans Symbols 2", serif;
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 1;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  max-width: 560px;
  margin: 0 auto;
}

.quiz-option {
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: 800 .95rem var(--font-sans);
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}

.quiz-option:hover {
  border-color: var(--jade);
  color: var(--ivory);
}

.quiz-option.is-correct {
  background: rgba(45,212,160,.2);
  border-color: var(--jade);
  color: var(--ivory);
}

.quiz-option.is-wrong {
  background: rgba(212,45,45,.16);
  border-color: rgba(212,45,45,.55);
  color: var(--ivory);
}

.games-hub {
  display: grid;
  gap: 1.5rem;
}

.games-hero,
.games-intent,
.game-link-card {
  background: linear-gradient(135deg, rgba(30,46,38,.92), rgba(17,26,22,.92));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

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

.games-hero h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.15;
  color: var(--ivory);
  margin: 0 0 .75rem;
}

.games-hero p {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text-dim);
}

.games-intent {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.games-intent h3 {
  font-family: var(--font-serif);
  color: var(--ivory);
  margin: 0 0 .6rem;
}

.games-intent p {
  color: var(--text-dim);
  margin: 0;
}

.games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.game-link-card {
  display: grid;
  gap: .55rem;
  min-height: 0;
  padding: 1.5rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color .25s var(--ease), transform .25s var(--ease), background .25s var(--ease);
}

.game-link-card:hover {
  border-color: var(--jade);
  background: var(--bg-card-h);
  color: var(--text);
  transform: translateY(-3px);
}

.game-card-icon {
  font-size: 2.4rem;
}

.game-card-kicker {
  color: var(--jade);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.game-link-card strong {
  font-family: var(--font-serif);
  color: var(--ivory);
  font-size: 1.35rem;
}

.game-link-card span {
  color: var(--text-dim);
}

.game-link-card em {
  align-self: end;
  color: var(--jade);
  font-style: normal;
  font-weight: 800;
}

.game-link-card,
.game-link-card:hover,
.game-link-card:focus {
  text-decoration: none;
}

.game-leaderboard {
  margin-top: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .85rem;
}

.game-leaderboard h3 {
  margin: 0 0 .6rem;
  color: var(--ivory);
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.game-rank-list {
  display: grid;
  gap: .4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-rank-list li {
  display: grid;
  grid-template-columns: 2.2rem minmax(0,1fr) auto;
  gap: .5rem;
  align-items: center;
  color: var(--text-dim);
  font-size: .82rem;
}

.game-rank-list strong {
  color: var(--ivory);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-rank-list .is-empty {
  grid-template-columns: 1fr;
  color: var(--text-muted);
}

@media(max-width: 900px) {
  .match-hero,
  .quiz-hero,
  .match-layout,
  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .match-hero,
  .quiz-hero {
    display: grid;
    align-items: start;
  }

  .match-layout {
    display: grid;
  }

  .quiz-layout {
    display: grid;
  }

  .match-panel,
  .quiz-panel {
    order: 2;
  }

  .match-board-wrap,
  .quiz-card {
    order: 1;
  }
}

@media(max-width: 560px) {
  .match-game,
  .quiz-game {
    --match-card: minmax(44px, 1fr);
  }

  .match-hero,
  .quiz-hero,
  .match-panel,
  .quiz-panel,
  .match-board-wrap,
  .quiz-card {
    padding: 1rem;
  }

  .match-actions {
    width: 100%;
  }

  .match-pill {
    flex: 1;
    padding: .45rem .4rem;
  }

  .match-board {
    gap: .45rem;
  }

  .match-card {
    min-height: 62px;
    border-radius: var(--r-sm);
  }

  .match-face {
    border-radius: var(--r-sm);
  }

  .match-reference-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quiz-options {
    grid-template-columns: 1fr;
  }

  .games-hero,
  .games-intent,
  .game-link-card {
    padding: 1rem;
  }

  .games-intent,
  .games-grid {
    grid-template-columns: 1fr;
  }
}
