* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: #0a1122; }
body { font-family: "Segoe UI", system-ui, sans-serif; color: #e6eefc; -webkit-user-select: none; user-select: none; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { position: fixed; top: 10px; left: 12px; right: 12px; pointer-events: none; z-index: 3; }
.hud-row { display: flex; gap: 8px; flex-wrap: wrap; }
.hud-chip { background: rgba(10, 18, 32, .72); border: 1px solid rgba(143, 123, 216, .45); border-radius: 10px;
  padding: 6px 12px; font-size: 15px; letter-spacing: .5px; }
.hud-chip.sigil { color: #46efc3; }
.hud-chip.score { color: #ffd9a0; }
#susp { margin-top: 8px; width: 180px; max-width: 50vw; height: 8px; border-radius: 6px;
  background: rgba(10, 18, 32, .6); overflow: hidden; border: 1px solid rgba(255, 255, 255, .15); }
#susp-fill { height: 100%; width: 0%; background: #46efc3; transition: width .12s linear; }
#msg { margin-top: 10px; font-size: 16px; color: #ffd9a0; text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
  opacity: 0; transition: opacity .4s; max-width: 420px; }
#touch-ui { position: fixed; inset: auto 0 0 0; z-index: 4; display: flex; justify-content: space-between;
  align-items: flex-end; padding: 18px; pointer-events: none; }
#joy { pointer-events: auto; width: 118px; height: 118px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(143, 123, 216, .22), rgba(10, 18, 32, .55));
  border: 2px solid rgba(143, 123, 216, .5); touch-action: none; display: flex; align-items: center; justify-content: center; }
#joy-knob { width: 46px; height: 46px; border-radius: 50%; background: rgba(230, 238, 252, .55);
  border: 2px solid rgba(255, 255, 255, .6); pointer-events: none; }
.touch-btns { pointer-events: auto; display: flex; flex-direction: column; gap: 10px; }
.touch-btns button { width: 92px; padding: 14px 0; border-radius: 14px; border: 2px solid rgba(143, 123, 216, .5);
  background: rgba(10, 18, 32, .65); color: #e6eefc; font-size: 14px; letter-spacing: 1px; }
.touch-btns button.on { background: rgba(143, 123, 216, .6); border-color: #8f7bd8; color: #fff; }
#overlay { position: fixed; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 10, 20, .78); backdrop-filter: blur(3px); }
#overlay.hidden, #touch-ui.hidden { display: none; }
.panel { max-width: 460px; width: calc(100% - 40px); text-align: center; padding: 28px 24px;
  background: rgba(13, 21, 38, .92); border: 1px solid rgba(143, 123, 216, .5); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.panel h2 { font-size: 26px; letter-spacing: 3px; color: #ffd9a0; margin-bottom: 12px; }
.panel p { font-size: 15px; line-height: 1.55; color: #c9d6ea; }
.panel b { color: #46efc3; }
.panel .keys { margin-top: 14px; font-size: 12.5px; color: #8fa3c2; }
.panel button { margin-top: 18px; padding: 13px 34px; font-size: 17px; letter-spacing: 1px; border-radius: 12px;
  border: none; background: linear-gradient(135deg, #46efc3, #8f7bd8); color: #0a1122; font-weight: 700; cursor: pointer; }
#btn-restart { position: fixed; top: 62px; right: 12px; z-index: 5; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid rgba(143, 123, 216, .5); background: rgba(10, 18, 32, .7); color: #e6eefc; font-size: 20px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { #touch-ui { display: none; } }
