/* Boom Cell: Spawn of Chaos — shell styles: dark primordial glass */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #05060e;
  color: #dfe6ff;
  font: 15px/1.6 "Avenir Next", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.top {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px 6px;
}
.wordmark {
  font-size: 22px; font-weight: 800; letter-spacing: .22em; color: #eef2ff;
}
.wordmark small {
  display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .34em;
  color: #8fa3ff; text-transform: uppercase; margin-top: 2px;
}
.top-note { font-size: 12.5px; color: #8b93b8; }

#app { padding: 8px 18px 0; }
#stage-wrap {
  position: relative;
  height: min(72vh, 720px);
  min-height: 420px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(126,148,255,.18);
  background: #02030a;
  box-shadow: 0 24px 70px rgba(0,0,0,.55), inset 0 0 90px rgba(30,40,90,.22);
}
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }

/* ---------- HUD ---------- */
.hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(4,6,16,.85), rgba(4,6,16,0));
  pointer-events: none;
}
.hud button {
  pointer-events: auto;
  background: rgba(14,20,44,.8); color: #dfe6ff;
  border: 1px solid rgba(126,148,255,.3);
  border-radius: 9px; padding: 6px 10px; font-size: 13px; cursor: pointer;
}
.hud button:hover { border-color: rgba(126,240,255,.6); }
.hud-mid { flex: 1; min-width: 0; pointer-events: none; }
.hud-ch { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #9fb0ff; }
.hud-bar {
  height: 7px; border-radius: 4px; margin: 4px 0 3px;
  background: rgba(126,148,255,.14); overflow: hidden;
}
.hud-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #6db3ff, #7ef0ff, #ffd97e);
  border-radius: 4px; transition: width .25s ease;
}
.hud-row { display: flex; justify-content: space-between; font-size: 12.5px; color: #c7d2ff; }
.hud-time { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 700; color: #eef2ff; }
.hud-time.low { color: #ff7d7d; animation: pulse 1s infinite; }
.hud-split { display: none; font-weight: 700; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(10,14,36,.72), rgba(3,4,12,.92));
  backdrop-filter: blur(3px);
}
.screen[hidden] { display: none !important; }
.scr-inner { text-align: center; max-width: 520px; padding: 24px; }
.scr-inner.wide { max-width: 640px; width: 92%; }
.scr-title {
  font-size: 30px; font-weight: 800; letter-spacing: .04em;
  background: linear-gradient(180deg, #ffffff, #9db4ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 6px;
}
.scr-sub { color: #9aa5d0; margin-bottom: 20px; font-size: 14px; }
.scr-hint { margin-top: 18px; font-size: 12.5px; color: #7c86b0; }
.act-kicker {
  font-size: 11.5px; letter-spacing: .3em; text-transform: uppercase;
  color: #8fa3ff; margin-bottom: 6px;
}
.brief-text { color: #c3cdf2; font-size: 14.5px; margin: 8px 0 14px; }
.brief-goal { color: #ffd97e; font-size: 14.5px; margin-bottom: 4px; }
.brief-par { color: #7c86b0; font-size: 12.5px; margin-bottom: 16px; }

.btn {
  display: block; width: 100%; margin: 8px auto; max-width: 320px;
  padding: 12px 18px; font-size: 15px; font-weight: 700;
  color: #dfe6ff; background: rgba(20,28,60,.85);
  border: 1px solid rgba(126,148,255,.35); border-radius: 12px;
  cursor: pointer; transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(126,240,255,.6); box-shadow: 0 6px 24px rgba(80,110,255,.25); }
.btn.primary {
  background: linear-gradient(180deg, #2f66ff, #1c3fb8);
  border-color: rgba(160,200,255,.6);
  color: #fff;
}
.btn.primary:hover { box-shadow: 0 8px 30px rgba(60,120,255,.45); }
.btn.ghost { background: transparent; border-color: rgba(126,148,255,.22); font-weight: 500; }

.endless-card {
  margin: 14px auto 0; max-width: 320px; padding: 10px 14px;
  font-size: 13px; color: #c9a4ff; cursor: pointer;
  border: 1px dashed rgba(201,164,255,.45); border-radius: 12px;
}
.endless-card:hover { background: rgba(201,164,255,.08); }

.ch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px; margin: 12px 0 4px;
}
.ch-btn {
  position: relative; padding: 10px 4px 8px;
  background: rgba(18,26,56,.9); border: 1px solid rgba(126,148,255,.3);
  border-radius: 10px; color: #dfe6ff; cursor: pointer; text-align: center;
}
.ch-btn .ch-n { display: block; font-weight: 800; font-size: 16px; }
.ch-btn .ch-act { display: block; font-size: 9px; letter-spacing: .18em; color: #8fa3ff; }
.ch-btn .ch-stars { display: block; font-size: 10px; color: #ffd97e; letter-spacing: .1em; }
.ch-btn.locked { opacity: .34; cursor: not-allowed; }
.ch-btn:not(.locked):hover { border-color: #7ef0ff; transform: translateY(-1px); }

.res-badge {
  display: inline-block; padding: 4px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 800; letter-spacing: .28em; margin-bottom: 10px;
}
.res-badge.good { background: rgba(126,240,255,.14); color: #7ef0ff; border: 1px solid rgba(126,240,255,.4); }
.res-badge.bad { background: rgba(255,90,90,.12); color: #ff8f8f; border: 1px solid rgba(255,90,90,.4); }
.res-stars { font-size: 30px; letter-spacing: .12em; color: #ffd97e; }
.res-stars .dim { color: rgba(255,217,126,.22); }
.res-line { color: #aab4dd; font-size: 14px; margin: 8px 0 14px; }

.toast {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(8px);
  background: rgba(10,14,32,.92); border: 1px solid rgba(126,240,255,.4);
  color: #dfe6ff; font-size: 13px; padding: 8px 16px; border-radius: 20px;
  opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; z-index: 9;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- article ---------- */
.about, .faq {
  max-width: 860px; margin: 0 auto; padding: 26px 20px 8px;
  color: #b9c2e6;
}
.about h1 { font-size: 24px; color: #eef2ff; margin-bottom: 12px; line-height: 1.35; }
.about h2, .faq h2 { font-size: 19px; color: #e6ebff; margin: 22px 0 8px; }
.about p, .faq p { font-size: 14.5px; margin: 8px 0; }
.about ol, .about ul { padding-left: 22px; font-size: 14.5px; }
.about li { margin: 5px 0; }
.about table, .faq table { display: none; }
.about table {
  display: table; width: 100%; border-collapse: collapse; margin: 10px 0 6px;
  font-size: 13.5px; table-layout: fixed;
}
.about th, .about td {
  text-align: left; padding: 8px 10px;
  border-bottom: 1px solid rgba(126,148,255,.14);
  overflow-wrap: break-word;
}
.about th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #8fa3ff; }
.about code { font: 12.5px monospace; background: rgba(126,148,255,.12); padding: 2px 6px; border-radius: 5px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags span {
  font-size: 11.5px; letter-spacing: .08em; padding: 5px 12px; border-radius: 14px;
  border: 1px solid rgba(126,148,255,.3); color: #9fb0ff;
}
.faq h3 { font-size: 15px; color: #e6ebff; margin: 14px 0 4px; }
.foot { text-align: center; color: #6d76a0; font-size: 12.5px; padding: 26px 18px 34px; }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  #stage-wrap { height: min(66vh, 640px); min-height: 380px; }
  .hud-split { display: inline-block; }
  .scr-title { font-size: 25px; }
  #app { padding: 6px 10px 0; }
}
@media (max-width: 520px) {
  .wordmark { font-size: 18px; }
  #stage-wrap { height: 62vh; min-height: 320px; border-radius: 13px; }
  .ch-grid { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); }
  .hud-time { font-size: 13px; }
  .hud button { padding: 5px 8px; font-size: 12px; }
}
