:root {
  color-scheme: dark;
  --bg: #0d1215;
  --bg-soft: #131a1e;
  --panel: rgba(24, 32, 36, 0.86);
  --panel-strong: #1b2429;
  --line: rgba(224, 232, 226, 0.13);
  --line-strong: rgba(224, 232, 226, 0.28);
  --text: #edf0ea;
  --muted: #9ea9a4;
  --faint: #68736e;
  --lime: #d8ff5f;
  --lime-soft: rgba(216, 255, 95, 0.12);
  --gold: #f3ca6a;
  --blue: #6fd5da;
  --danger: #ff8a79;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "BIZ UDPMincho", serif;
  --sans: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Meiryo", system-ui, sans-serif;
  --radius: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 50% -20%, #253031 0%, var(--bg) 54%);
  background-size: 42px 42px, 42px 42px, auto;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  overflow-x: hidden;
}

@keyframes ui-section-reveal {
  from {
    opacity: 0;
    transform: translateY(-12px);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes reward-card-reveal {
  from {
    opacity: 0;
    transform: translateX(10px) translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes boss-gate-reveal {
  from {
    opacity: 0;
    transform: translateY(-18px);
    filter: blur(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes ending-hero-reveal {
  from {
    opacity: 0;
    transform: translateY(-12px);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes ending-record-reveal {
  from {
    opacity: 0;
    transform: translateY(-12px);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes result-interlude-pass {
  0% {
    opacity: 0;
    transform: translate3d(20vw, 0, 0) scale(0.98);
    filter: blur(8px);
  }

  18% {
    opacity: 0.82;
    transform: translate3d(6vw, 0, 0) scale(0.992);
    filter: blur(2px);
  }

  34% {
    opacity: 1;
    transform: translate3d(1.2vw, 0, 0) scale(1);
    filter: blur(0);
  }

  66% {
    opacity: 1;
    transform: translate3d(-1.2vw, 0, 0) scale(1);
    filter: blur(0);
  }

  82% {
    opacity: 0.82;
    transform: translate3d(-6vw, 0, 0) scale(0.992);
    filter: blur(2px);
  }

  100% {
    opacity: 0;
    transform: translate3d(-20vw, 0, 0) scale(0.98);
    filter: blur(8px);
  }
}

#app.is-entering .play-main > * {
  animation: ui-section-reveal 640ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

#app.is-entering .play-main > :nth-child(1) {
  animation-delay: 40ms;
}

#app.is-entering .play-main > :nth-child(2) {
  animation-delay: 300ms;
}

#app.is-entering .play-main > :nth-child(3) {
  animation-delay: 560ms;
}

#app.is-entering .play-main > :nth-child(4) {
  animation-delay: 820ms;
}

#app.is-entering .play-main > :nth-child(5) {
  animation-delay: 1080ms;
}

#app.is-entering .run-sidebar {
  animation: ui-section-reveal 640ms 440ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

#app.is-entering .reward-claim-card {
  animation: reward-card-reveal 480ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: var(--reward-reveal-delay, 780ms);
}

#app.is-entering .ending-hero {
  animation: ending-hero-reveal 1000ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

#app.is-entering .ending-record {
  animation: ending-record-reveal 500ms 1500ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

#app.is-entering .result-interlude-main > .result-interlude {
  animation: result-interlude-pass 1500ms linear both;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.07;
  pointer-events: none;
}

.ambient-a {
  top: 15%;
  right: -260px;
  background: var(--lime);
}

.ambient-b {
  bottom: -260px;
  left: -220px;
  background: var(--blue);
}

.shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 82px;
  padding: 12px max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(13, 18, 21, 0.75);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--bg);
  background: var(--lime);
  border-radius: 7px;
  font-size: 25px;
  transform: rotate(3deg);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
  white-space: nowrap;
}

.brand strong {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.04em;
}

.brand small {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.header-progress {
  min-width: 300px;
  text-align: center;
}

.header-note {
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.progress-name {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.floor-pips {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.floor-pip {
  display: grid;
  width: 52px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 800;
}

.floor-pip.is-done {
  color: var(--bg);
  border-color: var(--lime);
  background: var(--lime);
}

.floor-pip.is-current {
  color: var(--lime);
  border-color: var(--lime);
  box-shadow: 0 0 15px rgba(216, 255, 95, 0.14);
}

.header-restart {
  justify-self: end;
}

.is-hidden {
  display: none !important;
}

main {
  min-height: calc(100vh - 150px);
  outline: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 48px));
  margin: 42px auto 0;
  padding: 24px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.035em;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.button-primary {
  color: #11170e;
  background: var(--lime);
  box-shadow: 0 10px 32px rgba(216, 255, 95, 0.12);
}

.button-primary:hover:not(:disabled) {
  background: #e7ff91;
}

.button-secondary,
.button-ghost {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
}

.button-secondary:hover:not(:disabled),
.button-ghost:hover:not(:disabled) {
  border-color: var(--lime);
  color: var(--lime);
}

.button-large {
  min-height: 58px;
  padding-inline: 28px;
}

.button-block {
  width: 100%;
}

.button-tall {
  min-height: 58px;
  margin-top: 14px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--lime);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--serif);
  line-height: 1.4;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  min-height: 610px;
  padding-block: 64px 50px;
}

.hero h1 {
  margin-bottom: 26px;
  font-size: clamp(38px, 4.2vw, 56px);
  font-weight: 700;
  letter-spacing: -0.06em;
  white-space: nowrap;
}

.hero-game-title {
  margin-bottom: 8px;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.hero h1 em {
  color: var(--lime);
  font-style: normal;
}

.hero-lead {
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 16px;
  line-height: 2;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.time-note {
  color: var(--faint);
  font-size: 11px;
}

.hero-art {
  position: relative;
  display: grid;
  min-height: 450px;
  place-items: center;
}

.hero-art::before {
  position: absolute;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(216, 255, 95, 0.22);
  border-radius: 50%;
  box-shadow: inset 0 0 80px rgba(216, 255, 95, 0.05), 0 0 100px rgba(216, 255, 95, 0.04);
  content: "";
}

.hero-d100 {
  position: relative;
  z-index: 2;
  width: 210px;
  height: 210px;
  overflow: hidden;
  background:
    radial-gradient(circle at 31% 22%, rgba(237, 240, 234, 0.24), transparent 18%),
    radial-gradient(circle at 64% 69%, rgba(216, 255, 95, 0.09), transparent 34%),
    conic-gradient(from 8deg, #263238, #121a1e 12%, #344248 24%, #182126 38%, #2d393e 52%, #11191d 67%, #334147 82%, #1a2428);
  clip-path: polygon(50% 0%, 70% 5%, 88% 18%, 99% 40%, 97% 65%, 82% 88%, 58% 100%, 32% 96%, 11% 81%, 0 57%, 6% 31%, 25% 9%);
  filter: drop-shadow(22px 28px 28px rgba(0, 0, 0, 0.46));
  transform: rotate(8deg);
}

.hero-d100::before {
  position: absolute;
  z-index: 2;
  inset: 1px;
  border: 1px solid rgba(237, 240, 234, 0.42);
  clip-path: inherit;
  content: "";
  pointer-events: none;
}

.d100-facets,
.d100-facets::before,
.d100-facets::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.d100-facets {
  background:
    repeating-conic-gradient(from 2deg at 50% 50%, transparent 0deg 23deg, rgba(237, 240, 234, 0.16) 23.5deg 24deg),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 34px, rgba(237, 240, 234, 0.12) 35px 36px);
}

.d100-facets::before {
  background:
    linear-gradient(28deg, transparent 48.8%, rgba(237, 240, 234, 0.13) 49.3% 50.2%, transparent 50.7%),
    linear-gradient(151deg, transparent 48.8%, rgba(237, 240, 234, 0.12) 49.3% 50.2%, transparent 50.7%),
    linear-gradient(90deg, transparent 49.3%, rgba(237, 240, 234, 0.08) 49.8% 50.2%, transparent 50.7%);
}

.d100-facets::after {
  inset: 14%;
  border: 1px solid rgba(216, 255, 95, 0.16);
  border-radius: 48%;
  transform: rotate(25deg);
}

.d100-number {
  position: absolute;
  z-index: 3;
  color: rgba(237, 240, 234, 0.65);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px #081014;
  transform: rotate(-8deg);
}

.d100-number-00 { top: 12%; left: 44%; }
.d100-number-17 { top: 25%; left: 68%; }
.d100-number-29 { top: 31%; left: 21%; }
.d100-number-42 {
  top: 45%;
  left: 46%;
  color: var(--lime);
  font-size: 13px;
  text-shadow: 0 0 12px rgba(216, 255, 95, 0.42);
}
.d100-number-58 { top: 55%; left: 76%; }
.d100-number-73 { top: 66%; left: 21%; }
.d100-number-86 { top: 77%; left: 48%; }
.d100-number-91 { top: 73%; left: 69%; }

.hero-art > p {
  position: absolute;
  bottom: 50px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.38em;
}

.orbit {
  position: absolute;
  border: 1px dashed rgba(237, 240, 234, 0.12);
  border-radius: 50%;
}

.orbit-one {
  width: 360px;
  height: 360px;
}

.orbit-two {
  width: 420px;
  height: 245px;
  transform: rotate(-18deg);
}

.how-it-works {
  display: grid;
  grid-template-columns: 0.75fr 1.8fr;
  gap: 60px;
  padding: 38px 0 50px;
  border-top: 1px solid var(--line);
}

.how-it-works h2 {
  margin: 0;
  font-size: 25px;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  position: relative;
  padding-left: 48px;
}

.step-list li > span {
  position: absolute;
  top: -3px;
  left: 0;
  color: var(--lime);
  font-family: var(--serif);
  font-size: 20px;
}

.step-list strong,
.step-list small {
  display: block;
}

.step-list strong {
  margin-bottom: 3px;
  font-family: var(--serif);
  font-size: 15px;
}

.step-list small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.page-heading {
  padding: 58px 0 34px;
}

.page-heading h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 44px);
}

.page-heading > p:last-child {
  color: var(--muted);
}

.creation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
  align-items: start;
  gap: 22px;
}

.creation-main {
  padding: 0 32px;
}

.form-section {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.form-section:last-child {
  border-bottom: 0;
}

.section-number {
  color: var(--lime);
  font-family: var(--serif);
  font-size: 16px;
}

.field-label {
  display: block;
  margin-bottom: 15px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.text-input {
  width: min(100%, 520px);
  height: 52px;
  padding: 0 16px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(4, 7, 8, 0.35);
}

.text-input::placeholder {
  color: var(--faint);
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.choice-card,
.mini-choice {
  position: relative;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.choice-card:hover,
.mini-choice:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.choice-card.is-selected,
.mini-choice.is-selected {
  border-color: var(--lime);
  background: var(--lime-soft);
}

.choice-card.is-selected::after,
.mini-choice.is-selected::after {
  position: absolute;
  top: 8px;
  right: 9px;
  color: var(--lime);
  content: "✓";
  font-size: 11px;
  font-weight: 900;
}

.choice-card strong,
.choice-card small,
.mini-choice strong,
.mini-choice small {
  display: block;
}

.choice-card strong {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
}

.choice-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.choice-card small,
.mini-choice small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.choice-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--lime);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mini-choice {
  min-height: 86px;
}

.mini-choice strong {
  margin-bottom: 5px;
  font-size: 12px;
}

.curse-choice.is-selected:not(:first-child) {
  border-color: var(--danger);
  background: rgba(255, 138, 121, 0.08);
}

.curse-choice.is-selected:not(:first-child)::after {
  color: var(--danger);
}

.route-callout {
  display: flex;
  gap: 16px;
  margin: 28px 0;
  padding: 21px;
  color: #effbd1;
  border: 1px solid rgba(216, 255, 95, 0.24);
  border-radius: 7px;
  background: var(--lime-soft);
}

.route-callout > span {
  color: var(--lime);
  font-size: 24px;
}

.route-callout strong {
  font-family: var(--serif);
}

.route-callout p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.stats-builder {
  position: sticky;
  top: 20px;
  padding: 24px;
}

.stats-builder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.stats-builder-head h2 {
  margin: 0;
}

.remaining-points {
  text-align: center;
}

.remaining-points span,
.remaining-points strong {
  display: block;
}

.remaining-points span {
  color: var(--muted);
  font-size: 9px;
}

.remaining-points strong {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.2;
}

.remaining-points.is-complete strong {
  color: var(--lime);
}

.stats-note {
  margin: 14px 0 9px;
  color: var(--muted);
  font-size: 10px;
}

.stat-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.stat-control > div:first-child span,
.stat-control > div:first-child small {
  display: block;
}

.stat-control > div:first-child span {
  font-size: 12px;
  font-weight: 700;
}

.stat-control > div:first-child small {
  color: var(--faint);
  font-size: 9px;
}

.counter {
  display: grid;
  grid-template-columns: 28px 42px 28px;
  align-items: center;
  text-align: center;
}

.counter button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.counter button:hover:not(:disabled) {
  color: var(--bg);
  border-color: var(--lime);
  background: var(--lime);
}

.counter button:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.counter strong {
  color: var(--text);
  font-family: var(--serif);
  font-size: 20px;
}

.creation-summary {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
  padding: 15px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.creation-summary > span {
  color: var(--lime);
  font-size: 25px;
}

.creation-summary div {
  min-width: 0;
}

.creation-summary small,
.creation-summary strong {
  display: block;
}

.creation-summary small {
  color: var(--faint);
  font-size: 8px;
}

.creation-summary strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-error {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 11px;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 26px;
  padding-top: 24px;
}

.play-main {
  min-width: 0;
}

.run-sidebar {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 18px;
}

.character-card {
  padding: 22px;
}

.internal-dice-card {
  padding: 20px;
}

.internal-dice-card h2 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 18px;
}

.internal-dice-guide {
  margin: 8px 0 15px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.internal-dice-list {
  display: grid;
  gap: 10px;
}

.internal-dice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(7, 12, 14, 0.55);
}

.internal-dice-meta {
  min-width: 0;
}

.internal-dice-meta small,
.internal-dice-meta code {
  display: block;
}

.internal-dice-meta small {
  margin-bottom: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.internal-dice-meta code {
  overflow: hidden;
  color: var(--lime);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.internal-dice-button {
  min-height: 43px;
  color: #101519;
  border: 0;
  border-radius: 6px;
  background: var(--lime);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.internal-dice-button:hover {
  filter: brightness(1.08);
}

.internal-dice-result {
  grid-column: 1 / -1;
  min-height: 28px;
  padding-top: 8px;
  color: var(--text);
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 19px;
  text-align: center;
}

.internal-dice-result.is-rolled {
  animation: internal-dice-pop 260ms ease-out;
}

@keyframes internal-dice-pop {
  0% { color: var(--lime); transform: scale(0.82); }
  100% { color: var(--text); transform: scale(1); }
}

.character-card-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}

.avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--lime);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--lime-soft);
  font-size: 22px;
}

.character-card-head small {
  color: var(--muted);
  font-size: 9px;
}

.character-card-head h2 {
  max-width: 185px;
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.compact-stats div {
  padding: 8px 2px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.compact-stats div:last-child {
  border-right: 0;
}

.compact-stats span,
.compact-stats strong {
  display: block;
}

.compact-stats span {
  color: var(--muted);
  font-size: 8px;
}

.compact-stats strong {
  margin-top: 1px;
  font-family: var(--serif);
  font-size: 15px;
}

.build-list {
  margin: 18px 0;
}

.build-list > div {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.build-list dt {
  color: var(--muted);
}

.build-list dd {
  margin: 0;
  font-weight: 700;
}

.class-effect {
  margin: -5px 0 16px;
  padding: 10px 12px;
  color: var(--muted);
  border-left: 2px solid var(--lime);
  background: var(--lime-soft);
  font-size: 11px;
  line-height: 1.7;
}

.class-effect strong {
  display: block;
  color: var(--lime);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.build-list > .effect-row {
  display: block;
  padding: 11px 0;
}

.effect-row dt {
  margin-bottom: 3px;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.effect-row dd strong,
.effect-row dd small {
  display: block;
}

.effect-row dd strong {
  color: var(--text);
  font-family: var(--serif);
  font-size: 13px;
}

.effect-row dd small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.6;
}

.curse-effect dd strong {
  color: var(--danger);
}

.inventory-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.inventory p {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 10px;
}

.inventory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.inventory-chips span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--gold);
  background: rgba(243, 202, 106, 0.05);
  font-size: 8px;
}

.relic-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.relic-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(243, 202, 106, 0.2);
  border-radius: 5px;
  background: rgba(243, 202, 106, 0.05);
}

.relic-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(243, 202, 106, 0.25);
  border-radius: 50%;
}

.relic-item strong,
.relic-item small {
  display: block;
}

.relic-item strong {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 12px;
}

.relic-item small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.relic-item .relic-effect {
  margin: 2px 0;
  color: var(--text);
  font-weight: 800;
}

.tour-score {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 18px 0;
}

.tour-score div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.tour-score span,
.tour-score strong {
  display: block;
}

.tour-score span {
  color: var(--muted);
  font-size: 8px;
}

.tour-score strong {
  color: var(--lime);
  font-family: var(--serif);
  font-size: 22px;
}

.journey-log {
  padding: 18px;
  box-shadow: none;
}

.journey-log ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey-log li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.journey-log li:last-child {
  border-bottom: 0;
}

.journey-log li > span {
  color: var(--lime);
  font-size: 9px;
  font-weight: 800;
}

.journey-log strong,
.journey-log small {
  display: block;
}

.journey-log strong {
  font-size: 10px;
}

.journey-log small {
  color: var(--muted);
  font-size: 8px;
}

.floor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.floor-heading h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
}

.floor-seal {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  color: var(--lime);
  font-family: var(--serif);
  font-size: 44px;
}

.floor-seal small {
  font-size: 13px;
}

.choice-lead {
  max-width: 690px;
  margin-bottom: 30px;
  color: var(--muted);
}

.dungeon-map-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    rgba(13, 19, 22, 0.84);
  background-size: 30px 30px;
  box-shadow: inset 0 0 80px rgba(111, 213, 218, 0.025);
}

.map-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--line-strong) transparent;
}

