.guide-page {
  background: radial-gradient(ellipse at 85% 12%, #49316a47, transparent 43%),
    radial-gradient(ellipse at 12% 27%, #602b3755, transparent 46%), #171316;
}
.guide-page a { text-decoration: none; }
.guide-page a:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.guide-page .brand > span { display: flex; align-items: center; gap: 12px; }
.guide-play { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; }
.guide { padding: 24px 0 clamp(36px, 7vw, 88px); }
.guide-hero {
  display: grid; grid-template-columns: minmax(255px, .82fr) minmax(0, 1.3fr); align-items: center;
  gap: clamp(12px, 3vw, 38px);
  padding: clamp(22px, 3.4vw, 42px);
  background: linear-gradient(105deg, #191317fa 10%, #21161ce0 60%, #261e32b3),
    url("./art/backgrounds/stage-0.webp") center / cover;
  border: 1px solid #c7a26570; border-radius: 17px; overflow: hidden;
  box-shadow: 0 24px 65px #0b070d65;
}
.guide-intro p { max-width: 27em; margin: 0; line-height: 1.75; color: var(--muted); }
.guide-intro h1 {
  color: var(--gold); margin: 0 0 14px; font-size: .84rem; letter-spacing: .13em;
}
.guide-intro .guide-hook {
  font: 750 clamp(1.9rem, 4.25vw, 3.45rem)/1.22 var(--jp-serif);
  letter-spacing: -.05em; color: var(--ink); margin: 0 0 15px;
}
.guide-hook span { display: block; white-space: nowrap; }
.guide-jumps { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.guide-jumps a {
  color: var(--gold); border: 1px solid var(--line); border-radius: 5px;
  padding: 8px 11px; font-size: .8rem; font-weight: 700; background: #171214a8;
}
.guide-jumps a:hover { border-color: var(--gold); background: #382832; }
.guide-cast { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.5vw, 16px); }
.guide-rival {
  display: grid; align-content: start; min-width: 0; margin: 0; overflow: hidden;
  border-radius: 10px; border: 1px solid color-mix(in srgb, var(--seat) 54%, transparent);
  background: linear-gradient(145deg, var(--poster), #211820 90%);
}
.guide-portrait {
  position: relative; aspect-ratio: 1/.97; overflow: hidden;
  background: radial-gradient(ellipse at 50% 52%, color-mix(in srgb, var(--seat) 35%, transparent), transparent 78%);
}
.guide-portrait img {
  position: absolute; top: 5%; left: 50%; transform: translateX(-50%);
  display: block; width: 122%; height: auto;
}
.guide-rival figcaption {
  position: relative; display: grid; gap: 4px; padding: clamp(9px, 1.4vw, 16px);
  border-top: 1px solid color-mix(in srgb, var(--seat) 28%, transparent);
}
.guide-rival figcaption > strong {
  font: italic 700 clamp(1.5rem, 3.35vw, 3.1rem)/.94 var(--serif); color: var(--seat);
}
.guide-rival figcaption > span { color: var(--seat); font-size: .76rem; font-weight: 680; }
.guide-rival q { margin-top: 4px; font: 700 clamp(.76rem, 1.45vw, 1rem)/1.55 var(--jp-serif); }
.guide-rival q::before { content: "「"; }
.guide-rival q::after { content: "」"; }
.guide-section { margin-top: clamp(30px, 5.5vw, 67px); scroll-margin-top: 18px; }
.guide-section h2 { margin: 0 0 15px; font: 700 clamp(1.55rem, 3.5vw, 2.45rem)/1.25 var(--jp-serif); }
.guide-section h3 { margin: 0; font-size: 1rem; }
.guide-score, .guide-details {
  padding: clamp(14px, 3.4vw, 28px); border: 1px solid var(--line);
  border-radius: 10px; background: linear-gradient(130deg, #2e2328, #211b22);
}
.guide-score { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 21px; align-items: start; }
.guide-score-copy > p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.65; }
.guide-score-copy .guide-example {
  display: grid; gap: 2px; margin-top: 13px; padding: 12px;
  border: 1px solid #f2cf8b52; border-radius: 6px; background: #f3d39b0c; color: var(--ink);
}
.guide-example small { color: var(--muted); }
.guide-example strong { color: var(--gold); font-size: 1.3rem; }
.guide-score-table { border-collapse: collapse; width: 100%; font-size: .89rem; }
.guide-score-table :is(th,td) { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.guide-score-table :is(th,td):last-child { text-align: right; }
.guide-score-table thead { color: var(--muted); font-size: .75rem; }
.guide-score-table th { font-weight: 650; }
.guide-score-table td { color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.guide-score-table small { margin-left: 4px; color: var(--muted); }
.guide-details .rule-group:first-child { border-top: 0; }
.guide-details .rule-group summary { min-height: 52px; }
.guide-details .rules-list li { font-size: .91rem; }
.guide-details .fine-print { margin-bottom: 0; }

@media (max-width: 760px) {
  .guide-hero { grid-template-columns: 1fr; }
  .guide-hook span { display: inline-block; }
  .guide-intro p { max-width: 42em; }
  .guide-cast { margin-top: 8px; }
  .guide-portrait { aspect-ratio: 1/.85; }
  .guide-portrait img { width: 113%; }
}
@media (max-width: 540px) {
  .guide { padding-top: 14px; }
  .guide-hero { padding: 14px; border-radius: 11px; }
  .guide-intro h1 { margin-bottom: 8px; }
  .guide-intro .guide-hook { font-size: clamp(1.35rem, 6.8vw, 2rem); margin-bottom: 8px; }
  .guide-intro p { font-size: .89rem; }
  .guide-jumps { margin-top: 13px; }
  .guide-rival figcaption > span { font-size: .69rem; }
  .guide-score { grid-template-columns: 1fr; }
}

.flow-intro { margin: -4px 0 14px; color: var(--muted); font-size: .93rem; line-height: 1.6; }
.rule-flow {
  display: grid; grid-template-columns: minmax(235px, .79fr) minmax(0, 1.65fr);
  gap: 14px; align-items: start;
}
.flow-chart {
  --connector: #aa8a5e;
  display: grid; justify-items: stretch; min-width: 0;
  padding: clamp(12px, 2vw, 20px);
  background: linear-gradient(145deg, #2f2225, #201a22);
  border: 1px solid var(--line); border-radius: 10px;
}
.flow-node {
  position: relative; display: grid; place-content: center; min-height: 45px; min-width: 0;
  padding: 7px 4px; border: 1px solid #b59a6c64; border-radius: 5px;
  background: #241c25; color: var(--ink); text-align: center; font-size: .84rem;
  font-weight: 680; line-height: 1.28;
}
.flow-node:hover { background: #393045; border-color: var(--gold); }
.flow-node[aria-current="step"] {
  border-color: #f4d79b; color: #2c1e16;
  background: linear-gradient(115deg, #ffe7bb, #dfb57b);
  box-shadow: 0 0 16px #edc38036;
}
.flow-arrow, .flow-split, .flow-merge { position: relative; height: 16px; }
.flow-arrow::before, .flow-split::before, .flow-merge::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--connector);
}
.flow-arrow::after, .flow-merge::before {
  content: ""; position: absolute; width: 5px; height: 5px; bottom: 2px; left: calc(50% - 2px);
  transform: rotate(45deg); border-right: 1px solid var(--connector); border-bottom: 1px solid var(--connector);
}
.flow-split::before { bottom: 50%; }
.flow-merge::after { top: 50%; }
.flow-branches {
  position: relative; display: grid; gap: 6px;
}
.flow-branches-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flow-branches-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flow-branches::before, .flow-branches-three::after {
  content: ""; position: absolute; top: -8px; left: 16.666%; right: 16.666%; height: 1px;
  background: var(--connector);
}
.flow-branches-two::before { left: 25%; right: 25%; }
.flow-branches-three::after { top: auto; bottom: -8px; }
.flow-branches .flow-node::before, .flow-branches-three .flow-node::after {
  content: ""; position: absolute; width: 1px; top: -9px; height: 8px; left: 50%;
  background: var(--connector);
}
.flow-branches-three .flow-node::after { top: auto; bottom: -9px; }
.flow-branches .flow-node { font-size: .76rem; }
.flow-stage { min-width: 0; }
.flow-scene {
  padding: clamp(14px, 2.2vw, 24px); border: 1px solid #b59a6c64; border-radius: 11px;
  background: linear-gradient(112deg, #2f2327, #261e2c);
}
.flow-scene + .flow-scene { margin-top: 12px; }
.rule-flow:has([hidden]) .flow-scene { margin-top: 0; }
.flow-scene h3 { margin-bottom: 14px; color: var(--gold); font: 750 clamp(1.17rem, 2.2vw, 1.48rem)/1.3 var(--jp-serif); }
.flow-scene h3:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; border-radius: 2px; }
.flow-dialogue { display: grid; gap: 10px; }
.flow-line {
  display: grid; grid-template-columns: clamp(44px, 7vw, 69px) minmax(0, 1fr);
  gap: 9px; align-items: start;
}
.flow-line::before {
  content: ""; aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--seat);
  background: var(--poster) var(--flow-portrait) center 12% / 130% auto no-repeat;
}
.flow-line.seat-kohaku { --flow-portrait: url("./art/standing/kohaku-challenge.webp"); }
.flow-line.seat-suzu { --flow-portrait: url("./art/standing/suzu-remember.webp"); }
.flow-bubble {
  display: grid; gap: 2px; margin: 0; padding: 8px 10px; min-width: 0;
  border-inline-start: 2px solid var(--seat); border-radius: 4px 8px 8px 4px;
  background: color-mix(in srgb, var(--seat) 9%, #211a22);
  font: 650 .93rem/1.6 var(--jp-serif);
}
.flow-bubble strong { color: var(--seat); font: 750 .73rem/1.5 system-ui, sans-serif; }
.flow-next { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.flow-next a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 11px; font-size: .8rem; }
.flow-next a span { opacity: .85; }
@media (max-width: 680px) {
  .rule-flow { grid-template-columns: minmax(0, 1fr); }
  .flow-chart { margin-inline: 0; }
  .flow-branches .flow-node { font-size: .8rem; }
}
