:root{
  --bg0: #06040c;
  --bg1: #0b0720;
  --panel: rgba(18, 14, 34, 0.88);
  --panel2: rgba(10, 8, 18, 0.9);
  --text: #e9e6ff;
  --muted: #b8b3d6;
  --edge: rgba(255,255,255,0.12);
  --edge2: rgba(255,255,255,0.20);

  --good: #35ff9f;
  --bad: #ff3d6e;
  --accent: #7cf3ff;
  --accent2: #ff74f6;

  --shadow: 0 18px 40px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body{
  margin: 0;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  background:
    radial-gradient(1100px 600px at 20% 0%, rgba(124, 243, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 80% 20%, rgba(255, 116, 246, 0.16), transparent 65%),
    radial-gradient(1200px 800px at 50% 100%, rgba(53, 255, 159, 0.10), transparent 70%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
}

#app{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 14px 26px;
}

.top{
  display:flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 14px;
}

h1{
  margin: 0 0 6px 0;
  font-size: 28px;
  letter-spacing: 0.5px;
}

.sub{
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  max-width: 860px;
}

#hud{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 14px;
}

.hud-card{
  background: var(--panel);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  border-radius: 14px;
  padding: 10px 12px;
  flex: 1 1 220px;
  min-width: 220px;
}

.hud-label{
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}

.hud-value{
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#stage{
  position: relative;
  background: var(--panel2);
  border: 1px solid var(--edge2);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

#game{
  display:block;
  width: 100%;
  height: auto;
  aspect-ratio: 900 / 500;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #05030b;
}

.overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.70);
  padding: 18px;
}

.hidden{ display:none; }

.overlay-card{
  width: min(520px, 96vw);
  background: rgba(16, 12, 30, 0.94);
  border: 1px solid var(--edge2);
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
  text-align:center;
}

.overlay-card h2{
  margin: 0 0 10px 0;
  letter-spacing: 0.8px;
}

.overlay-card p{
  margin: 0 0 14px 0;
  color: var(--muted);
  line-height: 1.45;
}

.primary{
  appearance: none;
  border: 1px solid rgba(255,255,255,0.22);
  background: linear-gradient(180deg, rgba(124,243,255,0.25), rgba(255,116,246,0.18));
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor:pointer;
  box-shadow: 0 10px 18px rgba(0,0,0,0.35);
}

.primary:hover{ filter: brightness(1.08); }
.primary:active{ transform: translateY(1px); }

#qa{
  margin-top: 14px;
  background: rgba(14, 10, 26, 0.75);
  border: 1px solid var(--edge);
  border-radius: 16px;
  padding: 14px 12px 12px;
  box-shadow: var(--shadow);
}

.qa-top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.q-type{
  font-size: 12px;
  letter-spacing: 1px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(124,243,255,0.10);
  border: 1px solid rgba(124,243,255,0.20);
  color: var(--accent);
}

.hint{
  font-size: 12px;
  color: var(--muted);
}

kbd{
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
}

.q-prompt{
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  margin: 8px 0 12px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}

.choices{
  display:flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 8px 0 10px;
}

.choice{
  flex: 1 1 0;
  min-height: 56px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 10px 18px rgba(0,0,0,0.25);
  overflow-wrap: anywhere;
}

.choice:hover{
  filter: brightness(1.08);
  border-color: rgba(255,255,255,0.30);
}

.choice:active{
  transform: translateY(1px);
}

.choice:disabled{
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.choice.correct{
  border-color: rgba(53,255,159,0.75);
  box-shadow: 0 0 0 2px rgba(53,255,159,0.25), 0 10px 18px rgba(0,0,0,0.35);
}

.choice.wrong{
  border-color: rgba(255,61,110,0.80);
  box-shadow: 0 0 0 2px rgba(255,61,110,0.22), 0 10px 18px rgba(0,0,0,0.35);
}

.feedback{
  min-height: 22px;
  font-size: 13px;
  color: var(--muted);
}

.footer-note{
  margin-top: 8px;
  font-size: 12px;
  color: rgba(233,230,255,0.70);
}

/* Keep options horizontal on desktop; on small screens, allow wrap (still "laid out" in a row/grid). */
@media (max-width: 820px){
  .choices{ flex-wrap: wrap; }
  .choice{ flex: 1 1 230px; }
}
