:root {
  --bg: #0a0c10;
  --panel: #12161f;
  --text: #e8ecf4;
  --muted: #8b93a7;
  --accent: #e82127;
  --good: #2ee59d;
  --ok: #5bb8ff;
  --bad: #ff5b6a;
  --gold: #ffd166;
  --border: #222836;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2030 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

#app {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 12px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}

.top { text-align: center; }
.top h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #fff, #ff8a8a 40%, #e82127);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { color: var(--muted); font-size: 0.95rem; margin-top: 2px; }

#hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.hud-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}
.hud-item .label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.hud-item span:last-child {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
#combo { color: var(--gold); }

#stage-wrap {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  background: #000;
  aspect-ratio: 16 / 9;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 12, 0.72);
  backdrop-filter: blur(4px);
  padding: 16px;
  transition: opacity 0.2s;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.panel.hidden { display: none; }
.panel h2 { font-size: 1.45rem; margin-bottom: 8px; }
.panel p { color: var(--muted); line-height: 1.45; font-size: 0.95rem; }
.tips {
  list-style: none;
  text-align: left;
  margin: 14px 0 18px;
  font-size: 0.9rem;
  color: var(--text);
}
.tips li { margin: 6px 0; }
.good { color: var(--good); font-weight: 700; }
.ok { color: var(--ok); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }

button {
  appearance: none;
  border: none;
  background: linear-gradient(180deg, #ff3b40, var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 28px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(232, 33, 39, 0.4);
  transition: transform 0.12s, filter 0.12s;
}
button:hover { filter: brightness(1.08); transform: translateY(-1px); }
button:active { transform: translateY(1px); }

kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #3a4258;
  background: #1c2230;
  font-size: 0.85em;
  font-family: ui-monospace, monospace;
}

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.foot {
  margin-top: auto;
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.cta { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }
.cta a { color: #9ecbff; text-decoration: none; }
.cta a:hover { text-decoration: underline; }
.disclaimer {
  margin-top: 6px;
  font-size: 0.72rem;
  color: #5c6478;
}

.result-score { margin: 10px 0 16px; color: var(--text) !important; }

@media (max-width: 560px) {
  #hud { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 18px 16px; }
  .hint { font-size: 0.75rem; }
}

/* ---------- Long-form article / SEO landing page ---------- */

main {
  width: 100%;
  max-width: 760px;
  margin: 34px auto 8px;
  padding: 0 2px;
  user-select: text;
}

main article {
  color: #c7cedd;
}

main .lede {
  font-size: 1.08rem;
  color: #dbe2ef;
  border-left: 3px solid var(--accent);
  padding-left: 16px;
}

main section {
  scroll-margin-top: 20px;
}

main h2 {
  font-size: clamp(1.3rem, 3.2vw, 1.65rem);
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin: 36px 0 12px;
  color: var(--text);
}

main h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(232, 33, 39, 0));
}

main p {
  font-size: 1rem;
  line-height: 1.75;
  margin: 0 0 16px;
}

main ul {
  margin: 0 0 16px;
  padding-left: 1.25em;
}

main li {
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 10px;
  padding-left: 2px;
}

main li::marker {
  color: var(--accent);
}

main strong {
  color: var(--text);
}

main a {
  color: #9ecbff;
  text-decoration: none;
}

main a:hover {
  text-decoration: underline;
}

main kbd {
  font-size: 0.82em;
}

.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin-top: 14px;
  padding: 24px;
  text-align: center;
  border: 1px dashed #3a4258;
  border-radius: 12px;
  background: rgba(18, 22, 31, 0.6);
}

.video-placeholder p {
  margin: 0;
  max-width: 460px;
  color: var(--muted);
  font-size: 0.95rem;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* FAQ */
#faq details {
  margin: 10px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}

#faq details[open] {
  border-color: #3a4258;
}

#faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

#faq summary::-webkit-details-marker {
  display: none;
}

#faq summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--accent);
}

#faq details[open] summary::after {
  content: "−";
}

#faq summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

#faq details p {
  margin: 10px 0 2px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Support */
.support {
  margin-top: 40px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(232, 33, 39, 0.08), rgba(18, 22, 31, 0.7));
  border: 1px solid var(--border);
  border-radius: 14px;
}

.support h2 {
  margin-top: 0;
}

.support h2::after {
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(90deg, rgba(232, 33, 39, 0), var(--accent), rgba(232, 33, 39, 0));
}

.support p {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  color: var(--muted);
}

.support-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 12px 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff3b40, var(--accent));
  color: #fff !important;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none !important;
  box-shadow: 0 6px 20px rgba(232, 33, 39, 0.4);
  transition: transform 0.12s, filter 0.12s;
}

.support-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.support-btn:active {
  transform: translateY(1px);
}

.support-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

main .foot,
.foot {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 560px) {
  main {
    margin-top: 26px;
  }
  main p,
  main li {
    font-size: 0.97rem;
    line-height: 1.7;
  }
  main h2 {
    margin-top: 30px;
  }
  .support {
    padding: 20px 16px;
  }
}

/* Keep the in-game panels usable on small phones (CSS only, markup unchanged) */
@media (max-width: 560px) {
  .overlay {
    padding: 8px;
  }
  .panel {
    padding: 10px 12px;
  }
  .panel h2 {
    font-size: 1.1rem;
    margin-bottom: 4px;
  }
  .panel p {
    font-size: 0.78rem;
    line-height: 1.3;
  }
  .panel .tips {
    margin: 6px 0 10px;
    font-size: 0.72rem;
  }
  .panel .tips li {
    margin: 2px 0;
  }
  .panel button {
    padding: 9px 24px;
    font-size: 0.9rem;
  }
}

@media (max-width: 380px) {
  .panel .tips {
    display: none;
  }
}
