/* Compact layout for short mobile viewports. */
@media (max-width: 699px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overscroll-behavior-y: auto;
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .screen {
    height: auto;
    min-height: calc(100dvh - 42px);
    overflow: visible;
    touch-action: pan-y;
  }

  .title-screen { justify-content: center; }

  .game-screen {
    overflow: visible;
    touch-action: pan-y;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .game-screen .event-card {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .result-screen {
    align-content: start;
    overflow: visible;
    touch-action: pan-y;
  }

  .result-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 8px 0;
  }

  .result-stat {
    min-width: 0;
    padding: 8px 3px;
    border-radius: 12px;
  }

  .result-stat span {
    min-height: 2.2em;
    font-size: 9px;
    line-height: 1.1;
  }

  .result-stat strong {
    margin-top: 2px;
    font-size: 14px;
    line-height: 1.1;
  }

  .result-actions {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding-bottom: 4px;
  }

  .result-actions .text-button {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 15px;
  }
}

@media (max-height: 740px) and (max-width: 699px) {
  .app-shell {
    min-height: 100dvh;
    padding: max(10px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
  }

  .screen {
    min-height: calc(100dvh - max(22px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  }

  .title-screen { padding-top: 2px; }
  .title-screen h1 {
    font-size: clamp(28px, 8.5vw, 36px);
    margin: 7px 0 6px;
  }
  .lead {
    font-size: 13px;
    line-height: 1.4;
  }
  .title-visual {
    height: 160px;
    margin: 2px 0 -4px;
  }
  .hero-pakai {
    width: 154px;
    height: 165px;
  }
  .orbit-one {
    width: 164px;
    height: 164px;
  }
  .orbit-two {
    width: 132px;
    height: 132px;
  }
  .title-stats { margin-bottom: 7px; }
  .title-stats span { padding: 5px 8px; }
  .primary-button,
  .secondary-button,
  .danger-button {
    min-height: 48px;
    padding: 10px 16px;
  }
  .text-button {
    padding: 6px;
    margin-top: 0;
  }
  .fine-print { margin: 3px 0 0; }
  .settings-open {
    right: 14px;
    top: max(10px, env(safe-area-inset-top));
  }

  .game-header { min-height: 38px; }
  .life-time-label {
    margin-bottom: 5px;
    padding: 4px 9px;
  }
  .progress-track { margin: 8px 0; }
  .stat-strip { margin-bottom: 8px; }
  .mini-stat { padding: 6px 3px; }
  .event-card {
    min-height: 0;
    padding: 14px;
    border-radius: 20px;
  }
  .event-visual {
    height: 110px;
    margin: -14px -14px 10px;
    border-radius: 20px 20px 14px 14px;
  }
  .event-visual.event-visual-generic { height: 46px; }
  .event-card h2 {
    font-size: 21px;
    margin: 12px 0 6px;
  }
  .event-card > p {
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 12px;
  }
  .choice-list { gap: 7px; }
  .choice-button {
    min-height: 48px;
    padding: 10px 12px;
    font-size: 14px;
  }
  .reaction-bubble {
    margin: 6px 2px 0;
    padding: 6px 10px;
  }
  .pakai-expression {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }
  .reaction-bubble p {
    font-size: 12px;
    line-height: 1.35;
  }

  .result-screen { padding-top: 0; }
  .result-screen > .eyebrow { font-size: 9px; }
  .rarity-badge {
    margin-top: 5px;
    padding: 4px 10px;
    font-size: 10px;
  }
  .result-screen h2 {
    font-size: clamp(25px, 7.5vw, 32px);
    margin: 7px 0 4px;
  }
  .result-description {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
  }
  .result-pose {
    width: 184px;
    height: 122px;
    margin: -2px 0 -8px;
  }
  .result-screen blockquote {
    margin-bottom: 5px;
    padding: 8px 11px;
    font-size: 12px;
    line-height: 1.35;
  }
  .result-details { margin: 0 0 5px; }
  .result-insight summary { padding-top: 8px; padding-bottom: 8px; }
  .collection-progress { margin: 2px 0 5px; font-size: 11px; }
  .result-actions .primary-button,
  .result-actions .secondary-button,
  .result-actions .text-button {
    min-height: 42px;
    padding: 8px 6px;
    font-size: 12px;
  }
}

@media (max-height: 600px) and (max-width: 699px) {
  .title-screen h1 { font-size: 27px; }
  .lead { font-size: 12px; }
  .title-visual { height: 125px; }
  .hero-pakai {
    width: 124px;
    height: 130px;
  }
  .orbit-one {
    width: 130px;
    height: 130px;
  }
  .orbit-two {
    width: 104px;
    height: 104px;
  }
  .title-stats {
    gap: 4px;
    margin-bottom: 5px;
  }
  .title-stats span {
    padding: 4px 6px;
    font-size: 10px;
  }
  .primary-button,
  .secondary-button,
  .danger-button { min-height: 44px; }
  .fine-print { font-size: 10px; }

  .result-screen > .eyebrow,
  .result-description { display: none; }
  .result-screen h2 { font-size: 23px; }
  .result-pose {
    width: 150px;
    height: 100px;
  }
  .result-stat span { min-height: 1.1em; }
  .result-details { gap: 5px; }
  .result-insight summary {
    padding: 7px 26px 7px 9px;
    font-size: 10px;
  }
}