.dungeon-map {
  position: relative;
  min-width: 820px;
  margin-inline: auto;
}

.map-floor-label {
  position: absolute;
  z-index: 4;
  top: 10px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  transform: translateX(-50%);
}

.map-edges {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.map-edge,
.map-edge-arrow {
  fill: none;
  stroke: rgba(224, 232, 226, 0.16);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.map-edge.is-future,
.map-edge-arrow.is-future {
  stroke: rgba(224, 232, 226, 0.17);
}

.map-edge.is-available,
.map-edge-arrow.is-available {
  stroke: var(--lime);
  stroke-width: 3;
  filter: drop-shadow(0 0 5px rgba(216, 255, 95, 0.28));
}

.map-edge.is-traversed,
.map-edge-arrow.is-traversed {
  stroke: var(--blue);
  stroke-width: 3;
}

.map-node {
  --node-accent: var(--muted);
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 7px;
  width: 108px;
  min-height: 72px;
  padding: 12px 9px 8px;
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--node-accent) 34%, var(--line));
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(34, 45, 50, 0.98), rgba(17, 24, 28, 0.98));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  text-align: left;
  transform: translate(-50%, -50%);
  transition: border-color 160ms ease, box-shadow 160ms ease, filter 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.map-node-normal { --node-accent: var(--lime); }
