/* Shared touch/tablet layout for Safari, installed web apps and Android. */
html { -webkit-text-size-adjust:100%; }

@media (display-mode:standalone) {
  body {
    padding-top:env(safe-area-inset-top,0px);
    padding-right:env(safe-area-inset-right,0px);
    padding-bottom:env(safe-area-inset-bottom,0px);
    padding-left:env(safe-area-inset-left,0px);
  }
}

.video-frame:-webkit-full-screen {
  width:100%;height:100%;max-width:none;max-height:none;
  aspect-ratio:auto;border:0;border-radius:0;
}

@media (min-width:481px) and (max-width:900px) {
  .hero { min-height:0; }
  .hero-inner { display:flex;flex-direction:column;align-items:stretch;direction:rtl; }
  .hero-copy { max-width:100%;padding-block:48px 28px; }
  .hero-copy h1 { max-width:100%; }
  .hero-art {
    position:relative;right:auto;bottom:auto;align-self:center;
    width:min(460px,80%);height:380px;flex-shrink:0;
  }
  .hero-stamp { top:auto;bottom:90px;left:5%;right:auto; }
}

@media (max-width:1100px) {
  .topbar { height:auto;flex-wrap:wrap;gap:12px;padding-block:12px; }
  .topbar-actions { flex-wrap:wrap;justify-content:flex-end;max-width:100%; }
  .topbar-actions > *, .game-switch { flex-shrink:0; }
  .game-switch { flex-wrap:wrap; }
  .site-header .nav { flex-wrap:wrap;gap:14px;padding-block:12px; }
  .site-header .nav-links { flex-wrap:wrap;justify-content:center; }
  .hero-copy { min-width:0; }
  .game-shell .screen { padding:12px;grid-template-rows:minmax(0,1fr); }
  .game-shell .screen-card {
    min-height:0;max-height:100%;display:flex;flex-direction:column;overflow:hidden;
  }
  .game-shell .screen-card h2, .game-shell .screen-card .action { flex-shrink:0; }
  .game-shell .screen-card p { min-height:0;overflow-y:auto;overscroll-behavior:contain; }
  .game-shell .screen-card .action { align-self:center;min-height:48px; }
}

@media (any-pointer:coarse), (hover:none) {
  .game-shell .touch { display:flex;bottom:calc(12px + env(safe-area-inset-bottom,0px)); }
  .game-shell .bottom-hint { display:none; }
  .game-shell .dpad { grid-template-columns:repeat(3,48px);grid-template-rows:repeat(2,48px); }
  .game-shell .touch-key { min-width:48px;min-height:48px; }
  .game-shell .jump-key { width:68px;height:68px; }
  .top-link, .sound-button, .game-switch a, .back-link {
    display:inline-flex;align-items:center;justify-content:center;min-height:44px;
  }
  .icon-button { min-width:44px;min-height:44px; }
  [data-gender-ui]:not(dialog) { bottom:calc(12px + env(safe-area-inset-bottom,0px))!important; }
}

@media (max-width:720px) {
  .game-shell .screen-card { padding:14px; }
  .game-shell .screen-card h2 { font-size:22px;line-height:1.2; }
  .game-shell .screen-card p { font-size:13px;line-height:1.45;margin-bottom:8px; }
  .game-shell .screen-card .action { font-size:14px; }
}

@media (max-width:480px) {
  .site-header .brand, .site-header .nav-cta { flex-shrink:0; }
  .site-header .nav-cta { margin-inline-start:auto; }
  .site-header .nav-links { order:3;flex:1 0 100%;gap:18px; }
  .controls { flex-wrap:wrap;flex-basis:auto; }
  .controls .seek { flex-basis:calc(100% - 24px);order:5; }
  .game-shell .dpad { grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px); }
  .game-shell .touch-key { min-width:44px;min-height:44px; }
  .game-shell .jump-key { width:60px;height:60px; }
}
