.games-page {
  --game-sea: #0f7187;
  --game-coral: #c65337;
  min-width: 320px;
  padding-bottom: 0;
}

.game-main {
  width: min(calc(100% - 40px), 1080px);
  margin-inline: auto;
}

.game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.72fr);
  gap: 26px;
  align-items: end;
  margin-top: 18px;
  padding: clamp(36px, 6vw, 70px);
  overflow: hidden;
  border-radius: 34px;
  color: #fff;
  background:
    radial-gradient(circle at 87% 18%, rgba(230, 174, 69, 0.28), transparent 24%),
    radial-gradient(circle at 9% 95%, rgba(219, 93, 62, 0.23), transparent 30%),
    linear-gradient(135deg, #146f83, #12384a 62%, #082936);
  box-shadow: var(--shadow-md);
}

.game-kicker,
.game-number {
  margin: 0;
  color: var(--game-coral);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.game-kicker {
  color: #ffd77e;
}

.game-hero h1 {
  margin: 8px 0 14px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.game-hero > div > p:not(.game-kicker) {
  max-width: 660px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
}

.game-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.game-hero-chips span {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 800;
}

.game-privacy-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.09);
}

.game-privacy-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 14px;
  font-weight: 900;
}

.game-privacy-card strong {
  font-size: 15px;
}

.game-privacy-card p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
}

.passenger-note {
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(198, 83, 55, 0.2);
  border-radius: 14px;
  color: #6b412e;
  background: #fff2dc;
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}

.game-tabs {
  position: sticky;
  top: 78px;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 10px 28px rgba(18, 56, 74, 0.1);
  backdrop-filter: blur(14px);
}