.map-node-elite { --node-accent: var(--danger); }
.map-node-event { --node-accent: var(--blue); }
.map-node-boss { --node-accent: #f29a58; }

.map-node-icon {
  grid-row: 1 / 3;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--node-accent);
  border: 1px solid color-mix(in srgb, var(--node-accent) 40%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--node-accent) 9%, transparent);
  font-size: 14px;
}

.map-node strong {
  align-self: end;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.3;
}

.map-node small {
  align-self: start;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-node-state {
  position: absolute;
  top: -8px;
  left: 50%;
  padding: 1px 7px;
  color: var(--bg);
  border-radius: 20px;
  background: var(--node-accent);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.04em;
  transform: translateX(-50%);
  white-space: nowrap;
}

.map-node.is-locked {
  filter: grayscale(0.5);
  opacity: 0.48;
}

.map-node.is-locked .map-node-state {
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.map-node.is-visited {
  border-color: rgba(111, 213, 218, 0.32);
  opacity: 0.7;
}

.map-node.is-visited .map-node-state {
  background: var(--blue);
}

.map-node.is-current {
  border: 2px solid var(--blue);
  box-shadow: 0 0 0 5px rgba(111, 213, 218, 0.08), 0 0 24px rgba(111, 213, 218, 0.2);
}

.map-node.is-current .map-node-state {
  background: var(--blue);
}

.map-node.is-accessible,
.map-node.is-classAccessible {
  cursor: pointer;
}

.map-node.is-accessible {
  border-color: var(--lime);
  box-shadow: 0 0 0 4px rgba(216, 255, 95, 0.06), 0 0 22px rgba(216, 255, 95, 0.14);
}

.map-node.is-accessible .map-node-state {
  background: var(--lime);
}

.map-node.is-classAccessible {
  border: 2px dashed var(--gold);
  box-shadow: 0 0 0 4px rgba(243, 202, 106, 0.06), 0 0 22px rgba(243, 202, 106, 0.13);
}

.map-node.is-classAccessible .map-node-state {
  background: var(--gold);
}

.map-node.is-accessible:hover,
.map-node.is-classAccessible:hover {
  filter: brightness(1.14);
  transform: translate(-50%, calc(-50% - 4px));
}

.map-ability-badge {
  position: absolute;
  right: -5px;
  bottom: -8px;
  padding: 1px 6px;
  color: #19150a;
  border-radius: 3px;
  background: var(--gold);
  font-size: 7px;
  font-weight: 900;
}

.map-legend,
.map-type-legend {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 9px;
  flex-wrap: wrap;
}

.map-type-legend {
  padding-top: 0;
  border-top: 0;
}

.map-legend span,
.map-type-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.map-legend i {
  width: 10px;
  height: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.legend-current { background: var(--blue); }
.legend-accessible { background: var(--lime); }
.legend-class { background: var(--gold); }
.legend-visited { background: rgba(111, 213, 218, 0.38); }
.legend-locked { background: var(--faint); opacity: 0.5; }
.type-normal { color: var(--lime); }
.type-elite { color: var(--danger); }
.type-event { color: var(--blue); }
.type-boss { color: #f29a58; }

.boss-gate-heading {
  border-bottom-color: rgba(216, 255, 95, 0.24);
}

.boss-gate-card {
  --boss-red: #d95f4d;
  --boss-orange: #f2a052;
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr auto;
  align-items: center;
  gap: 24px;
  width: 100%;
  min-height: 210px;
  padding: 30px 34px;
  overflow: hidden;
  color: var(--text);
  border: 1px solid rgba(242, 160, 82, 0.38);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 16% 50%, rgba(217, 95, 77, 0.2), transparent 33%),
    linear-gradient(110deg, rgba(217, 95, 77, 0.1), rgba(242, 160, 82, 0.08) 58%, transparent),
    var(--panel);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.boss-gate-card.is-revealed {
  animation: boss-gate-reveal 720ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.boss-gate-card:hover {
  border-color: var(--boss-orange);
  box-shadow: 0 0 0 4px rgba(242, 160, 82, 0.06), 0 20px 65px rgba(115, 35, 30, 0.25);
  transform: translateY(-4px);
}

.boss-gate-icon {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  color: #ffd08a;
  border: 1px solid rgba(242, 160, 82, 0.42);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(217, 95, 77, 0.3), rgba(242, 160, 82, 0.18));
  font-family: var(--serif);
  font-size: 42px;
}

.boss-gate-copy small,
.boss-gate-copy strong,
.boss-gate-copy span {
  display: block;
}

.boss-gate-copy small {
  margin-bottom: 8px;
  color: var(--boss-orange);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.boss-gate-copy strong {
  margin-bottom: 9px;
  font-family: var(--serif);
  font-size: clamp(25px, 3vw, 36px);
}

.boss-gate-copy span {
  color: var(--muted);
  font-size: 13px;
}

.boss-gate-arrow {
  color: var(--boss-orange);
  font-size: 24px;
}

.ability-note,
.conversion-note {
  margin-top: 14px;
  padding: 12px 15px;
  color: var(--muted);
  border-left: 2px solid var(--lime);
  background: var(--lime-soft);
  font-size: 10px;
}

.encounter-card {
  --encounter-accent: var(--lime);
  --encounter-border: rgba(216, 255, 95, 0.22);
  --encounter-glow: rgba(216, 255, 95, 0.16);
  --encounter-surface: #202b2f;
  --encounter-panel-tint: rgba(216, 255, 95, 0.025);
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--encounter-border);
  border-radius: var(--radius);
  background: linear-gradient(105deg, transparent 38%, var(--encounter-panel-tint)), var(--panel);
  box-shadow: var(--shadow);
}

.encounter-kind-elite {
  --encounter-accent: #ff8a79;
  --encounter-border: rgba(255, 138, 121, 0.28);
  --encounter-glow: rgba(255, 138, 121, 0.15);
  --encounter-surface: #2a2525;
  --encounter-panel-tint: rgba(255, 138, 121, 0.045);
}

.encounter-kind-event,
.encounter-kind-tour {
  --encounter-accent: #6fd5da;
  --encounter-border: rgba(111, 213, 218, 0.25);
  --encounter-glow: rgba(111, 213, 218, 0.16);
  --encounter-surface: #1c2a2d;
  --encounter-panel-tint: rgba(111, 213, 218, 0.04);
}

.encounter-kind-boss {
  --encounter-accent: #f29a58;
  --encounter-border: rgba(242, 140, 80, 0.36);
  --encounter-glow: rgba(217, 82, 64, 0.2);
  --encounter-surface: #32211d;
  --encounter-panel-tint: rgba(242, 126, 73, 0.065);
  background:
    linear-gradient(105deg, rgba(217, 82, 64, 0.05) 18%, rgba(242, 160, 82, 0.07) 72%, transparent),
    var(--panel);
}

.encounter-visual {
  position: relative;
  display: grid;
  min-height: 190px;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle, var(--encounter-glow), transparent 46%),
    linear-gradient(145deg, var(--encounter-surface), #101619);
}

.encounter-visual::before,
.encounter-visual::after {
  position: absolute;
  width: 150px;
  height: 150px;
  border: 1px solid color-mix(in srgb, var(--encounter-accent) 18%, transparent);
  border-radius: 50%;
  content: "";
}

.encounter-visual::after {
  width: 110px;
  height: 110px;
  border-style: dashed;
}

.encounter-glyph {
  position: relative;
  z-index: 1;
  color: var(--encounter-accent);
  font-family: var(--serif);
  font-size: 60px;
  text-shadow: 0 0 45px color-mix(in srgb, var(--encounter-accent) 25%, transparent);
}

.encounter-type,
.encounter-floor {
  position: absolute;
  z-index: 2;
  top: 16px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.encounter-type {
  left: 16px;
}

.encounter-floor {
  right: 16px;
}

.encounter-copy {
  display: flex;
  padding: 22px 30px;
  flex-direction: column;
  justify-content: center;
}

.encounter-copy .eyebrow {
  color: var(--encounter-accent);
}

.encounter-kind-boss .encounter-glyph,
.encounter-kind-boss .encounter-copy .eyebrow {
  color: #f4a05b;
  text-shadow: 0 0 28px rgba(217, 82, 64, 0.24);
}

.encounter-copy h1 {
  margin-bottom: 8px;
  font-size: clamp(24px, 3vw, 34px);
}

.encounter-copy > p:last-of-type {
  margin-bottom: 0;
  color: var(--muted);
}

.encounter-copy .omen-text {
  margin-top: 14px;
  padding: 9px 12px;
  color: #ffd0c8;
  border-left: 2px solid var(--danger);
  background: rgba(255, 138, 121, 0.08);
  font-size: 11px;
}

.judgement-section,
.reward-panel {
  margin-top: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 27, 31, 0.75);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.section-title-row h2,
.reward-panel h2 {
  margin: 0;
  font-size: 22px;
}

.post-preview {
  position: relative;
  height: clamp(300px, 34vh, 360px);
  margin: 18px 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0b1012;
}

.post-preview pre {
  margin: 0;
  padding: 17px;
  color: #c8cfca;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.checks {
  display: grid;
  gap: 8px;
}

.repeat-check-note {
  margin: 0 0 10px;
  padding: 11px 14px;
  color: #ffd8d1;
  border: 1px solid rgba(255, 138, 121, 0.24);
  border-radius: 5px;
  background: rgba(255, 138, 121, 0.08);
  font-size: 12px;
}

.dice-result-guide {
  margin: 0 0 10px;
  padding: 10px 14px;
  color: var(--muted);
  border-left: 2px solid var(--lime);
  background: var(--lime-soft);
  font-size: 12px;
}

.dice-result-guide strong {
  color: var(--text);
}

.repeat-check-note strong {
  color: var(--danger);
}

.check-card {
  display: grid;
  grid-template-columns: 40px minmax(150px, 1fr) auto minmax(150px, 0.65fr);
  align-items: center;
  gap: 14px;
  min-height: 90px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
}

.check-card.is-automatic {
  grid-template-columns: 40px minmax(150px, 1fr) auto auto;
  border-color: rgba(216, 255, 95, 0.2);
}

.check-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--lime);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 11px;
}

.check-info small,
.check-info strong,
.check-info span {
  display: block;
}

.check-info small {
  color: var(--muted);
  font-size: 8px;
}

.check-info strong {
  font-family: var(--serif);
  font-size: 14px;
}

.check-info span {
  color: var(--lime);
  font-size: 9px;
  font-weight: 700;
}

.check-card code {
  padding: 8px 10px;
  color: var(--lime);
  border-radius: 4px;
  background: rgba(216, 255, 95, 0.08);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 11px;
}

.dice-command-block {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.dice-command-block small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.roll-input-label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.roll-input-label span,
.roll-input-label small {
  color: var(--muted);
  font-size: 9px;
}

.roll-input {
  width: 100%;
  min-width: 64px;
  height: 42px;
  padding: 0 8px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #0c1214;
  font-family: var(--serif);
  font-size: 18px;
  text-align: center;
}

.automatic-badge {
  padding: 8px 11px;
  color: var(--lime);
  border: 1px solid rgba(216, 255, 95, 0.2);
  border-radius: 20px;
  background: var(--lime-soft);
  font-size: 9px;
  font-weight: 700;
}

.formula-card {
  padding: 20px;
}

.formula-card strong,
.formula-card > span {
  display: block;
}

.formula-card strong {
  font-size: 11px;
  line-height: 1.8;
}

.formula-card > span {
  margin-top: 8px;
  color: var(--lime);
  font-family: var(--serif);
  font-size: 24px;
}

.result-interlude-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 26px;
  padding-top: 24px;
}

.result-interlude-main {
  min-width: 0;
}

.result-interlude {
  --result-accent: var(--lime);
  --result-glow: rgba(216, 255, 95, 0.14);
  position: relative;
  display: grid;
  min-height: 320px;
  padding: 48px;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 50%, var(--result-glow), transparent 48%),
    linear-gradient(110deg, transparent 0 18%, color-mix(in srgb, var(--result-accent) 7%, transparent) 48%, transparent 78%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: result-interlude-pass 1500ms linear both;
  will-change: opacity, transform, filter;
}

.result-interlude::before,
.result-interlude::after {
  position: absolute;
  z-index: -1;
  width: 310px;
  height: 310px;
  border: 1px solid color-mix(in srgb, var(--result-accent) 24%, transparent);
  border-radius: 50%;
  content: "";
}

.result-interlude::before {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 120px var(--result-glow);
}

.result-interlude::after {
  top: 50%;
  left: 50%;
  width: 230px;
  height: 230px;
  border-style: dashed;
  opacity: 0.52;
  transform: translate(-50%, -50%) rotate(-12deg);
}

.result-interlude-failure {
  --result-accent: #a94456;
  --result-glow: rgba(169, 68, 86, 0.2);
}

.result-interlude-tour-modest {
  --result-accent: var(--blue);
  --result-glow: rgba(111, 213, 218, 0.18);
}

.result-interlude-tour-great {
  --result-accent: #ffad5c;
  --result-glow: rgba(255, 145, 72, 0.2);
}

.result-interlude-panel {
  width: min(650px, 100%);
  padding: 28px 24px;
  border-top: 1px solid color-mix(in srgb, var(--result-accent) 58%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--result-accent) 58%, transparent);
  text-align: center;
  text-shadow: 0 0 34px var(--result-glow);
}

.result-interlude-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  place-items: center;
  color: var(--bg);
  border-radius: 50%;
  background: var(--result-accent);
  box-shadow: 0 0 36px var(--result-glow);
  font-size: 24px;
  font-weight: 900;
}

.result-interlude-failure .result-interlude-mark {
  color: var(--result-accent);
  border: 2px solid var(--result-accent);
  background: rgba(55, 25, 32, 0.82);
}

.result-interlude-eyebrow {
  margin: 0 0 12px;
  color: var(--result-accent);
  font-size: clamp(11px, 1.5vw, 15px);
  font-weight: 900;
  letter-spacing: 0.25em;
}

.result-interlude h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 45px);
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.outcome-card {
  --outcome-accent: var(--lime);
  position: relative;
  padding: 60px 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.outcome-card::after {
  position: absolute;
  top: -100px;
  right: -80px;
  width: 310px;
  height: 310px;
  border: 1px solid color-mix(in srgb, var(--outcome-accent) 18%, transparent);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 100px color-mix(in srgb, var(--outcome-accent) 7%, transparent);
}

.outcome-card.is-miss {
  --outcome-accent: #a94456;
  border-color: rgba(169, 68, 86, 0.34);
  background: linear-gradient(135deg, rgba(55, 25, 32, 0.56), var(--panel) 58%);
}

.outcome-status {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.outcome-mark {
  display: grid;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--bg);
  border-radius: 50%;
  background: var(--outcome-accent);
  font-size: 24px;
  font-weight: 900;
}

.outcome-status-label {
  margin: 0;
  color: var(--outcome-accent);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.13em;
  line-height: 1.15;
}

.is-miss .outcome-mark {
  color: var(--outcome-accent);
  border: 2px solid var(--outcome-accent);
  background: rgba(169, 68, 86, 0.12);
  box-shadow: 0 0 24px rgba(169, 68, 86, 0.14);
}

.outcome-card h1 {
  max-width: 650px;
  margin-bottom: 15px;
  font-size: clamp(30px, 4vw, 45px);
}

.outcome-card > p:last-child {
  max-width: 600px;
  margin-bottom: 0;
  color: var(--muted);
}

.reward-panel > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 12px;
}

