/* Scoped overrides: the rest of main.css and the game stay untouched. */
.game-description {
  --legend-height: min(860px, calc(100dvh - 120px));
  --legend-top: 8px;
  box-sizing: border-box; width: min(1300px, calc(100vw - 40px)); max-width: 100%;
  min-width: 0; margin-inline: auto; padding: 32px 8px; gap: 24px;
  overflow: visible; scroll-margin-top: var(--legend-top);
}
.game-description .icon-row {
  display: grid; grid-template-columns: repeat(5, minmax(100px, 150px));
  justify-content: center;
  width: 100%; max-width: 100%; margin-inline: auto;
  gap: 60px; padding: 0;
  box-sizing: border-box;
}
.game-description .icon-cell {
  min-width: 0; width: 150px; max-width: 100%; height: 200px;
  cursor: pointer; box-sizing: border-box;
}
.game-description .icon-title { overflow-wrap: anywhere; font-size: 26px; text-align: center; }
.game-description .slide.full-panel {
  display: none !important; position: relative !important; inset: auto !important;
  width: 100% !important; max-width: none !important; min-width: 0 !important;
  height: var(--legend-height) !important; min-height: 0 !important;
  max-height: none !important; padding: 0 !important; margin: 0 !important;
  box-sizing: border-box; overflow: hidden; transform: none !important;
  scroll-margin-top: var(--legend-top);
}
.game-description .slide.full-panel.active { display: block !important; }
.game-description .slide.full-panel .media {
  position: relative !important; inset: auto !important;
  display: block !important; width: 100% !important; height: 100% !important;
  min-width: 0 !important; max-width: none !important; min-height: 0 !important;
  max-height: none !important; padding: 0 !important; margin: 0 !important;
  aspect-ratio: auto !important; box-sizing: border-box;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(235,246,251,.54), rgba(255,255,255,.22));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.game-description .slide.full-panel .media > iframe {
  display: block !important; position: static !important;
  width: 100% !important; height: 100% !important; min-height: 0 !important;
  max-width: none !important; max-height: none !important;
  border: 0 !important; margin: 0; box-sizing: border-box;
}
@media (max-width: 520px) {
  .game-description .icon-row {
    grid-template-columns: repeat(5, minmax(0, 64px));
    gap: 7px; padding-inline: 4px;
  }
  .game-description { padding-block: 18px; gap: 14px; }
  .game-description .icon-cell { width: 64px; height: 100px; padding-inline: 2px; gap: 6px; }
  .game-description .icon-wrap {
    flex-shrink: 0; transform: scale(.48); transform-origin: center;
    margin-block: -24px;
  }
  .game-description .icon-title { font-size: clamp(9px, 2.55vw, 11px); white-space: nowrap; }
}

/* Embedded mobile stories: the block stays in the document below session progress. */
.mobile-story-title,
.mobile-story-nav {
  display: none;
}

@media (max-width: 620px) {
  .game-description {
    --legend-height: min(680px, 76dvh) !important;
    width: calc(100vw - 16px);
    padding: 12px 8px 14px;
    gap: 9px;
    border-radius: 20px;
    overflow: hidden;
  }

  .game-description .icon-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
    padding: 0 2px;
  }

  .game-description .icon-cell {
    position: relative;
    display: block;
    width: 100%;
    height: 5px;
    min-height: 5px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: rgba(42,71,82,.16);
    cursor: pointer;
  }

  .game-description .icon-cell::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #18778a;
    transform: scaleX(0);
    transform-origin: left center;
  }

  .game-description .icon-cell.is-past::after,
  .game-description .icon-cell.active::after {
    transform: scaleX(1);
  }

  .game-description .icon-cell .icon-wrap,
  .game-description .icon-cell .icon-title,
  .game-description .icon-cell .icon-baseline {
    display: none;
  }

  .mobile-story-title {
    display: block;
    min-height: 25px;
    padding: 1px 4px 0;
    color: #26343a;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
  }

  .game-description .slide.full-panel {
    height: var(--legend-height) !important;
    border-radius: 17px;
  }

  .game-description .slide.full-panel .media {
    border-radius: 17px;
  }

  .mobile-story-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 4;
    display: flex;
    width: 19%;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(25,91,105,.68);
    touch-action: manipulation;
  }

  .mobile-story-nav span {
    display: flex;
    width: 30px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: rgba(244,251,253,.76);
    box-shadow: 0 3px 13px rgba(42,72,84,.12);
    font: 400 31px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .mobile-story-nav--previous {
    left: 0;
    justify-content: flex-start;
    padding-left: 5px;
  }

  .mobile-story-nav--next {
    right: 0;
    justify-content: flex-end;
    padding-right: 5px;
  }

  .mobile-story-nav:disabled {
    opacity: 0;
    pointer-events: none;
  }
}
@media (max-height: 500px) {
  .game-description .icon-cell { height: 48px; gap: 4px; }
  .game-description .icon-wrap { display: none; }
}
