/* Game pages use the same compact discovery rhythm as the catalog.  This file is
   loaded after style.css so the detail layout can be tuned without changing
   navigation, search, or category pages. */
.route-game .site-main main {
  padding-top: 24px;
  padding-bottom: 0;
}

.route-game .game-hero {
  max-width: 1733px;
  margin-inline: auto;
}

.route-game .game-layout {
  grid-template-columns: minmax(0, 1fr) clamp(250px, 18.5vw, 376px);
  gap: clamp(24px, 3.05vw, 62px);
  align-items: start;
}

.route-game .game-layout:has(>.game-ad-column:empty) {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1295px;
}

.route-game .gamebox {
  width: 100%;
  min-height: 0;
  margin: 0;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px 10px 0 0;
  background: #062b4d;
  box-shadow: 0 10px 24px #0b536344;
}

.route-game .gamebox.gamebox--active {
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

.route-game .gamebox[style*="9/16"]:not(.gamebox--active),
.route-game .gamebox.gamebox--active[style*="9/16"] {
  width: 100%;
  max-width: none;
  margin: 0;
  aspect-ratio: 16 / 9;
}

.route-game .game-primary:has(.gamebox[style*="9/16"]) .game-action-strip {
  max-width: none;
  margin: 0;
}

.route-game .gamebox--iframe[style*="4/3"] .game-frame,
.route-game .gamebox--iframe[style*="9/16"] .game-frame {
  inset: 0 auto 0 50%;
  width: auto;
  max-width: 100%;
  height: 100%;
  aspect-ratio: var(--game-ratio);
  transform: translateX(-50%);
}

.route-game .gamebox:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 0;
}

.route-game .gamebox:has(>.game-poster) {
  background: linear-gradient(105deg, #06435a, #11768c 50%, #06435a);
}

.route-game .game-poster {
  opacity: 1;
  object-fit: contain;
}

.route-game .game-poster[src="/tap-sequence-stage.webp"] {
  object-fit: cover;
}

.route-game .game-start {
  width: min(84%, 350px);
  max-width: 350px;
  padding: 21px 25px 20px;
  border: 1px solid #ffffff36;
  border-radius: 17px;
  background: #082f39d9;
  box-shadow: 0 12px 32px #032d3c40;
  backdrop-filter: blur(12px);
}

.route-game .game-start>span {
  color: #d5fff3;
  font-size: .73rem;
  letter-spacing: .12em;
}

.route-game .game-start p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  max-height: 4.65em;
  margin: 10px 0 15px;
  color: #fff;
  font-size: .91rem;
  line-height: 1.55;
}

.route-game .game-start [data-start] {
  min-height: 42px;
  padding: 8px 22px;
  border-radius: 999px;
  background: #fff;
  color: #0a6e70;
  font-size: .96rem;
  box-shadow: 0 4px 14px #002d3140;
}

.route-game .game-action-strip {
  min-height: 66px;
  padding: 7px 14px;
  border: 0;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 10px 24px #0b536333;
}

.route-game .game-action-thumb {
  flex-basis: 45px;
  width: 45px;
  height: 45px;
  border-radius: 7px;
}

.route-game .game-action-strip .game-topline strong {
  color: #0b3552;
  font-size: 1rem;
  font-weight: 850;
}

.route-game .game-action-strip .game-developer {
  color: #668095;
  font-size: .75rem;
}

.route-game .game-action-strip .game-action-buttons button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: #078cdd;
}

.route-game .game-action-strip .game-action-buttons button:hover,
.route-game .game-action-strip .game-action-buttons button:focus-visible {
  background: #e6f5ff;
}

.route-game .game-under-stage {
  gap: 12px;
  margin-top: 13px;
}

.route-game .game-under-stage:has(>.ad-slot) {
  grid-template-columns: max-content minmax(0, 1fr);
}

.route-game .game-under-stage:has(>.ad-slot):not(:has(>.game-mini-rail)) {
  grid-template-columns: minmax(0, 1fr);
}

.route-game .game-mini-rail {
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
}

.route-game .game-mini-rail a {
  flex-basis: clamp(82px, 6vw, 112px);
  width: clamp(82px, 6vw, 112px);
  height: clamp(82px, 6vw, 112px);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 6px 16px #075f6633;
}

