/* GLOAMRUNNER game UI */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #0b0d1c; }
body { font-family: "Segoe UI", system-ui, sans-serif; color: #e8ecff; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#top { position: absolute; top: 10px; left: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: rgba(16, 18, 38, 0.72);
  border: 1px solid rgba(122, 132, 200, 0.35);
  border-radius: 8px; padding: 5px 10px; font-size: 13px; letter-spacing: 0.06em;
}
.chip span { color: #ffd27a; font-weight: 600; }

#meter-box {
  position: absolute; top: 46px; left: 12px; width: 220px; height: 16px;
  background: rgba(16, 18, 38, 0.72); border: 1px solid rgba(122, 132, 200, 0.35);
  border-radius: 8px; overflow: hidden;
}
#meter-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #2f6f5e, #ffc46b 55%, #ff5a44);
  transition: width 0.12s linear;
}
#meter-label {
  position: absolute; left: 8px; top: 0; line-height: 16px;
  font-size: 10px; letter-spacing: 0.18em; color: #cfd6ff;
}
#meter-box.hot #meter-fill { animation: pulse 0.6s infinite alternate; }
#meter-box.alert { border-color: #ff5a44; box-shadow: 0 0 14px rgba(255, 90, 68, 0.6); }
@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.6); } }

#minimap {
  position: absolute; top: 10px; right: 12px; width: 168px; height: 112px;
  border: 1px solid rgba(122, 132, 200, 0.4); border-radius: 10px;
  background: rgba(16, 18, 38, 0.6);
}
#toast {
  position: absolute; top: 20%; left: 50%; transform: translateX(-50%);
  font-size: 22px; font-weight: 700; letter-spacing: 0.05em; color: #ffe3a1;
  text-shadow: 0 0 18px rgba(255, 180, 94, 0.8); opacity: 0; transition: opacity 0.4s;
  text-align: center; width: 90%;
}
#hint {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: #8b93bd; white-space: nowrap;
}

/* touch controls */
#touch { position: fixed; inset: 0; pointer-events: none; display: none; }
@media (pointer: coarse) { #touch { display: block; } #hint { display: none; } }
#stick {
  position: absolute; left: 18px; bottom: 18px; width: 108px; height: 108px;
  border-radius: 50%; background: rgba(122, 132, 200, 0.16);
  border: 1px solid rgba(122, 132, 200, 0.4); pointer-events: auto; touch-action: none;
}
#knob {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px;
  border-radius: 50%; background: rgba(255, 210, 122, 0.55);
  border: 1px solid rgba(255, 210, 122, 0.8);
}
#tbtns { position: absolute; right: 16px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
#tbtns button {
  pointer-events: auto; width: 88px; height: 46px; border-radius: 12px;
  background: rgba(16, 18, 38, 0.75); color: #cfd6ff;
  border: 1px solid rgba(122, 132, 200, 0.45); font-size: 13px; letter-spacing: 0.12em;
}
#tbtns button.on { background: rgba(61, 140, 100, 0.55); color: #d9ffe9; border-color: #35e0a1; }

/* overlays */
.overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(11, 13, 28, 0.55), rgba(11, 13, 28, 0.9));
  z-index: 10;
}
.panel {
  max-width: 560px; width: calc(100% - 32px); max-height: 92vh; overflow-y: auto;
  background: rgba(18, 21, 44, 0.92); border: 1px solid rgba(255, 200, 106, 0.3);
  border-radius: 16px; padding: 28px 30px; text-align: center;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}
.panel h1 { font-size: 34px; letter-spacing: 0.12em; color: #ffd27a; text-shadow: 0 0 24px rgba(255, 196, 107, 0.5); }
.panel h2 { font-size: 28px; letter-spacing: 0.1em; color: #7dffd0; }
.panel .tag { color: #aab4e0; margin: 8px 0 14px; }
.howto { list-style: none; text-align: left; margin: 0 0 18px; }
.howto li { font-size: 14px; line-height: 1.55; margin: 6px 0; color: #ccd3f2; padding-left: 18px; position: relative; }
.howto li::before { content: "◆"; position: absolute; left: 0; color: #ff8a5c; font-size: 10px; top: 4px; }
.howto b { color: #ffd27a; }
button.big {
  margin-top: 8px; padding: 13px 34px; font-size: 16px; letter-spacing: 0.14em;
  color: #0b0d1c; background: linear-gradient(135deg, #ffd27a, #ff9a5c);
  border: none; border-radius: 12px; cursor: pointer; font-weight: 700;
}
button.big:hover { filter: brightness(1.12); }
.panel p { color: #ccd3f2; margin: 10px 0; }
.panel .small { font-size: 12px; color: #8b93bd; }
#clear-title { color: #7dffd0; }
#end-title { color: #7dffd0; }
#ov-end .panel h2#end-title { color: inherit; }
