﻿:root {
  --bg: #09141b;
  --bg-alt: #112431;
  --card: rgba(11, 25, 36, 0.82);
  --card-strong: rgba(18, 37, 49, 0.95);
  --ink: #ecf2ef;
  --muted: #91aab6;
  --accent: #ffd166;
  --accent-strong: #ff8c42;
  --teal: #67d5c2;
  --danger: #ff6b6b;
  --success: #84f1b6;
  --border: rgba(236, 242, 239, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --display: Georgia, "Times New Roman", serif;
  --ui: "Trebuchet MS", "Yu Gothic UI", "Hiragino Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ui);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(103, 213, 194, 0.15), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(255, 140, 66, 0.18), transparent 20%),
    linear-gradient(160deg, #050b10 0%, #09141b 45%, #0d202c 100%);
}

body.battle-screen-open {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.battle-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: auto;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(98, 134, 194, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.88));
  backdrop-filter: blur(8px);
}

.battle-screen.hidden {
  display: none;
}

.hero {
  display: grid;
  grid-template-columns: 2fr minmax(240px, 320px);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-panel,
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 28px;
}

.hero-copy::after,
.card::after,
.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -20% -60% 50%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(103, 213, 194, 0.18), transparent 70%);
}

.hero h1,
.card h2,
.card h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.4rem);
  line-height: 0.98;
  margin-top: 8px;
}

.hero-cta-row {
  align-items: center;
  margin-top: 18px;
}

.hero-cta-button {
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 22px;
  box-shadow: 0 18px 34px rgba(255, 140, 66, 0.24);
}

.hero-text,
.muted,
.status-line,
.unit-meta,
.panel-label {
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
  color: var(--accent);
}

.hero-panel {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.stat-panel {
  align-content: start;
}

.hero-panel strong {
  display: block;
  margin-top: 6px;
  font-size: 1.8rem;
}

.audio-card {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid rgba(236, 242, 239, 0.1);
  border-radius: 18px;
  background: rgba(4, 11, 17, 0.42);
}

.audio-card strong {
  font-size: 1.2rem;
}

.audio-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.audio-volume {
  display: grid;
  gap: 8px;
  margin: 0;
}

.audio-volume span {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audio-volume input[type="range"] {
  width: 100%;
  margin: 0;
}

.layout {
  display: grid;
  gap: 24px;
}

.card {
  padding: 24px;
}

.guide-card {
  border-color: rgba(255, 209, 102, 0.22);
  background:
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.1), transparent 28%),
    var(--card);
}

.guide-panel {
  display: grid;
  gap: 12px;
}

.guide-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.guide-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.14);
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guide-detail {
  margin: 0;
  color: var(--ink);
}

.guide-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.guide-primary-button {
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(255, 140, 66, 0.24);
}

.section-locked {
  opacity: 0.56;
}

.section-current {
  border-color: rgba(255, 209, 102, 0.32);
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.12), var(--shadow);
}

.tutorial-overlay {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  width: min(420px, calc(100vw - 24px));
}

.tutorial-overlay.hidden {
  display: none;
}

.tutorial-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 209, 102, 0.22);
  border-radius: 18px;
  background: rgba(8, 17, 24, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.tutorial-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.tutorial-close {
  white-space: nowrap;
}

.battle-tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.36);
}