.game-tabs a {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 15px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.game-tabs a + a {
  border-left: 1px solid var(--line);
}

.game-tabs a:hover,
.game-tabs a:focus-visible {
  color: #8a321f;
  background: #ffe9df;
}

.game-app-status {
  margin: 24px 0 0;
  padding: 14px 18px;
  border: 1px solid #d9907d;
  border-radius: 14px;
  color: #7e2e20;
  background: #fff0ea;
  font-weight: 800;
}

.game-section {
  scroll-margin-top: 150px;
  margin-top: 28px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: var(--shadow-md);
}

.game-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.game-section-heading h2,
.game-return h2 {
  margin: 5px 0 6px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.game-section-heading > div > p:last-child,
.game-return > div > p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.destination-picker {
  display: grid;
  min-width: 190px;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.destination-picker select {
  min-height: 50px;
  padding: 9px 36px 9px 13px;
  border: 1px solid #a9c0c7;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
}

.destination-picker select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.game-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.game-result {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 750;
}

.game-result.is-complete {
  color: #8a321f;
  font-size: 18px;
}

.bingo-board {
  display: grid;
  gap: 10px;
}

.bingo-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.bingo-cell {
  position: relative;
  display: grid;
  min-height: 120px;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 14px;
  border: 2px solid rgba(15, 113, 135, 0.18);
  border-radius: 18px;
  color: var(--ink);
  background: #f2faf8;
  cursor: pointer;
  text-align: center;
}

.bingo-cell:hover,
.bingo-cell:focus-visible {
  border-color: var(--game-sea);
  background: #e5f4f1;
}

.bingo-cell[aria-pressed="true"] {
  color: #fff;
  border-color: var(--sea-dark);
  background: linear-gradient(145deg, var(--game-sea), var(--sea-dark));
  box-shadow: 0 10px 22px rgba(16, 62, 77, 0.18);
}

.bingo-cell[aria-pressed="true"]::after {
  position: absolute;
  top: 7px;
  right: 9px;
  content: "✓";
  font-size: 18px;
  font-weight: 900;
}

.bingo-emoji {
  font-size: 28px;
}

.bingo-label {
  font-size: 14px;
  font-weight: 900;
}

.game-progress {
  min-width: 66px;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--sea-dark);
  background: #e7f2ef;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.quiz-stage {
  padding: clamp(20px, 4vw, 34px);
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(145deg, #155e70, var(--sea-dark));
}

.quiz-stage h3 {
  margin: 0 0 20px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(22px, 3.5vw, 31px);
  line-height: 1.45;
}

.quiz-choices {
  display: grid;
  gap: 9px;
}

.quiz-choice {
  min-height: 54px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  cursor: pointer;
  font-weight: 750;
  text-align: left;
}

.quiz-choice:hover,
.quiz-choice:focus-visible {
  background: rgba(255, 255, 255, 0.17);
}

.quiz-choice.is-correct {
  color: #123c31;
  border-color: #b9ebcc;
  background: #c9f3d8;
}

.quiz-choice.is-wrong {
  color: #7b2e20;
  border-color: #ffc2b5;
  background: #ffe0d7;
}

.quiz-choice:disabled {
  cursor: default;
}

.quiz-feedback {
  margin-top: 15px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.quiz-feedback strong,
.quiz-feedback span {
  display: block;
}

.quiz-feedback strong {
  margin-bottom: 4px;
  color: #ffd985;
  font-size: 17px;
}

.quiz-feedback a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 7px;
  color: #ffe4a7;
  font-weight: 850;
}

.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

#quiz-score {
  font-weight: 850;
}

.button-game {
  color: var(--sea-dark);
  background: #fff;
}

.reversi-dashboard {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(150px, 1.25fr) minmax(100px, 1fr);
  gap: 10px;
  align-items: center;
  width: min(100%, 560px);
  margin: 0 auto 14px;
}

.game-score-card {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 13px;
}

.game-score-card strong {
  font-size: 19px;
}

.game-disc {
  display: block;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  box-shadow: 0 3px 7px rgba(5, 25, 32, 0.28);
}

.disc-sea {
  background: linear-gradient(145deg, #31a7bd, #0d5a6b);
}

.disc-momiji {
  background: linear-gradient(145deg, #ef805f, #9f3925);
}

.reversi-status {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.reversi-board {
  display: grid;
  width: min(100%, 480px);
  grid-template-rows: repeat(6, minmax(44px, 1fr));
  gap: 3px;
  margin-inline: auto;
  padding: 8px;
  border: 4px solid #0b3b47;
  border-radius: 18px;
  background: #0b3b47;
  box-shadow: 0 18px 38px rgba(9, 35, 44, 0.2);
}

.reversi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
}

.reversi-cell {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 44px;
  aspect-ratio: 1;
  place-items: center;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: #2b7c6a;
  cursor: default;
}

.reversi-cell.is-valid {
  cursor: pointer;
}

.reversi-cell.is-valid::after {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  content: "";
}

.reversi-cell.is-valid:hover,
.reversi-cell.is-valid:focus-visible {
  background: #38937e;
}

.reversi-cell .game-disc {
  width: min(78%, 50px);
  height: auto;
  aspect-ratio: 1;
}

.reversi-help {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
}

.game-return {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 28px 0 0;
  padding: 30px;
  border-radius: 24px;
  color: #fff;
  background: var(--sea-dark);
}

.game-return .game-number,
.game-return > div > p:last-child {
  color: rgba(255, 255, 255, 0.68);
}

.game-return nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.game-return a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.game-return a:hover,
.game-return a:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.game-public-footer {
  padding-bottom: 38px;
}

@media (max-width: 980px) {
  .games-page {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .game-tabs {
    top: calc(72px + env(safe-area-inset-top));
  }

  .game-public-footer {
    padding-bottom: 38px;
  }
}

@media (max-width: 760px) {
  .game-main {
    width: auto;
    margin-right: max(12px, env(safe-area-inset-right));
    margin-left: max(12px, env(safe-area-inset-left));
  }

  .game-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 32px 22px;
    border-radius: 24px;
  }

  .game-hero h1 {
    font-size: clamp(36px, 11vw, 49px);
  }

  .game-hero > div > p:not(.game-kicker) {
    font-size: 16px;
  }

  .game-tabs {
    top: calc(66px + env(safe-area-inset-top));
  }

  .game-tabs a {
    padding-inline: 8px;
    font-size: 12px;
  }

  .game-section {
    scroll-margin-top: 138px;
    padding: 22px 18px;
    border-radius: 22px;
  }

  .game-section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
  }

  .destination-picker {
    min-width: 0;
  }

  .destination-picker select,
  .game-section-heading > .button {
    width: 100%;
  }

  .bingo-cell {
    min-height: 102px;
    padding: 10px 7px;
  }

  .bingo-label {
    font-size: 13px;
  }

  .game-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .game-actions .button {
    width: 100%;
  }

  .reversi-dashboard {
    grid-template-columns: 1fr 1fr;
  }

  .reversi-status {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .score-card-sea {
    grid-column: 1;
  }

  .score-card-momiji {
    grid-column: 2;
  }

  .game-return {
    align-items: stretch;
    flex-direction: column;
    padding: 24px 20px;
  }

  .game-return nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .game-return a {
    justify-content: center;
    border-radius: 13px;
  }
}

@media (max-width: 420px) {
  .game-main {
    margin-right: max(9px, env(safe-area-inset-right));
    margin-left: max(9px, env(safe-area-inset-left));
  }

  .game-hero {
    padding: 28px 18px;
  }

  .game-privacy-card {
    padding: 16px;
  }

  .game-section {
    padding: 20px 12px;
  }

  .game-section-heading h2 {
    font-size: 28px;
  }

  .bingo-board {
    gap: 6px;
  }

  .bingo-row {
    gap: 6px;
  }

  .bingo-cell {
    min-height: 96px;
  }

  .bingo-emoji {
    font-size: 25px;
  }

  .bingo-label {
    font-size: 12px;
  }

  .reversi-board {
    gap: 1px;
    padding: 4px;
    border-width: 3px;
    border-radius: 13px;
  }

  .reversi-row {
    gap: 1px;
  }

  .reversi-cell {
    min-height: 44px;
    border-radius: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .games-page .site-header,
  .game-tabs,
  .game-mobile-nav,
  .game-actions,
  .game-section-heading > .button {
    display: none !important;
  }

  .games-page {
    background: #fff;
  }

  .game-section {
    break-inside: avoid;
    box-shadow: none;
  }
}
