/* One mobile layout shared by all pages, including short landscape screens. */
@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) and (max-width: 900px) {
  html { -webkit-text-size-adjust: 100%; }
  body { animation: none; }
  .site-layout { position: relative; min-height: 100svh; }
  .site-header {
    position: relative;
    min-height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 0;
    justify-content: flex-end;
  }
  .nav-desktop { display: none; }
  .hamburger {
    display: grid;
    place-items: center;
    position: static;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 30px;
    line-height: 1;
    transition: none;
  }
  .site-main {
    min-width: 0;
    padding: 20px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left));
  }
  .site-main > * { min-width: 0; max-width: 100%; }
  .footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .copyright { font-size: 12px; line-height: 1.6; }
  #helpBtn {
    position: absolute;
    top: calc(6px + env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    right: auto;
    bottom: auto;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border-radius: 0;
    font-size: 20px;
    z-index: 1001;
    transition: none;
  }
  #logoBtn { transition: none; }
  #logoBtn img {
    width: min(78vw, 340px);
    max-height: 50svh;
    object-fit: contain;
  }
  #counter { min-height: 44px; margin: 12px 0 0; line-height: 44px; transition: none; }
  .modal-overlay, .result-overlay {
    --font-meta: 13px;
    --font-small: 15px;
    --font-body: 17px;
    --control-height: 48px;
    --dialog-top: max(12px, env(safe-area-inset-top));
    --dialog-bottom: max(12px, env(safe-area-inset-bottom));
    padding: var(--dialog-top) max(12px, env(safe-area-inset-right)) var(--dialog-bottom) max(12px, env(safe-area-inset-left));
  }
  .modal-card {
    max-width: 100%;
    max-height: calc(100dvh - var(--dialog-top) - var(--dialog-bottom));
  }
  .modal-header { min-height: 54px; grid-template-columns: 64px minmax(0, 1fr) 64px; }
  .modal-header h2 { font-size: 20px; }
  .modal-body { flex: 0 1 auto; padding: 16px; }
  .modal-text { line-height: 1.6; }
  .modal-actions .modal-button { flex: 1; }
  .menu-links { gap: 8px; }
  .menu-links a { min-height: 48px; }
  [data-page="about"] .site-main { align-items: center; }
  [data-page="about"] .container { gap: 20px; text-align: center; }
  [data-page="about"] .title, [data-page="tools"] .title { font-size: 26px; text-align: center; }
  [data-page="about"] .about { font-size: 17px; line-height: 1.75; overflow-wrap: anywhere; }
  .social-btn { gap: 16px; margin: 0; }
  .social-btn .icon { min-width: 44px; min-height: 44px; }
  .site-main .back-btn:not(.modal-close), .nav-btn, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 0;
    transition: none;
  }
  [data-page="tools"] .container { gap: 20px; }
  [data-page="tools"] .btns { width: min(100%, 320px); margin: 0; gap: 12px; }
  [data-page="tools"] .btn { min-height: 52px; font-size: 20px; }
  .lot-page, .ball-page { padding: 0; gap: 20px; }
  .lot-tube { width: min(220px, 70vw); height: min(290px, 46svh); }
  .tube-logo { font-size: clamp(22px, 6vw, 28px); }
  .ball { width: min(260px, 68vw, 46svh); height: auto; aspect-ratio: 1; }
  .ball-white { font-size: 3rem; }
  .lot-hint, .hint { font-size: 15px; line-height: 1.7; }
  .modal-body .slip { padding: 12px; }
  .slip-poem { min-height: 200px; gap: 8px; }
  .poem-line { font-size: clamp(20px, 5.5vw, 26px); line-height: 1.5; }
  .news-container { width: 100%; gap: 24px; }
  .news-container > .title { font-size: 26px; }
  .news-container .btns { width: 100%; gap: 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .news-container .btns > * { padding: 8px 4px; font-size: 14px; white-space: nowrap; }
  .news-card { width: 100%; border-radius: 0; }
  .news-overlay { min-height: 72px; padding: 8px; transition: none; }
  .news-overlay .title { font-size: 17px; line-height: 1.4; }
  .news-overlay .content { font-size: 16px; padding: 0 8px; }
}