.battle-tutorial-card {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(255, 209, 102, 0.24);
  border-radius: 18px;
  background: rgba(8, 17, 24, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.section-head,
.button-row,
.run-grid,
.import-grid {
  display: flex;
  gap: 14px;
}

.section-head {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.compact-head {
  margin: 12px 0 14px;
  align-items: center;
}

.collapse-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 14px 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(236, 242, 239, 0.1);
  border-radius: 16px;
  background: rgba(4, 11, 17, 0.38);
}

.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.challenge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.challenge-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.challenge-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border: 1px solid rgba(236, 242, 239, 0.12);
  border-radius: 999px;
  background: rgba(4, 11, 17, 0.4);
}

.challenge-pill.rarity-common,
.challenge-pill.rarity-rare,
.challenge-pill.rarity-epic,
.challenge-pill.rarity-legend,
.recommend-band-button.rarity-common,
.recommend-band-button.rarity-rare,
.recommend-band-button.rarity-epic,
.recommend-band-button.rarity-legend {
  border-color: var(--rarity-edge);
  box-shadow: inset 0 0 0 1px var(--rarity-glow);
}

.challenge-pill span {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.challenge-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
}

.toolbar-field {
  flex: 1 1 220px;
  display: grid;
  gap: 8px;
  margin: 0;
}

.toolbar-field span {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(236, 242, 239, 0.12);
  border-radius: 14px;
  background: rgba(4, 11, 17, 0.38);
  color: var(--muted);
}

.toolbar-check input {
  width: auto;
  margin: 0;
}

.collapse-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.collapse-button {
  white-space: nowrap;
}

.import-grid,
.run-grid {
  flex-wrap: wrap;
}

.import-panel,
.run-panel {
  flex: 1 1 280px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: var(--card-strong);
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

textarea,
input,
button {
  font: inherit;
}

textarea,
input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(236, 242, 239, 0.14);
  border-radius: 14px;
  background: rgba(2, 8, 14, 0.55);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  color: #17232d;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.ghost-button {
  color: var(--ink);
  border: 1px solid var(--border);
  background: transparent;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 11px 18px;
  text-decoration: none;
}

.status-line {
  min-height: 1.4em;
  margin: 14px 0 0;
}

.status-line.error {
  color: var(--danger);
}

.status-line.success {
  color: var(--success);
}

.roster-list,
.recommendation-panel,
.synergy-panel,
.story-panel,
.sphere-list,
.party-panel,
.battle-log,
.history-panel,
.relic-panel,
.encounter-panel,
.map-track {
  display: grid;
  gap: 12px;
}

.roster-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.recommendation-panel {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 209, 102, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.12), rgba(103, 213, 194, 0.08)),
    rgba(9, 20, 29, 0.82);
}

.recommendation-panel.empty-state {
  background: transparent;
}

.recommendation-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.recommendation-head strong {
  display: block;
  margin-top: 4px;
  font-family: var(--display);
  font-size: 1.2rem;
}

.recommendation-band-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.recommend-band-button {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(236, 242, 239, 0.12);
  border-radius: 16px;
  background: rgba(4, 11, 17, 0.42);
  color: var(--ink);
  text-align: left;
}

.recommend-band-button span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recommend-band-button strong {
  font-size: 0.95rem;
  line-height: 1.4;
}

.recommend-band-button.active {
  border-color: rgba(255, 209, 102, 0.42);
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.18) inset;
}

.recommendation-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recommendation-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.recommendation-list li + li {
  margin-top: 6px;
}

.synergy-line {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 0.95rem;
}

.synergy-panel {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(103, 213, 194, 0.24);
  background:
    linear-gradient(160deg, rgba(103, 213, 194, 0.09), rgba(255, 209, 102, 0.05)),
    rgba(7, 18, 27, 0.78);
}

.synergy-panel.empty-state {
  background: transparent;
}

.synergy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.synergy-metric {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(4, 11, 17, 0.46);
}

.synergy-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.synergy-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.15rem;
}

.unit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.unit-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(236, 242, 239, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.78rem;
}

.unit-card {
  position: relative;
  display: grid;
  gap: 14px;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 209, 102, 0.08), transparent 55%),
    rgba(16, 34, 46, 0.9);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.story-panel {
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 209, 102, 0.22);
  background:
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(103, 213, 194, 0.04)),
    rgba(7, 18, 27, 0.86);
}

.selected-party-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.selected-party-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 209, 102, 0.08), transparent 50%),
    rgba(7, 18, 27, 0.82);
}

.selected-party-portrait {
  position: relative;
  min-height: 164px;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(236, 242, 239, 0.12);
  background:
    linear-gradient(140deg, var(--portrait-a, rgba(255, 209, 102, 0.25)), var(--portrait-b, rgba(103, 213, 194, 0.18))),
    rgba(7, 18, 27, 0.85);
}

