/* Doctor Games / Rhythm Guru site — one shared stylesheet.
   Colours and type come from the game's design kit 5.0 (design/5.0/tokens.json):
   bg/app #0D0B18, bg/card #191632, text/primary #F0F2FA, text/secondary #969BB2,
   accent/violet #965AF0, violet-light #C896FF, gold #FFD659, cta-1 #FF785A → cta-2 #FFC66E,
   font Inter (max weight Bold per kit rule A-07). Mobile first. */

/* 299 V1: Inter is self-hosted (subset: Latin, Latin Extended, Cyrillic; OFL — /fonts/OFL.txt).
   No third-party font request, no render-blocking stylesheet. CJK falls back to system fonts. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-700.woff2") format("woff2"); }

:root {
  --bg: #0D0B18;
  --surface: #191632;
  --surface-hi: #231940;
  --field: #141024;
  --text: #F0F2FA;
  --muted: #969BB2;
  --faint: #6E7288;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.24);
  --accent: #C896FF;
  --violet: #965AF0;
  --violet-fill: rgba(150, 90, 240, 0.16);
  --gold: #FFD659;
  --gold-fill: rgba(255, 214, 89, 0.16);
  --green: #96FFBE;
  --red: #F06E6E;
  --cta-1: #FF785A;
  --cta-2: #FFC66E;
  --on-cta: #231408;
  --rank-ss: #FFE678;
  --rank-s: #FFD659;
  --rank-a: #60DC82;
  --rank-b: #50AAE6;
  --rank-c: #AA6EF0;
  --rank-d: #F06E6E;
  --max: 42rem;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", sans-serif;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 15% -10%, rgba(150, 90, 240, 0.28) 0%, transparent 60%),
    radial-gradient(700px 420px at 100% 5%, rgba(255, 120, 90, 0.16) 0%, transparent 55%),
    var(--bg);
  background-attachment: scroll;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: #E2C8FF; }

.wrap {
  width: min(100% - 2rem, 64rem);
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

/* ---------- header / nav ---------- */

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 0 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; border-radius: 8px; }

nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; font-size: 0.92rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--accent); }

/* ---------- type ---------- */

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 0.6rem; }
h1 { font-size: clamp(1.9rem, 6vw, 3.1rem); }
h2 { font-size: clamp(1.35rem, 3.6vw, 1.8rem); margin: 2.25rem 0 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.08rem; margin: 1.25rem 0 0.4rem; }

.lead { color: var(--muted); font-size: 1.1rem; max-width: var(--max); margin: 0 0 1.5rem; }
.meta { color: var(--muted); font-size: 0.9rem; }
.kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--violet-fill);
  border: 1px solid rgba(200, 150, 255, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  margin-bottom: 0.9rem;
}

ol, ul { padding-left: 1.25rem; max-width: var(--max); }
li { margin: 0.4rem 0; }

.prose p { max-width: var(--max); }
.prose p + p { margin-top: 0.9rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin: 1.25rem 0;
  max-width: var(--max);
}
.card strong { color: var(--accent); }

.cta {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.75rem 1.2rem;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--cta-1), var(--cta-2));
  color: var(--on-cta);
  font-weight: 700;
  text-decoration: none;
}
.cta:hover { filter: brightness(1.06); color: var(--on-cta); }

/* ---------- tiles (legal hub on home) ---------- */

.grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin: 1.5rem 0;
}
.tile {
  display: block;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.tile:hover { border-color: var(--violet); transform: translateY(-1px); color: var(--text); }
.tile h2, .tile h3 { border: 0; margin: 0 0 0.35rem; padding: 0; font-size: 1.05rem; }
.tile p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* ---------- hero ---------- */

.hero {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding: 0.5rem 0 1.5rem;
}
.hero-copy h1 { margin-bottom: 0.8rem; }
.hero-copy .lead { margin-bottom: 1.25rem; }
.hero-art { justify-self: center; width: min(100%, 300px); }
.hero-art img {
  width: 100%;
  border-radius: 28px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 6px rgba(255, 255, 255, 0.03);
}
.hero-icon { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1rem; }
.hero-icon img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.hero-icon span { font-weight: 700; font-size: 1.1rem; }
.hero-icon small { display: block; color: var(--muted); font-weight: 500; font-size: 0.85rem; }

@media (min-width: 760px) {
  .hero { grid-template-columns: 1.25fr 0.75fr; gap: 2.5rem; padding: 1.5rem 0 2.5rem; }
  .hero-art { width: min(100%, 320px); }
}

/* ---------- store buttons ---------- */

.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.75rem 0 0.5rem; }
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 52px;
  padding: 0.45rem 1.1rem 0.45rem 0.9rem;
  border-radius: 12px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  text-decoration: none;
  line-height: 1.1;
  min-width: 11.5rem;
}
.btn-store:hover { color: #fff; border-color: #fff; background: #0b0b0b; }
.btn-store svg { width: 26px; height: 26px; flex: none; }
.btn-store small { display: block; font-size: 0.68rem; font-weight: 500; opacity: 0.85; letter-spacing: 0.01em; }
.btn-store strong { display: block; font-size: 1.05rem; font-weight: 600; }
.btn-link { display: inline-flex; align-items: center; min-height: 52px; padding: 0.45rem 1rem; color: var(--accent); text-decoration: none; border-radius: 12px; border: 1px solid var(--line); }
.btn-link:hover { border-color: var(--violet); }
.stores-note { color: var(--faint); font-size: 0.82rem; margin: 0.25rem 0 0; }

/* ---------- pills / facts ---------- */

.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 1rem 0 0; max-width: none; }
.pills li { margin: 0; padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 0.88rem; color: var(--muted); }
.pills li b { color: var(--text); font-weight: 600; }