.reward-claim-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.reward-claim-heading > span {
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.reward-claim-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.reward-claim-card {
  position: relative;
  display: flex;
  min-height: 210px;
  padding: 20px 18px 17px;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(32, 42, 47, 0.92), rgba(13, 19, 22, 0.96));
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.reward-claim-card::after {
  position: absolute;
  right: -28px;
  bottom: -38px;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(216, 255, 95, 0.1);
  border-radius: 50%;
  content: "";
}

.reward-claim-card:hover,
.reward-claim-card.is-active {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(216, 255, 95, 0.06), 0 16px 30px rgba(0, 0, 0, 0.24);
  transform: translateY(-3px);
}

.reward-claim-category {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.reward-claim-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 20px 0 16px;
  place-items: center;
  color: var(--bg);
  border-radius: 50%;
  background: var(--lime);
  font-size: 20px;
  font-weight: 900;
}

.reward-claim-card strong {
  font-family: var(--serif);
  font-size: 18px;
}

.reward-claim-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.reward-claim-action {
  margin-top: auto;
  padding-top: 16px;
  color: var(--lime);
  font-size: 10px;
  font-weight: 800;
}

.reward-choice-drawer {
  margin-top: 16px;
  padding: 22px;
  border: 1px solid rgba(216, 255, 95, 0.28);
  border-radius: 9px;
  background: rgba(216, 255, 95, 0.045);
}

.reward-choice-drawer h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
}