.selected-party-controls,
.selected-party-head {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.selected-party-info {
  display: grid;
  gap: 10px;
}

.inline-button {
  min-height: 36px;
  padding: 0 12px;
}

.story-panel.empty-state {
  background: transparent;
}

.story-panel strong {
  display: block;
  margin: 6px 0 10px;
  font-family: var(--display);
  font-size: 1.3rem;
}

.story-panel p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.unit-card.selected {
  border-color: rgba(255, 209, 102, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.4), 0 16px 40px rgba(255, 140, 66, 0.16);
}

.unit-card.favorite,
.sphere-card-item.favorite {
  box-shadow: 0 0 0 1px rgba(255, 215, 102, 0.32), 0 18px 46px rgba(255, 209, 102, 0.12);
}

.unit-card:focus-visible {
  outline: 2px solid rgba(255, 209, 102, 0.7);
  outline-offset: 3px;
}

.rarity-common {
  --rarity-edge: rgba(132, 163, 180, 0.34);
  --rarity-glow: rgba(132, 163, 180, 0.12);
}

.rarity-rare {
  --rarity-edge: rgba(103, 213, 194, 0.42);
  --rarity-glow: rgba(103, 213, 194, 0.12);
}

.rarity-epic {
  --rarity-edge: rgba(255, 140, 66, 0.5);
  --rarity-glow: rgba(255, 140, 66, 0.14);
}

.rarity-legend {
  --rarity-edge: rgba(255, 209, 102, 0.6);
  --rarity-glow: rgba(255, 209, 102, 0.18);
}

.unit-portrait {
  position: relative;
  min-height: 228px;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(236, 242, 239, 0.12);
  background:
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.2), transparent 20%),
    linear-gradient(140deg, var(--portrait-a, rgba(255, 209, 102, 0.25)), var(--portrait-b, rgba(103, 213, 194, 0.18))),
    rgba(7, 18, 27, 0.85);
}

.unit-portrait::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 14px;
  border: 1px solid var(--rarity-edge, rgba(255, 255, 255, 0.12));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 24px var(--rarity-glow, transparent);
}

.portrait-glyph,
.portrait-note {
  position: absolute;
  z-index: 1;
}

.portrait-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 56%;
  padding: 10px;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.32));
}

.portrait-glyph {
  left: 16px;
  bottom: 12px;
  font-family: var(--display);
  font-size: 2.1rem;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.06em;
}

.portrait-note {
  top: 14px;
  right: 14px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.unit-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.card-controls {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.rarity-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(5, 12, 18, 0.66);
  border: 1px solid var(--rarity-edge, rgba(255, 255, 255, 0.12));
  color: rgba(255, 248, 225, 0.92);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  backdrop-filter: blur(10px);
}

.favorite-button {
  pointer-events: auto;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 12, 18, 0.66);
  color: rgba(255, 236, 166, 0.92);
  font-size: 1rem;
  line-height: 1;
  box-shadow: none;
}

.favorite-button[aria-pressed="true"] {
  border-color: rgba(255, 209, 102, 0.55);
  background: rgba(255, 209, 102, 0.16);
}

.info-button {
  color: rgba(208, 235, 255, 0.92);
}

.unit-name {
  margin: 0;
  font-family: var(--display);
  font-size: 1.25rem;
}

.unit-meta {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.unit-role,
.pill,
.node-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(103, 213, 194, 0.12);
  color: var(--teal);
  font-size: 0.82rem;
}

.unit-stats,
.party-unit-stats,
.history-entry,
.encounter-stats {
  display: grid;
  gap: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.stat-row strong {
  color: var(--ink);
}

.empty-state {
  padding: 20px;
  border: 1px dashed rgba(236, 242, 239, 0.18);
  border-radius: 16px;
  color: var(--muted);
}

.map-track {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.map-node {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(5, 15, 23, 0.45);
}

.map-theme {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 209, 102, 0.26);
  background:
    linear-gradient(150deg, rgba(255, 209, 102, 0.1), rgba(103, 213, 194, 0.06)),
    rgba(8, 18, 27, 0.72);
}

.map-theme strong {
  font-family: var(--display);
  font-size: 1.15rem;
}

.map-theme-meta,
.mission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.mission-complete {
  background: rgba(132, 241, 182, 0.16);
  color: var(--success);
}

.map-node.current {
  border-color: rgba(255, 209, 102, 0.85);
  background: rgba(255, 209, 102, 0.12);
}

.map-node.cleared {
  border-color: rgba(132, 241, 182, 0.45);
}

.encounter-card,
.party-unit,
.log-line,
.history-entry,
.relic-item,
.choice-card,
.sphere-card-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: rgba(4, 11, 17, 0.52);
}

