#battleControls { display: none; }
#closeRecruitmentTray { display: none; }
#gameCanvas { touch-action: none; }
@media (max-width: 900px), (pointer: coarse) {
  #mobileTouchControls { display: none !important; }
  #gameUI { position: relative; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px)); height: 100dvh; }
  #gameUI .canvas-wrapper { min-height: 0; height: 100%; }
  #battleControls { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: #171c1b; border-top: 1px solid #b8a074; box-shadow: 0 -8px 20px #0005; }
  #battleControls button { min-width: 0; min-height: 48px; border: 1px solid #786e58; background: #292f2c; color: #f7edda; font: 600 13px system-ui, sans-serif; border-radius: 7px; padding: 7px 4px; cursor: pointer; touch-action: manipulation; }
  #battleControls button[aria-pressed="true"] { background: #d4b56e; color: #171c1b; }
  #battleControls #battleRecruit { grid-column: span 2; background: #d4b56e; color: #171c1b; }
  #battleSelectionCount { grid-column: span 4; align-self: center; font: 600 13px system-ui, sans-serif; color: #e5dac3; }
  #battleControls button:disabled { opacity: .45; }
  #battleControls button:focus-visible { outline: 3px solid #f6e8b7; outline-offset: 2px; }
  #gameUI #shopPanel { display: none !important; }
  body.recruit-open #gameUI #shopPanel { display: flex !important; position: fixed; z-index: 45; left: 8px; right: 8px; width: auto; max-height: min(68dvh, 560px); bottom: calc(118px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; border: 1px solid #b8a074; border-radius: 12px; padding: 12px; background: #202623; box-shadow: 0 -12px 35px #0008; }
  #closeRecruitmentTray { display: block; min-height: 48px; flex-shrink: 0; align-self: end; background: #353d37; color: #f7edda; border: 1px solid #786e58; border-radius: 7px; padding: 10px 16px; font: 600 14px system-ui, sans-serif; }
  .hud-header { padding-top: env(safe-area-inset-top, 0px) !important; min-height: 55px; }
  .chat-messages { max-width: min(70vw, 320px); max-height: 100px; pointer-events: auto; }
  .game-container { gap: 5px; }
}
#gameNotice { position: fixed; z-index: 12000; top: calc(16px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); max-height: 45dvh; overflow: auto; border: 1px solid #b8a074; border-radius: 9px; background: #202623; color: #fff5df; box-shadow: 0 8px 30px #0006; padding: 16px 44px 16px 18px; font: 500 14px/1.5 system-ui, sans-serif; white-space: pre-line; }
#gameNotice[hidden] { display: none; }
#gameNotice button { position: absolute; right: 4px; top: 4px; min-width: 40px; min-height: 40px; border: 0; background: transparent; color: inherit; font-size: 22px; }
@media (prefers-reduced-motion: reduce) { #gameNotice, #battleControls * { animation: none !important; transition: none !important; } }
