* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--panel); color: var(--ink); font-family: var(--text); }
body { height: 100vh; overflow: hidden; }
/* the practice view always fills the whole window, so the crosshair is the exact screen centre (as in game) */
#stage { position: fixed; inset: 0; background: var(--wall); }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#pad-msg {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); max-width: 34%;
  background: rgba(20,20,22,.9); padding: 10px 16px; border-radius: 6px; font-size: 14px;
  border-left: 3px solid var(--hazard);
}
#pad-msg[hidden] { display: none; }
#ammo {
  position: absolute; right: 24px; bottom: 18px; font-family: var(--num); font-weight: 700;
  font-size: 40px; line-height: 1; color: var(--ink); text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
#ammo small { font-size: 16px; color: var(--ink-dim); font-weight: 500; }
#help {
  position: absolute; left: 16px; top: 16px; max-width: 330px; padding: 10px 12px;
  background: rgba(20,20,22,.82); border-radius: 6px; pointer-events: none;
}
#help .note { margin-top: 6px; }
/* stick HUD: fixed to the screen (does not move with recoil), bottom centre */
#stickhud {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(320px, 80vw); padding: 4px;
  background: rgba(20,20,22,.86); border-radius: 8px; padding: 6px; pointer-events: none;
}
#stickhud[hidden] { display: none; }
#stickhud canvas { width: 100%; display: block; }
#help .keys[hidden] { display: none; }
#lock-msg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, 90px); padding: 10px 16px;
  background: rgba(20,20,22,.9); border-radius: 6px; font-size: 14px; border-left: 3px solid var(--hazard); pointer-events: none;
}
#lock-msg[hidden] { display: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--panel-2); }
.seg button[aria-pressed="true"] { background: var(--hazard); color: var(--on-hazard); font-weight: 700; }
.only-pad[hidden], .only-mouse[hidden] { display: none; }
input[type=number] { font: inherit; font-size: 14px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; width: 90px; }
aside {
  position: fixed; top: 0; right: 0; bottom: 0; width: 360px; z-index: 5;
  background: rgba(20,20,22,.95); border-left: 1px solid var(--line-soft); overflow-y: auto; padding: 18px 18px 40px;
  transition: transform .2s ease;
}
body.panel-hidden aside { transform: translateX(100%); }
#top-controls {
  position: fixed; top: 12px; right: 372px; z-index: 6; display: flex; gap: 8px; align-items: center;
  transition: right .2s ease;
}
#top-controls label {
  display: flex; gap: 6px; align-items: center; padding: 2px 8px; font-size: 13px; color: var(--ink-dim);
  background: rgba(34,34,38,.92); border-radius: 4px;
}
#panel-btn { padding: 6px 10px; font-size: 13px; background: rgba(34,34,38,.92); }
body.panel-hidden #top-controls { right: 12px; }
body:not(.panel-hidden) #ammo { right: 384px; }
@media (prefers-reduced-motion: reduce) { aside, #top-controls { transition: none; } }
h1 { font-family: var(--num); font-weight: 700; font-size: 22px; margin: 0 0 2px; letter-spacing: .5px; }
.sub { color: var(--ink-dim); font-size: 13px; margin: 0 0 16px; }
section { margin-bottom: 20px; }
h2 { font-size: 13px; font-weight: 700; color: var(--ink-dim); margin: 0 0 8px; }
select, button {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 7px 10px;
}
select { width: 100%; }
button { cursor: pointer; }
button.primary { background: var(--hazard); color: var(--on-hazard); border-color: var(--hazard); font-weight: 700; }
:focus-visible { outline: 2px solid var(--hazard); outline-offset: 2px; }
.row { display: flex; gap: 8px; align-items: center; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13px; }
.keys b { font-family: var(--num); font-size: 14px; color: var(--hazard); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat { background: var(--panel-2); border-radius: 4px; padding: 8px 10px; }
.stat b { display: block; font-family: var(--num); font-size: 20px; font-weight: 600; line-height: 1.05; }
.stat span { font-size: 13px; color: var(--ink-dim); }
canvas.small { width: 100%; display: block; background: var(--panel-2); border-radius: 4px; margin-top: 8px; }
.note { font-size: 13px; color: var(--ink-dim); line-height: 1.6; margin: 6px 0 0; }
.warn { color: var(--hazard); }
.advice { list-style: none; padding: 0; margin: 10px 0 0; }
.advice li { font-size: 13px; line-height: 1.55; padding: 8px 10px; margin-bottom: 6px; background: var(--panel-2); border-radius: 4px; border-left: 3px solid var(--hit); }
.advice li.bad { border-left-color: var(--miss); }
.advice li b { font-family: var(--num); }
label.set { display: grid; grid-template-columns: 1fr 64px; gap: 4px 8px; align-items: center; font-size: 13px; margin: 8px 0; }
label.set input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--hazard); }
label.set output { text-align: right; font-family: var(--num); font-size: 14px; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 8px 0; }
details summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-dim); }
kbd { font-family: var(--num); background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; }
.legend { font-size: 13px; color: var(--ink-dim); margin: 4px 0 0; }
@media (max-width: 860px) {
  aside { width: 100%; padding-top: 60px; }
  #top-controls { right: 12px; }
  body:not(.panel-hidden) #ammo { right: 24px; }
}