.ranks { display: inline-flex; gap: 0.35rem; font-weight: 700; letter-spacing: 0.02em; }
.ranks span { padding: 0.1rem 0.45rem; border-radius: 8px; background: var(--field); border: 1px solid var(--line); }
.ranks .d { color: var(--rank-d); } .ranks .c { color: var(--rank-c); } .ranks .b { color: var(--rank-b); }
.ranks .a { color: var(--rank-a); } .ranks .s { color: var(--rank-s); } .ranks .ss { color: var(--rank-ss); }

/* ---------- screenshots ---------- */

.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 240px);
  gap: 0.9rem;
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  list-style: none;
  margin: 1rem 0 0;
  max-width: none;
}
.shots li { margin: 0; scroll-snap-align: start; }
.shots img {
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  aspect-ratio: 9 / 16;
  width: 100%;
  object-fit: cover;
}
.shots figcaption { margin-top: 0.5rem; font-size: 0.88rem; color: var(--muted); }
@media (min-width: 900px) {
  .shots { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-auto-columns: auto; overflow: visible; }
}

/* ---------- steps / features ---------- */

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 0.9rem; margin: 1rem 0 0; max-width: none; }
.steps li {
  position: relative;
  margin: 0;
  padding: 1.1rem 1.2rem 1.1rem 3.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 1.1rem;
  top: 1.05rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--on-cta);
  background: linear-gradient(135deg, var(--cta-1), var(--cta-2));
}
.steps h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.features { display: grid; gap: 0.9rem; margin: 1rem 0 0; }
@media (min-width: 760px) { .features { grid-template-columns: repeat(2, 1fr); } }
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.feature h3 { margin: 0 0 0.5rem; font-size: 1.05rem; color: var(--accent); }
.feature ul { margin: 0; padding-left: 1.1rem; max-width: none; }
.feature li { margin: 0.3rem 0; color: var(--muted); font-size: 0.95rem; }
.feature li::marker { color: var(--gold); }

