* { box-sizing: border-box; }
.game-page { min-height: 100dvh; overflow: hidden; }
.game-page .brand { color: var(--ink); text-decoration: none; }
.game-main { height: calc(100dvh - 55px); display: flex; flex-direction: column; }
.game-hero { flex: 0 0 clamp(76px, 15dvh, 120px); min-height: 0; padding: 0; background-position: center 42%; }
.game-hero .title { margin: 0; font-size: clamp(1.75rem, 9vw, 2.7rem); text-shadow: 0 1px 12px rgba(255,255,255,.9); }
.game {
  flex: 1; min-height: 0; width: min(100%, 480px); margin: 0 auto;
  padding: clamp(8px, 1.6dvh, 14px) 14px max(8px, env(safe-area-inset-bottom));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto minmax(16px, auto); gap: clamp(5px, 1dvh, 10px);
}
.game-instruction { margin: 0; text-align: center; font-weight: 700; font-size: clamp(.82rem, 3.8vw, 1rem); }
.carousel-row { min-height: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; align-items: center; gap: 8px; }
.carousel-arrow { width: 38px; height: 52px; border: 0; border-radius: 999px; background: white; color: var(--primary); box-shadow: var(--shadow); font-size: 2rem; line-height: 1; cursor: pointer; }
.game-slide { height: 100%; min-height: 0; margin: 0; position: relative; border-radius: 16px; overflow: hidden; background: #eee; box-shadow: var(--shadow); }
.game-slide img { width: 100%; height: 100%; display: block; object-fit: cover; }
.game-slide figcaption { position: absolute; left: 8px; bottom: 8px; padding: 5px 10px; border-radius: 999px; background: rgba(31,41,55,.76); color: white; font-size: .76rem; font-weight: 800; backdrop-filter: blur(5px); }
.game-slide figcaption.is-assigned { background: rgba(230,106,165,.92); }
.carousel-meta { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.carousel-dots { display: flex; gap: 6px; }
.carousel-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: #d1d5db; }
.carousel-dots button.complete { background: #f5b7d4; }
.carousel-dots button.active { background: var(--primary); outline: 2px solid var(--ring); outline-offset: 2px; }
.city-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.city-grid button { min-height: 36px; padding: 7px 4px; border: 1px solid rgba(230,106,165,.35); border-radius: 10px; background: rgba(255,255,255,.94); color: var(--ink); font: inherit; font-size: clamp(.72rem, 3.3vw, .9rem); font-weight: 750; }
.city-grid button.used { opacity: .42; }
.city-grid button.selected { opacity: 1; border-color: var(--primary); background: #fff0f6; color: #b52f70; box-shadow: 0 0 0 2px var(--ring); }
.check-button { min-height: 38px; border: 0; border-radius: 999px; background: var(--primary); color: white; font: inherit; font-size: .86rem; font-weight: 800; }
.check-button:disabled { background: #d1d5db; color: #6b7280; }
.game-message { min-height: 16px; margin: 0; text-align: center; font-size: .76rem; font-weight: 750; }
.game-message.success { color: #15803d; } .game-message.error { color: #b91c1c; } .game-message.pending { color: #9d3768; }
.success-state { display: none; }
.game.is-complete { display: flex; align-items: center; justify-content: center; }
.game.is-complete > :not(.success-state) { display: none; }
.game.is-complete .success-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; width: 100%; text-align: center; padding: 24px 16px;
}
.success-check {
  display: grid; place-items: center; width: clamp(104px, 34vw, 144px); aspect-ratio: 1;
  border: 8px solid #22a447; border-radius: 50%; color: #22a447;
  font-size: clamp(4rem, 20vw, 6rem); font-weight: 800; line-height: 1;
  box-shadow: 0 10px 28px rgba(34,164,71,.2); background: rgba(255,255,255,.82);
}
.success-state p { max-width: 360px; margin: 0; color: var(--ink); font-size: clamp(1rem, 4.5vw, 1.2rem); font-weight: 750; line-height: 1.45; }
.orientation-message { display: none; }

@media (min-width: 601px), (orientation: landscape) {
  .game-page { overflow: auto; }
  .game-page .game-nav, .game-page .game-hero, .game-page .game { display: none; }
  .game-main { min-height: 100dvh; height: auto; align-items: center; justify-content: center; padding: 24px; }
  .orientation-message { display: block; max-width: 440px; padding: 32px; text-align: center; background: rgba(255,255,255,.94); border-radius: 20px; box-shadow: var(--shadow); }
  .orientation-message div { font-size: 3rem; } .orientation-message h1 { margin: 10px 0; }
  .orientation-message p { color: var(--muted); } .orientation-message a { color: var(--primary); font-weight: 800; }
}
@media (max-height: 650px) and (max-width: 600px) and (orientation: portrait) {
  .game-hero { flex-basis: 65px; } .game { gap: 4px; padding-top: 5px; }
  .carousel-row { grid-template-columns: 34px minmax(0, 1fr) 34px; } .carousel-arrow { width: 34px; height: 44px; }
  .city-grid button { min-height: 31px; padding: 4px 3px; } .check-button { min-height: 33px; }
}