.route-game .game-under-stage .ad-slot--game-below {
  width: 100%;
  height: clamp(82px, 6vw, 112px);
  min-height: 0;
  background: #c7fff3a8;
}

.route-game .game-ad-column {
  gap: 65px;
  padding-top: 26px;
}

.route-game .game-ad-column .ad-slot--game-side {
  width: 100%;
  height: clamp(210px, 16vw, 300px);
  min-height: 0;
  background: #c7fff3a8;
}

.route-game .game-ad-column .game-recommendations .cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: clamp(68px, 5.5vw, 108px);
  gap: 12px;
  overflow: visible;
  padding: 0;
  scroll-snap-type: none;
}

.route-game .game-ad-column .game-recommendations .card {
  flex: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 5px 15px #075f6633;
}

.route-game .game-ad-column .game-recommendations .card:nth-child(3n + 1) {
  grid-column: span 2;
  grid-row: span 2;
}

.route-game .game-lanes {
  margin: 21px 0 35px;
}

.route-game .game-lanes .cards {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}

.route-game .game-lanes .card {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  box-shadow: 0 5px 14px #075f662c;
}

.route-game .game-lanes .card strong {
  font-size: .75rem;
}

.route-game .game-category-strip {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 24px;
  padding-bottom: 76px;
}

.route-game .game-category-tile {
  min-height: 99px;
  padding: 7px 13px 7px 7px;
  border-radius: 15px;
}

.route-game .game-category-art {
  flex-basis: 84px;
  width: 84px;
  height: 84px;
  border-radius: 10px;
}

.route-game .game-category-tile strong {
  font-size: .84rem;
}

.route-game .game-detail-content {
  padding-top: 73px;
  padding-bottom: 76px;
}

.route-game .game-detail-content>section,
.route-game .game-detail-content>.attribution {
  max-width: 1050px;
}

.route-game .game-detail-content>.game-intro {
  grid-template-columns: 205px minmax(0, 1fr);
  column-gap: 48px;
  row-gap: 16px;
  padding-bottom: 62px;
}

.route-game .game-intro-cover {
  width: 205px;
  border-radius: 16px;
}

.route-game .game-intro-summary {
  max-width: 74ch;
  font-size: 1rem;
  line-height: 1.6;
}

.route-game .game-intro h1 {
  font-size: clamp(1.7rem, 2.5vw, 2.55rem);
}

.route-game .game-intro>.game-tags,
.route-game .game-intro>.game-intro-tags {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 4px 0 0;
}

.route-game .game-intro-copy .game-tags {
  gap: 7px;
  margin: 17px 0 0;
}

.route-game .game-intro .game-tags .pill,
.route-game .game-intro .game-intro-tags .pill {
  min-height: 27px;
  padding: 4px 10px;
  border: 1px solid #d8e9e6;
  background: #e9f9f4;
  color: #2f6672;
  font-size: .75rem;
  font-weight: 650;
}

.route-game .game-detail-content>.game-about {
  padding-bottom: 25px;
}

.route-game .game-about h2,
.route-game .game-specs h2 {
  font-size: 1.45rem;
}

.route-game .game-detail-content>.game-controls,
.route-game .game-detail-content>.game-information,
.route-game .game-meta-item,
.route-game .game-meta-item:nth-child(2n),
.route-game .game-meta-item:nth-child(3n),
.route-game .game-meta-item:nth-child(4n) {
  grid-template-columns: minmax(175px, 250px) minmax(0, 1fr);
  gap: 20px;
}

.route-game .game-meta-item,
.route-game .game-meta-item:nth-child(2n),
.route-game .game-meta-item:nth-child(3n),
.route-game .game-meta-item:nth-child(4n) {
  padding: 17px 8px;
}

.route-game .game-detail-content > .game-detail-related {
  padding: 37px 0 50px;
  border-bottom: 0;
}

.route-game .game-detail-related h2 {
  margin-bottom: 19px;
  font-size: 1.45rem;
}

.route-game .game-detail-related .cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.route-game .game-detail-related .card {
  aspect-ratio: 1;
  border-radius: 13px;
}

.route-game .game-detail-related .card::after {
  display: none;
}

