* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #070815; }
body {
  overflow: hidden;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: #e0f2fe;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
button, .gate, .help-scroll { touch-action: manipulation; }
#app { position: relative; height: 100%; }
#c { display: block; width: 100%; height: 100%; }

#hud {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; justify-content: space-between; gap: 8px;
  pointer-events: none;
}
.chip {
  background: #0b1026cc;
  border: 1px solid #22d3ee55;
  border-radius: 16px;
  padding: 6px 12px;
  min-width: 88px;
  text-align: center;
  box-shadow: 0 0 18px #22d3ee33;
}
.chip span { display: block; font-size: 9px; letter-spacing: .18em; color: #67e8f9; }
.chip b { font-size: 20px; }
.chip.glow { border-color: #f0abfc88; box-shadow: 0 0 18px #f0abfc55; }
.chip.glow span { color: #f0abfc; }

#lives {
  position: absolute; top: 68px; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  letter-spacing: 6px;
  font-size: 18px;
  text-shadow: 0 0 10px #fb7185;
}
#mission, #clock {
  position: absolute; left: 50%; transform: translateX(-50%);
  pointer-events: none; font-size: 12px; letter-spacing: .06em;
  color: #a5f3fc; text-shadow: 0 0 8px #22d3ee;
}
#mission { top: 92px; }
#clock { top: 110px; opacity: .75; }

#shout {
  position: absolute; left: 50%; top: 22%;
  transform: translateX(-50%);
  font-size: 34px; font-weight: 900;
  letter-spacing: .08em;
  pointer-events: none;
  opacity: 0;
  text-shadow: 0 0 18px #fff, 0 4px 0 #0006;
  transition: opacity .15s;
}
#shout.on { opacity: 1; }
#toast {
  position: absolute; left: 50%; bottom: 92px;
  transform: translateX(-50%);
  background: #0b1026dd; border: 1px solid #f0abfc88;
  border-radius: 999px; padding: 6px 14px;
  font-size: 13px; pointer-events: none; opacity: 0;
}
#toast.on { opacity: 1; }
#xpbar {
  position: absolute; top: 62px; left: 16px; right: 16px; height: 8px;
  background: #0b1026cc; border-radius: 99px; overflow: hidden;
  border: 1px solid #22d3ee44; pointer-events: none;
}
#xpfill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22d3ee, #f0abfc); }
#superwrap {
  position: absolute; top: 128px; left: 50%; transform: translateX(-50%);
  width: min(280px, 80vw); text-align: center; z-index: 3;
}
#super {
  width: 100%; padding: 10px; font-size: 14px; letter-spacing: .2em;
  opacity: .4;
}
#super.ready { opacity: 1; animation: pulse 0.8s ease-in-out infinite; }
@keyframes pulse {
  50% { box-shadow: 0 0 28px #f0abfc; transform: scale(1.04); }
}
#superbar { height: 6px; background: #0b1026; border-radius: 99px; margin-top: 4px; overflow: hidden; }
#superfill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #fda4af, #f0abfc); }
#byline {
  position: absolute; bottom: 72px; left: 0; right: 0;
  text-align: center; font-size: 10px; letter-spacing: .12em;
  color: #67e8f988; pointer-events: none;
}
#awardList {
  list-style: none; text-align: left; max-height: 45vh; overflow: auto;
  width: min(340px, 92vw); margin: 0 0 16px;
}
#awardList li {
  background: #0b1026cc; border: 1px solid #22d3ee44;
  border-radius: 12px; padding: 8px 10px; margin: 6px 0; font-size: 14px;
}
#awardList li.on { border-color: #fde68a; color: #fde68a; }
.help-scroll {
  text-align: left;
  width: min(420px, 94vw);
  max-height: 52vh;
  overflow: auto;
  background: #0b1026dd;
  border: 1px solid #22d3ee44;
  border-radius: 16px;
  padding: 12px 14px;
  margin: 0 0 14px;
  color: #e0f2fe;
}
.help-scroll h3 { color: #f0abfc; margin: 10px 0 4px; font-size: 15px; }
.help-scroll p, .help-scroll li { font-size: 13px; line-height: 1.4; margin: 4px 0; }
.help-scroll ul { padding-left: 18px; }
.modes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  width: min(420px, 94vw);
  margin: 4px 0 14px;
}
.mode {
  padding: 10px 6px !important;
  font-size: 13px !important;
  letter-spacing: .08em !important;
  background: #0b1026 !important;
  color: #a5f3fc !important;
  border: 2px solid #22d3ee55 !important;
  box-shadow: none !important;
  line-height: 1.25;
}
.mode small { display: block; font-weight: 600; letter-spacing: 0; opacity: .8; margin-top: 4px; }
.mode.on {
  background: linear-gradient(90deg, #22d3ee, #d9f99d) !important;
  color: #071018 !important;
  border-color: #fff !important;
}
  margin-top: 10px;
  background: transparent !important;
  color: #a5f3fc !important;
  box-shadow: none !important;
  border: 1px solid #22d3ee88 !important;
}
#dock {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  display: grid; grid-template-columns: 1fr 1fr 1fr 48px 48px; gap: 6px;
  z-index: 3;
}
#dock button {
  padding: 12px 8px; font-size: 13px; letter-spacing: .14em;
  box-shadow: 0 0 16px #22d3ee66, 0 4px 0 #155e75;
}
.shop { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 16px; }
.shop button { font-size: 13px; letter-spacing: .06em; padding: 10px 12px; }

.gate {
  position: fixed; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at 50% 30%, #1e1b4baa, #070815ee);
  z-index: 5;
  padding: 20px;
}
.gate.show { display: flex; }
.mascot {
  width: min(220px, 58vw);
  height: auto;
  border-radius: 28px;
  box-shadow: 0 0 40px #22d3ee88, 0 12px 0 #f0abfc55;
  margin-bottom: 14px;
}
h1 {
  font-size: clamp(42px, 12vw, 72px);
  letter-spacing: .12em;
  background: linear-gradient(90deg, #22d3ee, #f0abfc, #d9f99d, #fb923c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px #22d3ee88);
}
.gate p { margin: 10px 0 18px; color: #a5f3fc; line-height: 1.45; }
button {
  border: 0; cursor: pointer;
  padding: 14px 42px;
  border-radius: 999px;
  font-size: 22px; font-weight: 900; letter-spacing: .28em;
  color: #071018;
  background: linear-gradient(90deg, #22d3ee, #d9f99d, #f0abfc);
  box-shadow: 0 0 24px #22d3eeaa, 0 6px 0 #155e75;
}
button:active { transform: translateY(3px); }
.gate small { margin-top: 14px; color: #67e8f9aa; letter-spacing: .16em; }