.choice-warning {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  color: #ffb0b0;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.choice-card.selectable {
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.choice-card.selectable:hover,
.choice-card.selectable:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 209, 102, 0.24);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.sphere-list {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.sphere-card-item {
  position: relative;
  display: grid;
  gap: 12px;
}

.sphere-preview {
  position: relative;
  min-height: 180px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(236, 242, 239, 0.12);
  background:
    linear-gradient(140deg, var(--portrait-a, rgba(255, 209, 102, 0.25)), var(--portrait-b, rgba(103, 213, 194, 0.18))),
    rgba(7, 18, 27, 0.85);
}

.sphere-preview .portrait-image {
  object-fit: contain;
  object-position: center center;
  padding: 14px;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.24));
}

.sphere-card-item .card-controls {
  top: 24px;
}

.detail-modal {
  width: min(960px, calc(100% - 24px));
  padding: 0;
  border: none;
  background: transparent;
}

.detail-modal::backdrop {
  background: rgba(2, 8, 14, 0.72);
  backdrop-filter: blur(8px);
}

.detail-modal-card {
  border-radius: 24px;
  border: 1px solid rgba(236, 242, 239, 0.12);
  background:
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.12), transparent 24%),
    rgba(8, 18, 27, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  padding: 22px;
}

.detail-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.detail-body,
.detail-stack,
.detail-section,
.detail-list {
  display: grid;
  gap: 12px;
}

.detail-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

.detail-visual {
  display: flex;
}

.detail-portrait {
  position: relative;
  width: 100%;
  min-height: 360px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(236, 242, 239, 0.12);
  background:
    linear-gradient(140deg, var(--portrait-a, rgba(255, 209, 102, 0.25)), var(--portrait-b, rgba(103, 213, 194, 0.18))),
    rgba(7, 18, 27, 0.85);
}

.detail-portrait .portrait-image {
  object-fit: contain;
  object-position: center center;
  padding: 16px;
}

.detail-section {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(236, 242, 239, 0.1);
  background: rgba(4, 11, 17, 0.34);
}

.detail-section strong {
  font-family: var(--display);
  font-size: 1.05rem;
}

.detail-section p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.collapsed-state {
  display: block;
}

.collapsed-message {
  padding: 16px 18px;
  border: 1px dashed rgba(236, 242, 239, 0.16);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(4, 11, 17, 0.28);
}

.sphere-info strong {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
}

.encounter-scene {
  position: relative;
  overflow: hidden;
  min-height: 128px;
  margin-bottom: 14px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(236, 242, 239, 0.12);
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.16), transparent 18%),
    linear-gradient(140deg, var(--scene-a, rgba(255, 209, 102, 0.18)), var(--scene-b, rgba(103, 213, 194, 0.12))),
    rgba(7, 18, 27, 0.7);
}

.encounter-scene::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% 55%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
}

.encounter-scene strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 8px;
  font-family: var(--display);
  font-size: 1.25rem;
}

.encounter-scene p {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 42ch;
  color: rgba(236, 242, 239, 0.84);
  line-height: 1.6;
}

.encounter-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.3rem;
}

.encounter-action-bar {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 209, 102, 0.18);
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(255, 209, 102, 0.08), rgba(255, 140, 66, 0.06));
}

.encounter-action-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.encounter-action-note p {
  margin: 0;
  color: var(--muted);
}

.encounter-action-kicker {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.encounter-primary-button,
.choice-primary-button {
  width: 100%;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 18px;
  box-shadow: 0 16px 30px rgba(255, 140, 66, 0.2);
}

.retro-mode .encounter-card {
  background:
    linear-gradient(180deg, rgba(2, 4, 8, 0.96), rgba(6, 12, 22, 0.96));
}

.retro-battle-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.retro-battle-card {
  display: grid;
  gap: 14px;
}

.retro-screen,
.retro-box,
.retro-status-panel {
  border: 3px solid rgba(239, 246, 255, 0.72);
  border-radius: 10px;
  background: #05080d;
  box-shadow: inset 0 0 0 2px rgba(113, 145, 183, 0.25);
}

.retro-screen {
  min-height: 260px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(8, 18, 31, 0.92), rgba(5, 8, 13, 0.98));
}

.retro-enemies {
  display: grid;
  gap: 10px;
}

.retro-enemy-head,
.retro-status-row,
.retro-enemy-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.retro-enemy-head strong {
  justify-self: end;
}

.retro-enemy-head span,
.retro-enemy-hp,
.retro-status-row span {
  color: #d6e5ff;
}