.route-game .game-detail-related .card strong,
.route-game .game-detail-related .card small {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .route-game .game-layout {
    grid-template-columns: minmax(0, 1fr) 235px;
    gap: 22px;
  }

  .route-game .game-ad-column .game-recommendations .cards {
    grid-auto-rows: 68px;
    gap: 8px;
  }

  .route-game .game-detail-content>.game-intro {
    grid-template-columns: 190px minmax(0, 1fr);
    column-gap: 30px;
  }

  .route-game .game-intro-cover {
    width: 190px;
  }
}

@media (max-width: 900px) {
  .route-game .game-layout,
  .route-game .game-layout:has(>.game-ad-column:empty) {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .route-game .game-ad-column {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 0;
  }

  .route-game .game-ad-column .ad-slot--game-side {
    display: none;
  }

  .route-game .game-ad-column .game-recommendations .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 10px;
  }

  .route-game .game-ad-column .game-recommendations .card,
  .route-game .game-ad-column .game-recommendations .card:nth-child(3n + 1) {
    grid-column: auto;
    grid-row: auto;
    height: auto;
    aspect-ratio: 1;
  }

  .route-game .game-detail-content {
    padding-top: 52px;
  }
}

@media (max-width: 650px) {
  .route-game .site-main main {
    padding-top: 10px;
  }

  .route-game .gamebox {
    aspect-ratio: 16 / 9;
    border-radius: 9px 9px 0 0;
  }

  .route-game .gamebox.gamebox--active {
    min-height: 240px;
    aspect-ratio: 16 / 9;
  }

  .route-game .gamebox.gamebox--active.gamebox--local:not(:fullscreen) {
    height: auto;
    min-height: 350px;
    aspect-ratio: auto;
    padding: 20px;
  }

  .route-game .gamebox[style*="4/3"],
  .route-game .gamebox.gamebox--active[style*="4/3"] {
    aspect-ratio: 4 / 3;
  }

  .route-game .gamebox[style*="9/16"]:not(.gamebox--active),
  .route-game .gamebox.gamebox--active[style*="9/16"] {
    width: min(100%, 405px);
    margin-inline: auto;
    aspect-ratio: 9 / 16;
  }

  .route-game .game-primary:has(.gamebox[style*="9/16"]) .game-action-strip {
    max-width: 405px;
    margin-inline: auto;
  }

  .route-game .gamebox--iframe[style*="4/3"] .game-frame,
  .route-game .gamebox--iframe[style*="9/16"] .game-frame {
    inset: 0;
    width: 100%;
    height: 100%;
    transform: none;
  }

  .route-game .game-start {
    width: min(86%, 300px);
    padding: 16px 19px;
  }

  .route-game .game-start p {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    max-height: 3.2em;
    font-size: .83rem;
  }

  .route-game .game-under-stage:has(>.ad-slot) {
    grid-template-columns: minmax(0, 1fr);
  }

  .route-game .game-mini-rail a {
    flex-basis: 72px;
    width: 72px;
    height: 72px;
  }

  .route-game .game-under-stage .ad-slot--game-below {
    height: 76px;
  }

  .route-game .game-ad-column .game-recommendations .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .route-game .game-lanes .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .route-game .game-category-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding-bottom: 48px;
  }

  .route-game .game-category-tile {
    min-height: 73px;
    gap: 7px;
    padding: 5px 7px;
  }

  .route-game .game-category-art {
    flex-basis: 60px;
    width: 60px;
    height: 60px;
  }

  .route-game .game-detail-content {
    padding: 48px 20px 62px;
  }

  .route-game .game-detail-content>.game-intro {
    grid-template-columns: 92px minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 17px;
    padding-bottom: 42px;
  }

  .route-game .game-intro-cover {
    width: 92px;
    border-radius: 11px;
  }

  .route-game .game-intro h1 {
    font-size: 1.48rem;
  }

  .route-game .game-intro-summary {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: .94rem;
  }

  .route-game .game-intro>.game-tags,
  .route-game .game-intro>.game-intro-tags {
    grid-column: 1 / -1;
  }

  .route-game .game-detail-content>.game-controls,
  .route-game .game-detail-content>.game-information {
    display: block;
  }

  .route-game .game-meta-item,
  .route-game .game-meta-item:nth-child(2n),
  .route-game .game-meta-item:nth-child(3n),
  .route-game .game-meta-item:nth-child(4n) {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 0;
  }

  .route-game .game-detail-related .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .route-game .game-start,
  .route-game .game-ad-column .card,
  .route-game .game-lanes .card {
    animation: none;
    transition: none;
  }
}