.compete {
  display: grid;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(150, 90, 240, 0.22), rgba(255, 214, 89, 0.08));
  border: 1px solid rgba(200, 150, 255, 0.3);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  margin-top: 1rem;
}
.compete .board { display: grid; gap: 0.4rem; }
.compete .row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(13, 11, 24, 0.6);
  font-size: 0.92rem;
}
.compete .row b { color: var(--gold); font-variant-numeric: tabular-nums; }
.compete .row .pos { color: var(--faint); font-weight: 700; }
.compete .row.you { outline: 1px solid var(--violet); }
.tabs { display: inline-flex; gap: 0.3rem; margin-bottom: 0.5rem; }
.tabs span { padding: 0.2rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--field); color: var(--muted); border: 1px solid var(--line); }
.tabs span.on { background: #7A3FD6; color: #fff; border-color: #7A3FD6; } /* 299: 5.3:1 for white text (WCAG AA) */
@media (min-width: 760px) { .compete { grid-template-columns: 1.1fr 0.9fr; align-items: center; } }

/* ---------- language switcher ---------- */

.langs { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; font-size: 0.85rem; margin: 0.5rem 0 0; }
.langs a { color: var(--muted); text-decoration: none; padding: 0.15rem 0.45rem; border-radius: 8px; border: 1px solid transparent; }
.langs a:hover { color: var(--accent); }
.langs a[aria-current="page"] { color: var(--text); border-color: var(--line-strong); }

/* ---------- FAQ ---------- */

.faq details { border-top: 1px solid var(--line); padding: 0.8rem 0; max-width: var(--max); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p, .faq details ol { color: var(--muted); font-size: 0.97rem; }

/* ---------- press ---------- */

table.facts { border-collapse: collapse; width: 100%; max-width: var(--max); font-size: 0.95rem; }
table.facts th, table.facts td { text-align: left; vertical-align: top; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
table.facts th { color: var(--muted); font-weight: 600; width: 34%; }
.tbd { color: var(--faint); font-style: italic; }
.assets { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); list-style: none; padding: 0; margin: 1rem 0; max-width: none; }
.assets li { margin: 0; }
.assets a { display: block; color: var(--text); text-decoration: none; font-size: 0.85rem; }
.assets img { border-radius: 12px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 0.4rem; }
.assets small { color: var(--muted); display: block; }

/* ---------- footer ---------- */

footer.site {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
footer.site p { margin: 0.4rem 0; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--accent); }

@media (max-width: 560px) {
  header.site { flex-direction: column; align-items: flex-start; }
}

/* ---------- header "Legal" menu (CSS-only, <details>) ---------- */

nav details.menu { position: relative; }
nav details.menu summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  user-select: none;
}
nav details.menu summary::-webkit-details-marker { display: none; }
nav details.menu summary::after { content: ""; width: 0.45em; height: 0.45em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-0.15em) rotate(45deg); transition: transform 0.15s ease; }
nav details.menu[open] summary::after { transform: translateY(0.1em) rotate(-135deg); }
nav details.menu summary:hover, nav details.menu[open] summary, nav details.menu summary.is-current { color: var(--accent); }
nav details.menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
nav .menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  z-index: 20;
  min-width: 12.5rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: var(--surface-hi);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
nav .menu-list li { margin: 0; }
nav .menu-list a { display: block; padding: 0.5rem 0.75rem; border-radius: 8px; color: var(--text); }
nav .menu-list a:hover, nav .menu-list a:focus-visible { background: var(--violet-fill); color: var(--accent); outline: none; }
nav .menu-list a[aria-current="page"] { color: var(--accent); background: var(--violet-fill); }
@media (max-width: 560px) {
  header.site { position: relative; }
  nav details.menu { position: static; }
  nav .menu-list { left: 0; right: 0; top: calc(100% - 0.4rem); }
}

/* ---------- guides (299 V1) ---------- */

.crumbs ol { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-size: 0.85rem; color: var(--muted); max-width: none; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 0.5rem; color: var(--faint); }
.crumbs a { color: var(--muted); }
.guide-head { margin-bottom: 1.5rem; }
.guide .prose { max-width: var(--max); }
.guide .prose > p, .guide .prose li { color: #D9DCEA; }
.guide .prose h2 { margin-top: 2.25rem; }
.guide .prose h3 { margin-top: 1.5rem; }
.guide .prose em { color: var(--accent); font-style: normal; font-weight: 600; }
.guide .prose .faq h2 { margin-top: 2rem; }
.formula { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 1rem; }
.table-wrap { overflow-x: auto; margin: 1rem 0 1.25rem; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
table.compare { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.9rem; }
table.compare th, table.compare td { text-align: left; vertical-align: top; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
table.compare thead th { background: var(--surface); color: var(--text); font-weight: 600; }
table.compare tbody th { color: var(--muted); font-weight: 600; }
table.compare tr:last-child td, table.compare tr:last-child th { border-bottom: 0; }
figure.shot { margin: 1.25rem 0; width: min(100%, 260px); }
figure.shot img { border-radius: 18px; border: 1px solid var(--line-strong); background: var(--surface); }
figure.shot figcaption { margin-top: 0.5rem; font-size: 0.88rem; color: var(--muted); }
.cta-card {
  margin: 2rem 0;
  padding: 1.25rem 1.3rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(150, 90, 240, 0.22), rgba(255, 214, 89, 0.08));
  border: 1px solid rgba(200, 150, 255, 0.3);
  max-width: var(--max);
}
.cta-card h2 { margin: 0 0 0.4rem; padding: 0; border: 0; font-size: 1.2rem; }
.cta-card p { margin: 0 0 0.5rem; color: var(--muted); }
.guide-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.9rem; max-width: none; }
.guide-list li { margin: 0; }
@media (min-width: 760px) { .guide-list { grid-template-columns: repeat(2, 1fr); } }
.langs-line { margin-top: 1.5rem; }
.guide-cta { margin: 0.4rem 0 0.6rem; font-weight: 600; }
.guide-cta a { text-decoration: none; }
.guide-cta a:hover { text-decoration: underline; }
