/* Arcade embed shell. Sponsor billboard stays hidden until the host sends one. */
:root { --accent: #F0BC3C; --btn: rgba(216, 40, 0, 0.55); --btn2: rgba(32, 56, 236, 0.55); --btn3: rgba(0, 144, 56, 0.6); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: #FCFCFC; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 16px; overscroll-behavior: none; }
body { overflow: hidden; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
#game-wrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
#screen { display: block; image-rendering: pixelated; image-rendering: crisp-edges; background: #000; touch-action: none; }
footer { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: center; align-items: center; text-align: center;
  font-size: 16px; line-height: 1.3; padding: 3px 12px calc(3px + env(safe-area-inset-bottom)); color: #BCBCBC; background: #000;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
footer * { touch-action: manipulation; } /* touch-action is not inherited; set it on the spans too */
footer .keys { color: #FCFCFC; }
body.touch footer .keys { display: none; }
footer .free { color: #F0BC3C; }

/* top-right HUD buttons */
#hud-buttons { position: absolute; top: 6px; right: 8px; display: flex; gap: 8px; z-index: 6; }
.hbtn { min-width: 48px; min-height: 48px; padding: 0 12px; font: 700 16px/1 system-ui, sans-serif; letter-spacing: .5px; color: #FCFCFC; background: rgba(0, 0, 0, 0.6);
  border: 2px solid #FCFCFC; border-radius: 8px; cursor: pointer; touch-action: manipulation; }
button, a { touch-action: manipulation; }
.hbtn[aria-pressed="true"] { background: rgba(0, 120, 60, 0.75); border-color: #58F898; }
.hbtn.icon { width: 48px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.hbtn svg { width: 26px; height: 26px; display: block; }
#btn-sound .on { display: none; } #btn-sound[aria-pressed="true"] .on { display: inline; } #btn-sound[aria-pressed="true"] .off { display: none; }
.hbtn:hover { border-color: var(--accent); }
.hbtn:focus-visible, .menu-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* touch controls */
#touch-ui { position: absolute; inset: 0; pointer-events: none; display: none; z-index: 4; }
body.touch #touch-ui { display: block; }
#stick { position: absolute; left: 12px; bottom: 12px; width: 150px; height: 150px; pointer-events: auto; touch-action: none; }
#stick-base { position: absolute; inset: 10px; border-radius: 50%; background: rgba(252, 252, 252, 0.12); border: 3px solid rgba(252, 252, 252, 0.5); }
#stick-base::before, #stick-base::after { content: ""; position: absolute; background: rgba(252, 252, 252, 0.25); }
#stick-base::before { left: 50%; top: 12%; bottom: 12%; width: 4px; margin-left: -2px; }
#stick-base::after { top: 50%; left: 12%; right: 12%; height: 4px; margin-top: -2px; }
#stick-knob { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: rgba(252, 252, 252, 0.55); border: 3px solid #FCFCFC; pointer-events: none; }
#tbuttons { position: absolute; right: 12px; bottom: 12px; width: 220px; height: 176px; pointer-events: none; }
.tbtn { position: absolute; width: 72px; height: 72px; border-radius: 50%; pointer-events: auto; touch-action: none; display: flex; align-items: center; justify-content: center;
  font: 800 16px/1 system-ui, sans-serif; color: #FCFCFC; background: var(--btn); border: 3px solid #FCFCFC; text-shadow: 1px 1px 0 #000; }
.tbtn.on { filter: brightness(1.6); transform: scale(0.94); }
.tbtn[data-act="a"] { right: 0; bottom: 24px; }
.tbtn[data-act="b"] { right: 86px; bottom: 0; background: var(--btn2); }
.tbtn[data-act="c"] { right: 46px; bottom: 102px; background: var(--btn3); width: 64px; height: 64px; }
body.tapmove #stick { display: none; }
@media (max-height: 340px) { #stick { width: 128px; height: 128px; } .tbtn { width: 62px; height: 62px; } .tbtn[data-act="b"] { right: 74px; } .tbtn[data-act="c"] { bottom: 90px; right: 40px; width: 56px; height: 56px; } #tbuttons { height: 150px; } }

/* overlays */
.overlay-menu { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.72); padding: 8px; }
.overlay-menu[hidden] { display: none; }
.panel { background: #24188C; border: 4px solid #FCFCFC; box-shadow: 0 0 0 4px #000; padding: 14px 18px; width: min(440px, 94vw); max-height: 100%; overflow: auto; }
.panel h2 { font-size: 22px; margin: 0 0 10px; letter-spacing: 2px; color: var(--accent); }
.menu-btn { display: block; width: 100%; min-height: 48px; margin: 6px 0; font: 700 18px/1.2 system-ui, sans-serif; text-align: left; padding: 8px 14px; background: #000; color: #FCFCFC; border: 2px solid #747474; border-radius: 4px; cursor: pointer; }
.menu-btn:hover, .menu-btn:focus { border-color: var(--accent); background: #183C5C; outline: none; }
.menu-btn[aria-pressed="true"]::after { content: " [x]"; color: #58F898; }
#help-panel { margin-top: 8px; font-size: 16px; line-height: 1.45; }
#help-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 0 8px; }
#help-panel dt { font-weight: 700; color: var(--accent); }
#help-panel dd { margin: 0; }
@media (max-height: 520px) { #pause-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; } .panel { width: min(620px, 96vw); padding: 10px 14px; } .panel h2 { margin-bottom: 4px; } }

/* rotate prompt (portrait phones) */
#rotate { display: none; position: fixed; inset: 0; z-index: 30; background: #000; color: #FCFCFC; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 16px; touch-action: manipulation; }
#rotate * { touch-action: manipulation; }
#rotate p { font-size: 20px; line-height: 1.4; margin: 0; max-width: 300px; }
#rotate small { font-size: 16px; color: #BCBCBC; }
#rotate svg { width: 120px; height: 120px; }
@media (orientation: portrait) and (max-width: 900px) { #rotate { display: flex; } }
@media (prefers-reduced-motion: no-preference) { #rotate svg .phone { animation: tilt 2.4s ease-in-out infinite; transform-origin: 60px 60px; } }
@keyframes tilt { 0%, 30% { transform: rotate(0deg); } 60%, 100% { transform: rotate(-90deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Skyline Siege extras: auto-fire toggle */
:root { --accent: #3CBCFC; }
#btn-auto-hud { min-width: 96px; }
body.touch #btn-auto-hud { display: none; }
/* AUTO pill sits in the top bar, left of the sound and pause buttons (8px edge + 48 + 8 + 48 + 8 gap) */
.tauto { position: absolute; top: 6px; right: calc(8px + 48px + 8px + 48px + 8px); min-width: 88px; height: 48px; padding: 0 10px; border-radius: 24px; pointer-events: auto; touch-action: none;
  display: flex; align-items: center; justify-content: center; font: 800 16px/1 system-ui, sans-serif; color: #FCFCFC; background: rgba(0, 0, 0, 0.6); border: 3px solid #FCFCFC; }
.tauto[aria-pressed="true"] { background: rgba(0, 144, 56, 0.8); border-color: #58F898; }

/* arcade cabinet panels (pause menu, help) */
.panel { position: relative; background: linear-gradient(180deg, #2A1C68 0%, #140C3C 55%, #08041C 100%); border: 3px solid #F0BC3C; border-radius: 6px;
  box-shadow: 0 0 0 3px #05020E, 0 0 0 5px #8C6000, 0 0 28px rgba(240,188,60,0.35), inset 0 2px 0 rgba(255,255,255,0.18), inset 0 0 24px rgba(90,60,200,0.45); }
.panel::before { content: ""; position: absolute; inset: 0; border-radius: 4px; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.035) 0 1px, rgba(0,0,0,0) 1px 3px); }
.panel h2 { color: #FFE070; text-shadow: 0 2px 0 #C04800, 0 3px 0 #5C0C20, 0 0 12px rgba(255,200,80,0.55); letter-spacing: 4px; }
.menu-btn { position: relative; border-radius: 4px; background: linear-gradient(180deg, #2C2470 0%, #160E40 60%, #0C0628 100%); border: 2px solid #5C4CB0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 2px 0 #05020E; text-shadow: 0 1px 0 #000; }
.menu-btn:hover, .menu-btn:focus { background: linear-gradient(180deg, #5C3CC8 0%, #2C1C80 60%, #180C50 100%); border-color: #FFE070; box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 0 12px rgba(255,224,112,0.45); }
footer .back-link { color: #A8E4FC; margin-right: 14px; text-decoration: underline; }
body.touch footer .back-link { display: none; }

/* rotate prompt: arcade attract-screen look */
#rotate { background: radial-gradient(ellipse at 50% 35%, #2A1C68 0%, #0C0628 60%, #05030F 100%); }
#rotate::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, rgba(255,255,255,0.03) 0 1px, rgba(0,0,0,0) 1px 3px); }
#rotate p { color: #FFE070; text-shadow: 0 2px 0 #5C0C20, 0 0 12px rgba(255,200,80,0.4); font-weight: 700; }
#rotate svg { filter: drop-shadow(0 0 10px rgba(255,224,112,0.55)); color: #FFE070; }

#rez-billboard[hidden] { display: none !important; }
#rez-billboard {
  position: absolute; left: 8px; bottom: 8px; z-index: 5; max-width: 11rem;
  padding: 0.35rem 0.55rem; background: #14304a; color: #f7f4ee;
  border: 2px solid #e2b657; font: 700 12px/1.2 system-ui, sans-serif; letter-spacing: 0.04em;
}