.retro-enemy-row {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(214, 229, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #f4f8ff;
  box-shadow: none;
}

.retro-enemy-row:disabled {
  opacity: 1;
}

.retro-enemy-portrait {
  position: relative;
  display: block;
  width: 52px;
  min-width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(214, 229, 255, 0.18);
  background:
    linear-gradient(140deg, var(--portrait-a, rgba(255, 209, 102, 0.25)), var(--portrait-b, rgba(103, 213, 194, 0.18))),
    rgba(7, 18, 27, 0.85);
}

.retro-enemy-index {
  color: #a8c4ff;
}

.retro-enemy-name {
  font-family: var(--display);
  font-size: 1.08rem;
  text-align: left;
}

.retro-empty {
  padding-top: 28px;
  color: #f4f8ff;
  font-family: var(--display);
  font-size: 1.2rem;
  text-align: center;
}

.retro-status-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.retro-status-row {
  grid-template-columns: minmax(110px, 1.3fr) repeat(3, auto);
  padding: 8px 10px;
  color: #f5f8ff;
}

.retro-status-row.down {
  opacity: 0.58;
}

.retro-menu-stack {
  display: grid;
  gap: 12px;
}

.retro-box {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.retro-box strong {
  font-family: var(--display);
  color: #fff8d9;
  font-size: 1.18rem;
}

.retro-box p,
.retro-log-box div {
  margin: 0;
  line-height: 1.6;
  color: #eaf1ff;
}

.retro-command-grid,
.retro-target-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.retro-command-button,
.retro-target-button {
  min-height: 56px;
  border-radius: 8px;
  border: 2px solid rgba(227, 236, 255, 0.66);
  background: linear-gradient(180deg, #17243a, #0e1625);
  color: #f8fbff;
  box-shadow: none;
}

.retro-command-button:hover:not(:disabled),
.retro-target-button:hover {
  background: linear-gradient(180deg, #243858, #152235);
}

.retro-command-button:disabled {
  opacity: 0.4;
}

.retro-log-box {
  min-height: 138px;
}

.dq6-battle-shell {
  width: min(1180px, 100%);
  gap: 16px;
}

.dq6-battle-main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.dq6-battle-dock {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
  gap: 14px;
}

.dq6-battle-stage {
  min-height: 420px;
  padding: 18px 18px 22px;
  background:
    radial-gradient(circle at 50% 8%, rgba(115, 171, 255, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(11, 28, 51, 0.96), rgba(5, 10, 20, 0.98));
}

.dq6-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: #edf4ff;
}

.dq6-stage-kicker {
  display: block;
  margin-bottom: 4px;
  color: #9dc1ff;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.dq6-stage-header strong {
  display: block;
  font-family: var(--display);
  font-size: 1.56rem;
  color: #fff7cf;
}

.dq6-stage-badge {
  padding: 6px 12px;
  border: 1px solid rgba(211, 228, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #dce9ff;
  font-size: 0.82rem;
}

.dq6-stage-callout {
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid rgba(217, 230, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff3cb;
  line-height: 1.55;
}

.dq6-enemy-stage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
}

.dq6-enemy-stage-grid.solo {
  grid-template-columns: minmax(0, 1fr);
}

.dq6-enemy-stage-card {
  display: grid;
  gap: 10px;
  align-content: end;
  min-height: 300px;
}

.dq6-enemy-stage-card.solo {
  min-height: 340px;
}

.dq6-stage-portrait {
  width: 100%;
  min-width: 0;
  height: 240px;
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid rgba(216, 230, 255, 0.18);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 244, 184, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(13, 28, 49, 0.6), rgba(6, 10, 18, 0.18));
}

.dq6-stage-portrait.solo {
  max-width: 460px;
  height: 310px;
}

.dq6-stage-caption {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(214, 229, 255, 0.18);
  border-radius: 10px;
  background: rgba(4, 9, 18, 0.72);
  color: #f1f6ff;
}

.dq6-stage-caption strong {
  font-family: var(--display);
  font-size: 1.02rem;
  text-align: left;
}

.dq6-stage-caption span:last-child {
  color: #bed5ff;
}

.dq6-stage-enemy-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff2c4;
  font-size: 0.86rem;
}

.dq6-stage-clear {
  min-height: 240px;
  display: grid;
  place-items: center;
}

.dq6-status-panel {
  gap: 10px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(9, 19, 34, 0.98), rgba(3, 7, 13, 0.98));
}

.dq6-status-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(213, 229, 255, 0.12);
}

.dq6-status-head strong {
  font-family: var(--display);
  color: #fff3c2;
  font-size: 1.12rem;
}

.dq6-status-head span {
  color: #a7c6ff;
  font-size: 0.82rem;
}

.dq6-status-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(214, 229, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.dq6-status-row.current {
  border-color: rgba(255, 219, 118, 0.5);
  background: rgba(255, 208, 106, 0.08);
}

.dq6-status-row.queued {
  box-shadow: inset 0 0 0 1px rgba(109, 232, 180, 0.18);
}

.dq6-status-name,
.dq6-status-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dq6-status-name strong {
  font-size: 1rem;
}

.dq6-status-name small {
  color: #a8bfeb;
}

.dq6-status-values {
  color: #dfebff;
  font-size: 0.92rem;
}

.dq6-status-action {
  color: #fff1b8;
  font-size: 0.88rem;
}

.dq6-command-box,
.dq6-log-box {
  min-height: 200px;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(5, 11, 21, 0.98), rgba(2, 6, 12, 0.98));
}

.dq6-window-title {
  display: inline-block;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 229, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #9fc2ff;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dq6-log-lines {
  display: grid;
  gap: 8px;
}

.dq6-log-focus {
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(37, 51, 79, 0.95), rgba(18, 26, 42, 0.95));
  border: 1px solid rgba(246, 228, 162, 0.32);
  color: #fff7da;
  font-size: 1rem;
  line-height: 1.7;
}