.relic-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.relic-choice-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 3px 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 13, 15, 0.7);
  text-align: left;
  cursor: pointer;
}

.relic-choice-card:hover {
  border-color: var(--gold);
  background: rgba(243, 202, 106, 0.06);
}

.relic-choice-card > span {
  grid-row: 1 / 4;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(243, 202, 106, 0.25);
  border-radius: 50%;
}

.relic-choice-card strong,
.relic-choice-card small {
  display: block;
}

.relic-choice-card small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.relic-choice-card .relic-effect {
  color: var(--gold);
}

.claimed-reward-note {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 12px;
  color: var(--muted);
  border-left: 2px solid var(--lime);
  background: rgba(216, 255, 95, 0.04);
  font-size: 10px;
}

.claimed-reward-note small {
  color: var(--lime);
  font-weight: 800;
  white-space: nowrap;
}

.reward-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.reward-stat-grid button {
  padding: 18px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.reward-stat-grid button:hover {
  color: var(--lime);
  border-color: var(--lime);
  background: var(--lime-soft);
}

.reward-stat-grid span,
.reward-stat-grid strong,
.reward-stat-grid small {
  display: block;
}

.reward-stat-grid span {
  color: var(--muted);
  font-size: 9px;
}

.reward-stat-grid strong {
  font-family: var(--serif);
  font-size: 25px;
}

.reward-stat-grid small {
  color: var(--lime);
  font-weight: 800;
}

.reward-list {
  display: grid;
  gap: 7px;
  margin: 18px 0 24px;
  padding: 0;
  list-style: none;
}

.reward-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
}

