/* Samurai Duel 3D - stage shell. In-game UI and touch CSS are injected by js/ui.js and js/touch.js. */
html.pip-big, html.pip-big body { overflow: hidden; }
#stage { position: relative; width: min(100%, calc(78vh * 0.5625)); width: min(100%, calc(78svh * 0.5625)); aspect-ratio: 9 / 16; margin: 0 auto; overflow: hidden;
  border-radius: 14px; background: #14101a; color: #f6ecd2; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
#stage.big { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; aspect-ratio: auto; border-radius: 0; z-index: 99999; }
#stage *, #stage *::before, #stage *::after { box-sizing: border-box; }
#stage #game-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#stage #stage-note { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; text-align: center; padding: 24px; background: rgba(20,14,26,.92); color: #f6ecd2; font: 700 15px/1.4 system-ui, sans-serif; }
#stage #stage-note[hidden] { display: none; }
#stage #stage-note button { min-height: 44px; padding: 0 20px; border-radius: 8px; border: 0; background: #b3242b; color: #fff; font: 800 15px system-ui; cursor: pointer; }
#stage #stage-loading { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; text-align: center; background: #14101a; color: #f6ecd2; font-family: Georgia, serif; }
#stage #stage-loading[hidden] { display: none; }
#stage .load-in b { display: block; font-size: 22px; letter-spacing: .16em; margin-bottom: 8px; }
#stage .load-in span { font: 13px system-ui; opacity: .7; }
.sd-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: .75rem 0 .25rem; }
.sd-bar .btn { min-height: 44px; min-width: 44px; }
.sd-keys { text-align: center; font-size: .8rem; color: #64748b; margin: .25rem 0 0; }
.sd-guide { max-width: 640px; margin: 1.5rem auto; padding: 0 1rem; line-height: 1.6; }
.sd-guide h2 { font-size: 1.25rem; margin-bottom: .5rem; }
.sd-guide h3 { font-size: 1rem; margin: 1rem 0 .25rem; }
.sd-guide p { margin-bottom: .5rem; font-size: .95rem; }
#stage.big #ui { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
@media (prefers-reduced-motion: reduce) { #stage *, #stage *::before, #stage *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
/* Shell full screen (native and immersive): the shell makes .game-wrap the fixed stage under its dock; the board fills what is left. */
html.pip-immersive .game-wrap { display: flex; flex-direction: column; overflow: hidden !important; }
html.pip-immersive .game-wrap > .game-title, html.pip-immersive .sd-bar, html.pip-immersive .sd-keys, html.pip-immersive #big-btn { display: none !important; }
html.pip-immersive #stage { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; height: auto; aspect-ratio: auto; margin: 0; border-radius: 0; }
html.pip-immersive .game-wrap > noscript { display: none; }
