.mobile-only { display: none; }

@media (max-width: 768px), (pointer: coarse) and (max-width: 1100px) {
  header .bar { position: relative; flex-wrap: nowrap; gap: .8rem; }
  header .brand { font-size: 0; margin-right: auto; }
  header .brand i { width: 27px; height: 21px; }
  header .bar > nav { display: none; }
  header .test-build { margin: 0; }
  .mobile-menu { display: block; }
  .mobile-menu summary, #touch-more summary { list-style: none; cursor: pointer; }
  summary::-webkit-details-marker { display: none; }
  .mobile-menu summary { padding: .35rem .4rem; font-size: 1.35rem; }
  .mobile-menu > div {
    position: absolute; z-index: 5; top: 100%; right: 0;
    display: grid; min-width: 8rem; background: var(--ink); border: 1px solid var(--line);
  }
  .mobile-menu:not([open]) > div { display: none; }
  .mobile-menu a { padding: .65rem .9rem; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: .75rem; text-align: center; padding-block: 2rem 1.5rem; overflow: visible; }
  .hero h1 { font-size: clamp(3.5rem, 15.3vw, 7rem); }
  .hero h1 br { display: none; }
  .hero h1 em { display: block; }
  .hero h1 em::before { content: none; }
  .intro p { font-size: 1rem; margin: 1rem auto .4rem; }
  .photo { aspect-ratio: 2.04; }
  .photo img { width: 100%; }
  .station .hint { font-size: 0; }
  .station .hint kbd { display: none; }
  .station .hint::after { content: "Drag the wheel and hold the dashboard pedals. Rotate for a wider view."; font-size: .88rem; }

  body.touch-playing { overflow: hidden; overscroll-behavior: none; }
  .touch-playing #viewport, .touch-playing #viewport:fullscreen {
    position: fixed; inset: 0; z-index: 20; width: 100%; height: 100dvh;
    min-height: 0; touch-action: none; user-select: none; background: #080808;
    --touch-top-space: 3.4rem;
    --touch-bottom-space: 3.65rem;
    padding: calc(env(safe-area-inset-top) + var(--touch-top-space)) env(safe-area-inset-right)
             calc(env(safe-area-inset-bottom) + var(--touch-bottom-space)) env(safe-area-inset-left);
  }
  .touch-playing #viewport canvas, .touch-playing #viewport:fullscreen canvas {
    width: min(100%, max(0px, calc((100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--touch-top-space) - var(--touch-bottom-space)) * 4 / 3)));
    height: auto; aspect-ratio: 4/3;
  }
  .touch-playing.touch-ready #touch-ui { display: block; position: absolute; inset: 0; pointer-events: none; }
  .touch-top, .touch-chase, .touch-menu-nav {
    position: absolute;
    display: flex;
    gap: .3rem;
  }
  .touch-top {
    top: max(.35rem, env(safe-area-inset-top));
    right: max(.4rem, env(safe-area-inset-right));
  }
  .touch-chase, .touch-menu-nav {
    bottom: max(.35rem, env(safe-area-inset-bottom));
    left: max(.4rem, env(safe-area-inset-left));
  }
  #touch-ui:not([data-screen="chase"]) .touch-chase,
  #touch-ui[data-screen="home"] .touch-menu-nav,
  #touch-ui[data-screen="cockpit"] .touch-menu-nav,
  #touch-ui[data-screen="bike"] .touch-menu-nav,
  #touch-ui[data-screen="chase"] .touch-menu-nav,
  #touch-ui[data-screen="home"] #touch-view,
  #touch-ui[data-screen="menu"] #touch-view { display: none; }
  #touch-ui button, #touch-ui summary {
    pointer-events: auto; touch-action: none; display: grid; place-items: center;
    min-width: 44px; min-height: 44px; padding: .2rem .35rem; border: 1px solid #ffffffab;
    border-radius: 5px; background: #0003; color: #fff; font: 600 .75rem system-ui;
  }
  #touch-ui button[data-active], #touch-ui button:active {
    color: var(--orange); border-color: var(--orange);
  }
  .touch-extra {
    position: absolute; right: 0; top: 100%; display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem;
    padding: .4rem; background: #101111ed; pointer-events: auto; z-index: 2;
  }
  #touch-more:not([open]) .touch-extra, #touch-full[hidden] { display: none; }
  .touch-playing:not(.touch-ready) #cover { background: #080808; }
}
@media (orientation: landscape) and (min-aspect-ratio: 19/10) and (max-width: 1100px) {
  .touch-playing #viewport, .touch-playing #viewport:fullscreen {
    --touch-top-space: 0px;
    --touch-bottom-space: 0px;
  }
  .touch-menu-nav { display: grid; grid-template-columns: repeat(2, max-content); }

}
@media (hover: none) {
  .mobile-menu summary { -webkit-tap-highlight-color: transparent; }
}
@media (orientation: portrait) and (max-width: 768px) {
  .touch-top {
    top: max(env(safe-area-inset-top), calc(50% - 37.5vw - 3.3rem));
  }
  .touch-chase, .touch-menu-nav {
    bottom: max(env(safe-area-inset-bottom), calc(50% - 37.5vw - 3.3rem));
  }
}