.reward-list li span {
  color: var(--lime);
}

.muted {
  color: var(--muted);
}

.ending-layout {
  width: min(930px, calc(100% - 48px));
  margin: 46px auto 0;
}

.ending-layout .ending-page {
  width: 100%;
  margin: 0;
}

.ending-page {
  position: relative;
  display: flex;
  width: min(930px, calc(100% - 48px));
  min-height: 660px;
  margin: 46px auto 0;
  padding: 70px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: radial-gradient(circle at 50% 15%, rgba(216, 255, 95, 0.14), transparent 45%), rgba(19, 26, 30, 0.86);
  box-shadow: var(--shadow);
  text-align: center;
}

.ending-hero {
  min-height: 480px;
}

.ending-record {
  margin-top: 18px;
  padding: 38px 42px;
}

.ending-record-heading {
  margin-bottom: 24px;
}

.ending-record-heading h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 26px;
}

.ending-record pre {
  max-height: 560px;
  margin: 0;
  padding: 24px;
  overflow: auto;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(7, 12, 14, 0.72);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.ending-record .ending-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

.ending-page::before,
.ending-page::after {
  position: absolute;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(216, 255, 95, 0.08);
  border-radius: 50%;
  content: "";
}

.ending-page::after {
  width: 610px;
  height: 610px;
  border-style: dashed;
}

.ending-page > * {
  position: relative;
  z-index: 1;
}

.ending-symbol {
  display: grid;
  width: 84px;
  height: 84px;
  margin-bottom: 25px;
  place-items: center;
  color: var(--lime);
  border: 1px solid var(--lime);
  border-radius: 50%;
  box-shadow: 0 0 50px rgba(216, 255, 95, 0.12);
  font-size: 40px;
}

.ending-page h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(32px, 5vw, 52px);
}