.dq6-log-lines div {
  padding-left: 2px;
  color: #ccdbf8;
  font-size: 0.9rem;
}

.retro-target-button,
.retro-command-button {
  display: grid;
  gap: 4px;
  text-align: left;
  align-content: center;
  position: relative;
  padding-left: 38px;
}

.retro-command-button strong,
.retro-target-button strong {
  font-size: 1rem;
  color: #fff7d2;
}

.retro-command-button span,
.retro-target-button span {
  color: #b9cff5;
  font-size: 0.82rem;
}

.retro-command-button::before,
.retro-target-button::before {
  content: "▶";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  color: #ffe28b;
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
}

.retro-command-button:hover::before,
.retro-command-button:focus-visible::before,
.retro-target-button:hover::before,
.retro-target-button:focus-visible::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.dq6-primary-button,
.dq6-secondary-button {
  min-height: 56px;
}

.dq6-primary-button {
  border-radius: 10px;
  border: 2px solid rgba(246, 224, 145, 0.55);
  background: linear-gradient(180deg, #725319, #4f3510);
  color: #fff8de;
}

.dq6-primary-button:hover {
  background: linear-gradient(180deg, #886120, #5a3c11);
}

.battle-resolution-card {
  display: grid;
  gap: 16px;
}

.battle-resolution-shell {
  align-content: center;
  min-height: calc(100vh - 48px);
}

.battle-resolution-card .encounter-title {
  margin-bottom: 0;
}

.battle-resolution-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.battle-resolution-narrative {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(236, 242, 239, 0.14);
  background: linear-gradient(180deg, rgba(10, 20, 32, 0.94), rgba(4, 10, 16, 0.94));
}

.battle-resolution-narrative strong {
  font-family: var(--display);
  color: #fff1bb;
  font-size: 1.08rem;
}

.battle-resolution-narrative p {
  margin: 0;
  color: #f4f8ff;
  line-height: 1.7;
}

.battle-resolution-card.victory {
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 215, 117, 0.08);
}

.battle-resolution-card.defeat {
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 100, 120, 0.08);
}

