#rotate-device { display: none; }

.shop-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 12px;
  background: #0b141c;
  border-bottom: 1px solid #d3b77766;
}

.shop-head h2 { margin-bottom: 0; }

#shop-close {
  flex: none;
  min-width: 102px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #ffc877;
  border-radius: 8px;
  background: #422b20;
  color: #ffe1ac;
  font-size: 12px;
  font-weight: 900;
  touch-action: manipulation;
}

#shop-close:hover, #shop-close:focus-visible { background: #67402a; }
#shop-feedback { min-height: 1em; color: #ffcb80; font-weight: 800; }
#shop-feedback:empty { display: none; }

body.touch-enabled #touch-sprint {
  position: absolute;
  left: calc(env(safe-area-inset-left) + 148px);
  bottom: calc(env(safe-area-inset-bottom) + 44px);
  width: 70px;
  height: 48px;
  border-radius: 12px;
  color: #ffda9f;
  border-color: #ffc877;
  font-size: 10px;
  letter-spacing: .4px;
  touch-action: none;
}

body.touch-enabled #touch-sprint:active { background: #f5a257; color: #14212a; }
body.touch-enabled #touch-sprint.active { background: #f5a257; color: #14212a; box-shadow: 0 0 16px #f5a25799; }

@media (orientation: portrait) {
  body.touch-enabled #rotate-device {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 12px;
    padding: 24px;
    background: #09131bee;
    color: #fff0d5;
    text-align: center;
  }
  #rotate-device span { color: #ffac67; font-size: 64px; line-height: 1; }
  #rotate-device strong { font: 36px Impact, sans-serif; letter-spacing: 2px; }
  #rotate-device p { margin: 0; font-size: 14px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  body.touch-enabled .touch-toolbar { top: calc(env(safe-area-inset-top) + 5px); right: calc(env(safe-area-inset-right) + 7px); }
  body.touch-enabled .touch-toolbar button { width: 36px; height: 34px; }
  body.touch-enabled .touch-quick { top: calc(env(safe-area-inset-top) + 45px); right: calc(env(safe-area-inset-right) + 7px); gap: 4px; max-width: 48vw; }
  body.touch-enabled .touch-quick button { width: 45px; height: 42px; padding: 2px; font-size: 16px; }
  body.touch-enabled .touch-quick button small { font-size: 6px; letter-spacing: 0; }
  body.touch-enabled #ready-wave { top: calc(env(safe-area-inset-top) + 92px); right: calc(env(safe-area-inset-right) + 8px); bottom: auto; min-height: 43px; min-width: 138px; }
  body.touch-enabled #touch-sprint { left: calc(env(safe-area-inset-left) + 127px); bottom: calc(env(safe-area-inset-bottom) + 35px); width: 65px; height: 43px; }
  body.touch-enabled .shop-panel { width: min(96vw, 900px); max-height: 96dvh; padding: 10px 14px; }
  body.touch-enabled .shop-panel h2 { font-size: 26px; margin: 6px 0 0; }
  body.touch-enabled .shop-panel h3 { margin: 12px 0 8px; }
  body.touch-enabled .shop-panel p { margin: 7px 0; }
  body.touch-enabled #shop-defenses, body.touch-enabled #shop-weapons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.touch-enabled .shop-item { min-height: 72px; padding: 7px; }
  body.touch-enabled .shop-item small { margin: 4px 0; }
  body.touch-enabled .modal-card { max-height: 96dvh; overflow: auto; padding: 16px 20px; }
  body.touch-enabled .modal-card h2 { font-size: 38px; margin: 8px 0; }
  body.touch-enabled .modal-card .primary { margin-top: 12px; }
}

@media (max-height: 350px) and (orientation: landscape) {
  body.touch-enabled #intermission .intermission-dialog { padding: 10px; }
  body.touch-enabled #intermission h2 { font-size: 27px; }
  body.touch-enabled #intermission-options button { min-height: 105px; padding: 7px; }
  body.touch-enabled #intermission-options button small { margin-top: 5px; }
}

@media (max-width: 700px) and (orientation: landscape) {
  body.touch-enabled #touch-move { left: calc(env(safe-area-inset-left) + 15px); }
  body.touch-enabled #touch-fire { right: calc(env(safe-area-inset-right) + 15px); }
  body.touch-enabled #touch-sprint { left: calc(env(safe-area-inset-left) + 116px); }
  body.touch-enabled .touch-skills { right: calc(env(safe-area-inset-right) + 121px); }
  body.touch-enabled .menu-copy { width: 75%; }
  body.touch-enabled .menu-copy h1 { font-size: clamp(38px, 6vw, 50px); }
}