.ending-page > p:not(.eyebrow) {
  max-width: 710px;
  color: var(--muted);
}

.ending-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 680px);
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 12, 13, 0.5);
}

.ending-summary div {
  padding: 14px 10px;
  border-right: 1px solid var(--line);
}

.ending-summary div:last-child {
  border-right: 0;
}

.ending-summary span,
.ending-summary strong {
  display: block;
}

.ending-summary span {
  color: var(--muted);
  font-size: 8px;
}

.ending-summary strong {
  font-family: var(--serif);
  font-size: 17px;
}

.ending-actions {
  display: flex;
  gap: 10px;
}

.final-log {
  width: min(100%, 680px);
  margin-bottom: 24px;
  color: var(--muted);
  text-align: left;
}

.final-log summary {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  text-align: center;
  cursor: pointer;
}

.final-log .journey-log {
  margin-top: 10px;
}

.ending-dusk {
  background: radial-gradient(circle at 50% 15%, rgba(111, 213, 218, 0.11), transparent 45%), rgba(19, 26, 30, 0.86);
}

.tour-final-card {
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(circle at 82% 18%, rgba(216, 255, 95, 0.1), transparent 30%), var(--panel);
  box-shadow: var(--shadow);
}

.tour-final-icon {
  float: right;
  color: var(--lime);
  font-size: 65px;
}

.tour-final-card h1 {
  max-width: 600px;
  font-size: clamp(30px, 4vw, 45px);
}

.tour-final-card > p:last-of-type {
  color: var(--muted);
}

.score-equation {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 28px;
}

.score-equation > div {
  min-width: 130px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.18);
}

.score-equation > b {
  align-self: center;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 22px;
}

.score-equation span,
.score-equation strong {
  display: block;
}

.score-equation span {
  color: var(--muted);
  font-size: 8px;
}

.score-equation strong {
  font-family: var(--serif);
  font-size: 28px;
}

.score-equation .score-total {
  border-color: var(--lime);
  background: var(--lime-soft);
}

.score-total strong {
  color: var(--lime);
}

.tour-thresholds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 18px 0;
}

.tour-thresholds span {
  padding: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 9px;
  text-align: center;
}