.command-panel {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.command-console,
.command-hint {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(236, 242, 239, 0.14);
  background:
    linear-gradient(180deg, rgba(9, 18, 28, 0.92), rgba(3, 9, 14, 0.94));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.command-console strong,
.command-hint {
  font-family: var(--display);
}

.command-console strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.12rem;
  color: #fff2c9;
}

.command-console p,
.command-hint {
  margin: 0;
  line-height: 1.6;
}

.command-console p {
  color: var(--muted);
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.command-button {
  display: grid;
  gap: 6px;
  min-height: 94px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(236, 242, 239, 0.14);
  background:
    linear-gradient(160deg, rgba(17, 35, 48, 0.94), rgba(5, 14, 22, 0.94));
}

.command-button span {
  font-family: var(--display);
  font-size: 1.05rem;
  color: #fff2c9;
}

.command-button small {
  color: var(--muted);
  line-height: 1.45;
}

.command-button.active,
.command-button[aria-pressed="true"] {
  border-color: rgba(255, 209, 102, 0.72);
  background:
    linear-gradient(160deg, rgba(67, 39, 14, 0.9), rgba(18, 26, 34, 0.94));
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.22), 0 14px 28px rgba(0, 0, 0, 0.22);
}

.battle-theater {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 220px) 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(236, 242, 239, 0.1);
  background:
    radial-gradient(circle at center, rgba(255, 209, 102, 0.14), transparent 26%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(103, 213, 194, 0.04)),
    rgba(4, 11, 17, 0.44);
}

.battle-column {
  display: grid;
  gap: 10px;
}

.battle-center {
  display: grid;
  gap: 8px;
  text-align: center;
  justify-items: center;
}

.battle-center strong {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.08em;
}

.battle-command-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.14);
  color: #fff2c9;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.battle-center p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.battle-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--accent);
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}

.battle-actor {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(236, 242, 239, 0.12);
  background: rgba(8, 18, 27, 0.54);
}

.battle-actor-portrait {
  position: relative;
  min-height: 78px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(236, 242, 239, 0.12);
  background:
    linear-gradient(140deg, var(--portrait-a, rgba(255, 209, 102, 0.25)), var(--portrait-b, rgba(103, 213, 194, 0.18))),
    rgba(7, 18, 27, 0.85);
}

.battle-actor-portrait .portrait-image {
  object-fit: contain;
  object-position: center center;
  padding: 6px;
}

.enemy-image {
  object-fit: contain;
  object-position: center center;
  padding: 12px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
}

.battle-actor-meta {
  display: grid;
  gap: 4px;
}

.battle-actor-meta strong {
  font-size: 0.98rem;
}

.battle-actor-meta span {
  color: var(--muted);
  font-size: 0.84rem;
}

.battle-theater.result strong {
  color: var(--success);
}

.battle-theater.reward strong {
  color: var(--accent);
}

.battle-theater .battle-column.enemy .battle-actor {
  background: rgba(23, 9, 13, 0.48);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.choice-card button {
  width: 100%;
  margin-top: 12px;
}

.party-unit-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.hp-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.hp-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--success));
}

.log-line {
  font-size: 0.94rem;
  line-height: 1.45;
}

.history-entry strong,
.relic-item strong {
  display: block;
  margin-bottom: 6px;
}

.pill.atk,
.node-tag.battle {
  background: rgba(255, 140, 66, 0.14);
  color: #ffb489;
}

.pill.def,
.node-tag.camp {
  background: rgba(103, 213, 194, 0.14);
  color: #8de9db;
}

.pill.utility,
.node-tag.shrine {
  background: rgba(173, 166, 255, 0.14);
  color: #c7c3ff;
}

.node-tag.boss {
  background: rgba(255, 107, 107, 0.16);
  color: #ffc0c0;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .dq6-battle-main,
  .dq6-battle-dock {
    grid-template-columns: 1fr;
  }

  .dq6-enemy-stage-grid {
    grid-template-columns: 1fr;
  }

  .dq6-stage-caption {
    grid-template-columns: 1fr;
    justify-items: start;
  }

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

  .retro-enemy-head,
  .retro-enemy-row,
  .retro-status-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .retro-command-grid,
  .retro-target-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 18px;
  }

  .section-head {
    flex-direction: column;
  }

  .collapse-head {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-toolbar {
    flex-direction: column;
  }

  .toolbar-check {
    width: 100%;
    justify-content: flex-start;
  }

  .collapse-button {
    width: 100%;
  }

  .roster-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .selected-party-panel {
    grid-template-columns: 1fr;
  }

  .unit-portrait {
    min-height: 192px;
  }

  .sphere-list {
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  }

  .sphere-preview {
    min-height: 154px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-portrait {
    min-height: 280px;
  }

  .battle-theater {
    grid-template-columns: 1fr;
  }
}
.wrap-row {
  flex-wrap: wrap;
}

.session-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(4, 11, 17, 0.52);
  margin-bottom: 14px;
}