.tour-thresholds strong {
  display: block;
  color: var(--text);
  font-family: var(--serif);
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  padding: 12px 18px;
  color: #11170e;
  border-radius: 5px;
  background: var(--lime);
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 文字の読みやすさを優先した全体調整 */
body { font-size: 16px; }
.brand strong { font-size: 18px; }
.brand small, .header-note, .progress-name, .site-footer { font-size: 11px; }
.floor-pip { font-size: 10px; }
.button { font-size: 14px; }
.eyebrow { font-size: 11px; }
.hero-lead { font-size: 18px; }
.time-note { font-size: 12px; }
.step-list strong { font-size: 17px; }
.step-list small { font-size: 12px; }
.field-label { font-size: 14px; }
.choice-card strong { font-size: 16px; }
.choice-card small, .mini-choice small { font-size: 12px; }
.mini-choice strong { font-size: 14px; }
.route-callout p, .stats-note { font-size: 12px; }
.stat-control > div:first-child span { font-size: 14px; }
.stat-control > div:first-child small { font-size: 10px; }
.creation-summary small { font-size: 10px; }
.creation-summary strong { font-size: 12px; }
.character-card-head small { font-size: 11px; }
.character-card-head h2 { font-size: 19px; }
.compact-stats span { font-size: 10px; }
.compact-stats strong { font-size: 17px; }
.build-list { font-size: 12px; }
.class-effect { font-size: 12px; }
.effect-row dt { font-size: 10px; }
.effect-row dd strong { font-size: 14px; }
.effect-row dd small { font-size: 11px; }
.inventory-label { font-size: 11px; }
.inventory p { font-size: 11px; }
.inventory-chips span { font-size: 10px; }
.relic-item strong { font-size: 13px; }
.relic-item small { font-size: 11px; }
.tour-score span { font-size: 10px; }
.journey-log li > span { font-size: 11px; }
.journey-log strong { font-size: 12px; }
.journey-log small { font-size: 10px; }
.ability-note, .conversion-note { font-size: 12px; }
.encounter-type, .encounter-floor { font-size: 11px; }
.encounter-copy .omen-text { font-size: 13px; }
.post-preview pre { font-size: 15px; line-height: 1.85; }
.check-info small { font-size: 10px; }
.check-info strong { font-size: 17px; }
.check-info span { font-size: 12px; }
.check-card code { font-size: 14px; }
.roll-input-label span, .roll-input-label small { font-size: 11px; }
.automatic-badge { font-size: 11px; }
.formula-card strong { font-size: 13px; }
.reward-panel > p:not(.eyebrow), .reward-list li { font-size: 14px; }
.reward-stat-grid span, .reward-stat-grid small { font-size: 11px; }
.ending-summary span, .score-equation span { font-size: 10px; }
.final-log summary, .tour-thresholds span { font-size: 11px; }
.tour-thresholds strong { font-size: 14px; }
.toast, .form-error { font-size: 12px; }

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .hero-art {
    transform: scale(0.8);
  }

  .creation-layout,
  .play-layout,
  .result-interlude-layout {
    grid-template-columns: 1fr;
  }

  .stats-builder,
  .run-sidebar {
    position: static;
  }

  .stats-builder {
    grid-row: 1;
  }

  .run-sidebar {
    grid-row: 1;
  }

  .play-main {
    grid-row: 2;
  }

  .character-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .character-card-head,
  .compact-stats {
    margin: 0;
  }

  .build-list,
  .inventory,
  .tour-score {
    grid-column: 1 / -1;
  }

  .journey-log {
    display: none;
  }
}

@media (max-width: 720px) {
  .shell,
  .site-footer,
  .ending-page,
  .ending-layout {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 68px;
    padding: 10px 14px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand strong {
    font-size: 13px;
  }

  .header-progress {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    padding-top: 8px;
  }

  .header-note,
  .progress-name {
    display: none;
  }

  .header-restart {
    grid-column: 2;
    grid-row: 1;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 10px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 60px;
  }

  .hero h1 {
    font-size: clamp(28px, 9vw, 36px);
  }

  .hero-art {
    min-height: 330px;
    transform: scale(0.78);
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .how-it-works {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .step-list {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .page-heading {
    padding-top: 42px;
  }

  .creation-main {
    padding: 0 18px;
  }

  .form-section {
    grid-template-columns: 30px 1fr;
    gap: 8px;
  }

  .class-grid,
  .option-grid {
    grid-template-columns: 1fr 1fr;
  }

  .choice-card {
    padding: 13px;
  }

  .choice-card small {
    display: none;
  }

  .stats-builder {
    padding: 18px;
  }

  .creation-summary {
    flex-wrap: wrap;
  }

  .play-layout {
    padding-top: 16px;
  }

  .character-card {
    display: block;
  }

  .character-card-head {
    margin-bottom: 15px;
  }

  .compact-stats {
    margin-bottom: 15px;
  }

  .build-list,
  .inventory {
    margin-top: 12px;
  }

  .boss-gate-card {
    grid-template-columns: 64px 1fr;
    min-height: 180px;
    padding: 24px 20px;
  }

  .boss-gate-icon {
    width: 60px;
    height: 60px;
    font-size: 30px;
  }

  .boss-gate-arrow {
    display: none;
  }

  .post-preview {
    height: 290px;
  }

  .encounter-card {
    grid-template-columns: 1fr;
  }

  .encounter-visual {
    min-height: 150px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .encounter-copy {
    padding: 20px 18px;
  }

  .judgement-section,
  .reward-panel {
    padding: 20px 14px;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .check-card,
  .check-card.is-automatic {
    grid-template-columns: 34px 1fr;
  }

  .check-card code,
  .check-card .dice-command-block,
  .check-card .roll-input-label,
  .automatic-badge {
    grid-column: 2;
  }

  .reward-stat-grid {
    grid-template-columns: repeat(5, minmax(50px, 1fr));
    overflow-x: auto;
  }

  .reward-claim-grid,
  .relic-choice-grid {
    grid-template-columns: 1fr 1fr;
  }

  .reward-claim-card {
    min-height: 190px;
  }

  .outcome-card {
    padding: 42px 24px;
  }

  .result-interlude {
    min-height: 280px;
    padding: 42px 24px;
  }

  .result-interlude-panel {
    padding: 24px 12px;
  }

  .ending-page {
    min-height: 620px;
    padding: 50px 18px;
  }

  .ending-hero {
    min-height: 460px;
  }

  .ending-record {
    padding: 28px 18px;
  }

  .ending-record-heading {
    align-items: flex-start;
  }

  .ending-record-heading .button {
    padding-inline: 12px;
  }

  .ending-record pre {
    padding: 18px 15px;
    font-size: 11px;
  }

  .ending-summary {
    grid-template-columns: 1fr 1fr;
  }

  .ending-summary div:nth-child(2) {
    border-right: 0;
  }

  .ending-summary div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .ending-actions {
    width: 100%;
    flex-direction: column;
  }

  .tour-final-card {
    padding: 28px 20px;
  }

  .score-equation {
    display: grid;
    grid-template-columns: 1fr 24px 1fr;
  }

  .score-equation > div {
    min-width: 0;
  }

  .score-equation .score-total {
    grid-column: 1 / -1;
  }

  .score-equation > b:last-of-type {
    display: none;
  }

  .tour-thresholds {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .reward-claim-grid,
  .relic-choice-grid {
    grid-template-columns: 1fr;
  }

  .reward-claim-card {
    min-height: 165px;
  }

  .reward-claim-heading,
  .claimed-reward-note {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .result-interlude {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none !important;
  }
}
