:root {
  --paper: #f7eedc;
  --paper-strong: #fffbf2;
  --ink: #1d1a19;
  --ink-soft: rgba(29, 26, 25, 0.72);
  --sky: #2f6175;
  --sky-soft: rgba(47, 97, 117, 0.28);
  --sun: #d9873a;
  --moss: #5c7051;
  --night: #102532;
  --danger: #7a2f28;
  --panel: rgba(16, 26, 34, 0.72);
  --panel-strong: rgba(14, 20, 28, 0.88);
  --line: rgba(247, 238, 220, 0.18);
  --shadow: 0 28px 60px rgba(10, 14, 20, 0.28);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --max-width: 1180px;
  --dialogue-overlap: 220px;
  color: var(--paper);
  font-family: "M PLUS Rounded 1c", sans-serif;
  line-height: 1.55;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(217, 135, 58, 0.32), transparent 36%),
    radial-gradient(circle at bottom right, rgba(92, 112, 81, 0.26), transparent 28%),
    linear-gradient(160deg, #132e3b 0%, #1e4050 48%, #2e2a28 100%);
  color: var(--paper);
  overflow-x: hidden;
}

body::before {
  background:
    linear-gradient(transparent 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 18px
    );
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a.button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  pointer-events: auto;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell,
.game-shell {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 24px;
  position: relative;
  z-index: 1;
}

.title-shell {
  align-items: stretch;
  display: grid;
  gap: 24px;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  padding-block: 32px;
}

.title-shell:has(.title-side[hidden]) .title-hero {
  grid-column: 1 / -1;
}

.panel-surface {
  backdrop-filter: blur(16px);
  background: linear-gradient(160deg, rgba(17, 28, 35, 0.82), rgba(15, 20, 28, 0.7));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.compact-panel {
  border-radius: 22px;
}

.title-hero,
.title-side {
  overflow: hidden;
  padding: 32px;
  position: relative;
}

.title-hero {
  position: relative;
  overflow: hidden;
}

.title-hero-background {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  inset: 0;
  opacity: 0;
  position: absolute;
  transition: opacity 2s ease-in-out;
}

.title-hero-background.fade-in {
  opacity: 1;
}

.title-hero-background.fade-out {
  opacity: 0;
}

.title-hero::before {
  background: rgba(0, 0, 0, 0.75);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.title-hero::after,
.title-side::after,
.stage-frame::after {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 62%);
  content: "";
  inset: auto -15% -45% auto;
  pointer-events: none;
  position: absolute;
  width: 280px;
  height: 280px;
}

.eyebrow,
.side-label {
  color: rgba(247, 238, 220, 0.7);
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.title-heading,
.side-heading,
.modal-card h2,
.hud-scene-title {
  font-family: "Chelsea Market", cursive;
  letter-spacing: 0.04em;
  margin: 0;
}

.title-heading {
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.06;
  margin-inline: auto;
  margin-top: 32px;
  white-space: nowrap;
  text-align: center;
  -webkit-text-stroke: 10px var(#000);
  paint-order: stroke fill;
  position: relative;
  z-index: 1;
}

.title-copy {
  color: rgba(247, 238, 220, 0.84);
  font-family: "Chelsea Market", cursive;
  margin: 18px auto 0;
  max-width: 38rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.side-copy,
.prose-block p {
  color: rgba(247, 238, 220, 0.84);
  margin: 18px auto 0;
  max-width: 38rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.title-actions,
.hud-actions,
.hud-pills,
.dialogue-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.title-actions {
  margin-top: 28px;
  margin-bottom: 32px;
  justify-content: center;
}

.title-actions .button {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
  text-align: center;
}

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  padding: 12px 20px;
  pointer-events: auto;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

/* Hover effects - exclude disabled buttons */
.button:not(:disabled):hover,
.button:not(:disabled):focus-visible,
.icon-button:not(:disabled):hover,
.icon-button:not(:disabled):focus-visible,
.button-primary:not(:disabled):hover,
.button-primary:not(:disabled):focus-visible,
.button-secondary:not(:disabled):hover,
.button-secondary:not(:disabled):focus-visible,
.button-ghost:not(:disabled):hover,
.button-ghost:not(:disabled):focus-visible,
.choice-button:not(:disabled):hover,
.choice-button:not(:disabled):focus-visible,
.slot-card:not(:disabled):hover,
.slot-card:not(:disabled):focus-visible {
  transform: translateY(-1px);
}

.button:disabled,
.button-secondary:disabled,
.button-ghost:disabled {
  pointer-events: none;
}

/* Focus outline - exclude disabled buttons */
.button:not(:disabled):focus-visible,
.icon-button:not(:disabled):focus-visible,
.button-primary:not(:disabled):focus-visible,
.button-secondary:not(:disabled):focus-visible,
.button-ghost:not(:disabled):focus-visible,
.choice-button:not(:disabled):focus-visible,
.slot-card:not(:disabled):focus-visible {
  outline: 2px solid rgba(247, 238, 220, 0.72);
  outline-offset: 2px;
}

.button-primary {
  background: linear-gradient(135deg, var(--sun), #f0b067);
  color: #1e1611;
  font-weight: 700;
}

.button-secondary {
  background: rgba(247, 238, 220, 0.1);
  color: var(--paper);
}

/* Hover effects for button-secondary (exclude disabled) */
.button-secondary:not(:disabled):hover,
.button-secondary:not(:disabled):focus-visible,
.button-ghost:not(:disabled):hover,
.button-ghost:not(:disabled):focus-visible,
.icon-button:not(:disabled):hover,
.icon-button:not(:disabled):focus-visible {
  border-color: var(--sun);
  color: var(--sun);
}

.button-secondary:not(:disabled):hover,
.button-secondary:not(:disabled):focus-visible {
  background: rgba(255, 212, 112, 0.12);
}

.button-secondary:disabled {
  background: rgba(247, 238, 220, 0.06);
  color: rgba(247, 238, 220, 0.42);
  cursor: not-allowed;
  transform: none;
}

.button-ghost,
.icon-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: linear-gradient(135deg, rgba(154, 104, 20, 0.92), rgba(122, 82, 14, 0.9));
  border-color: var(--sun);
  color: var(--sun);
}

.title-meta {
  display: grid;
  gap: 14px;
  margin: 32px 0 0;
}

.title-meta dt {
  color: rgba(247, 238, 220, 0.62);
  font-size: 0.9rem;
}

.title-meta dd {
  margin: 4px 0 0;
}

.side-note {
  border-top: 1px solid var(--line);
  color: rgba(247, 238, 220, 0.72);
  margin-top: 24px;
  padding-top: 18px;
}

.side-note p,
.prose-block p {
  margin: 0 0 10px;
}

.side-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

.save-slot-card {
  background: linear-gradient(135deg, rgba(247, 238, 220, 0.12), rgba(247, 238, 220, 0.06));
  border: 1px solid rgba(247, 238, 220, 0.16);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 14px 18px;
  text-align: center;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease;
  width: 100%;
  position: relative;
  overflow: hidden;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hover effects - exclude empty slots */
.save-slot-card:not(.is-empty):hover,
.save-slot-card:not(.is-empty):focus-visible {
  border-color: var(--sun);
  color: var(--sun);
  transform: translateY(-1px);
}

.save-slot-card.is-empty {
  opacity: 0.5;
  cursor: not-allowed;
}

.save-slot-card.is-empty .save-slot-content {
  color: rgba(247, 238, 220, 0.5);
}

.save-slot-card:not(.is-empty) {
  cursor: pointer;
}

.save-slot-card:disabled,
.save-slot-card.is-empty {
  pointer-events: none;
}

.save-slot-card:not(.is-empty):hover {
  background: linear-gradient(135deg, rgba(255, 212, 112, 0.18), rgba(247, 238, 220, 0.08));
}

.save-slot-content {
  color: var(--paper);
  margin: 0;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.save-slot-background {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  inset: 0;
  opacity: 0.4;
  position: absolute;
  filter: saturate(0.9) brightness(0.85);
}

.save-slots-list {
  display: grid;
  gap: 12px;
  margin: 16px;
}

.title-side[hidden] {
  display: none;
}

.game-shell {
  display: grid;
  gap: 16px;
  min-height: 100vh;
}

.game-main {
  display: grid;
  gap: 0;
}

.stage-frame {
  border-radius: var(--radius-lg);
  min-height: clamp(660px, 82vh, 920px);
  overflow: hidden;
  position: relative;
}

.background-layer,
.background-image,
.background-gradient {
  inset: 0;
  position: absolute;
}

.background-image {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: saturate(0.98) brightness(0.98) contrast(0.97);
  transform: scale(1.03);
}

.background-gradient {
  background:
    linear-gradient(180deg, rgba(10, 18, 24, 0.18), transparent 30%),
    linear-gradient(0deg, rgba(10, 12, 18, 0.82), transparent 44%);
}

.character-stage {
  align-items: flex-end;
  display: flex;
  inset: 20px 0 0;
  justify-content: space-between;
  padding: 0 28px;
  pointer-events: none;
  position: absolute;
}

.character-stage::before {
  background: radial-gradient(ellipse at center, rgba(8, 12, 18, 0.02), transparent 72%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  backdrop-filter: blur(2px) saturate(0.94) brightness(0.98);
  -webkit-backdrop-filter: blur(2px) saturate(0.94) brightness(0.98);
  z-index: 0;
}

.character-slot {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  justify-content: flex-end;
  margin: 0;
  max-width: 30%;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 220ms ease, transform 220ms ease;
  position: relative;
  z-index: 1;
}

.character-slot.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.character-slot.is-visible.is-muted {
  opacity: 1;
}

.character-slot.is-visible.is-muted img {
  filter:
    grayscale(1)
    brightness(0.58)
    saturate(0.18)
    contrast(0.82)
    drop-shadow(0 26px 32px rgba(0, 0, 0, 0.24));
  opacity: 1;
  transition: filter 160ms ease, opacity 160ms ease;
}

.character-slot.is-visible.is-speaking img {
  filter: drop-shadow(0 26px 32px rgba(0, 0, 0, 0.24));
  opacity: 1;
}

.character-slot img {
  filter: drop-shadow(0 26px 32px rgba(0, 0, 0, 0.24));
  max-height: 100%;
  object-fit: contain;
  object-position: bottom center;
  transition: filter 160ms ease, opacity 160ms ease;
  transform-origin: bottom center;
  width: auto;
}

.sprite-bounce {
  animation: spriteBounce var(--sprite-bounce-duration, 240ms) cubic-bezier(0.16, 0.84, 0.24, 1);
}

@keyframes spriteBounce {
  0% { transform: translateY(0) scale(var(--sprite-scale, 1)); }
  20% { transform: translateY(-14px) scale(var(--sprite-scale, 1)); }
  40% { transform: translateY(0) scale(var(--sprite-scale, 1)); }
  60% { transform: translateY(-7px) scale(var(--sprite-scale, 1)); }
  80% { transform: translateY(-3px) scale(var(--sprite-scale, 1)); }
  100% { transform: translateY(0) scale(var(--sprite-scale, 1)); }
}

.character-slot figcaption {
  display: none;
}

.dialogue-wrap {
  inset: auto 18px 18px;
  position: absolute;
  z-index: 2;
}

.dialogue-panel {
  background: linear-gradient(180deg, rgba(14, 21, 31, 0.58), rgba(12, 18, 28, 0.78));
  border: 1px solid rgba(247, 238, 220, 0.16);
  box-shadow: 0 24px 52px rgba(8, 12, 18, 0.28);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: min(33vh, 280px);
  min-height: clamp(180px, 28vh, 240px);
  overflow: visible;
  pointer-events: auto;
  padding: 18px 22px 18px;
  position: relative;
  z-index: 3;
}

.toggle-actions-button {
  align-items: center;
  background: rgba(247, 238, 220, 0.1);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--paper);
  cursor: pointer;
  display: flex;
  font-size: 1.2rem;
  height: 36px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 18px;
  top: 12px;
  width: 36px;
  z-index: 5;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.toggle-actions-button:hover,
.toggle-actions-button:focus-visible {
  background: rgba(255, 212, 112, 0.12);
  border-color: var(--sun);
  color: var(--sun);
}

.dialogue-actions-panel {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  pointer-events: auto;
  position: absolute;
  right: 62px;
  top: 12px;
  z-index: 4;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.dialogue-actions-panel.is-visible {
  opacity: 1;
  transform: translateX(0);
  z-index: 6;
}

.dialogue-actions-panel .button {
  padding: 6px 16px;
}

.dialogue-panel .dialogue-header {
  padding-right: clamp(110px, 22vw, 210px);
}

.speaker-name {
  color: var(--paper-strong);
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0;
  min-height: 1.55em;
}

.speaker-name:empty {
  display: none;
  min-height: 0;
}

.input-hint,
.advance-hint {
  color: rgba(247, 238, 220, 0.6);
  font-size: 0.86rem;
  margin: 0;
}

.advance-hint {
  margin-top: 0;
  opacity: 0;
  text-align: right;
  transition: opacity 160ms ease;
  visibility: hidden;
}

.advance-hint.is-visible {
  opacity: 1;
  visibility: visible;
}

.dialogue-text {
  font-size: clamp(1.04rem, 2vw, 1.26rem);
  margin: 0;
  min-height: 4.2em;
  white-space: pre-wrap;
}

.dialogue-panel.has-choice .dialogue-text {
  min-height: 0;
}

.choice-panel {
  display: grid;
  gap: 10px;
  margin: 0 auto;
  max-height: min(32vh, 320px);
  overflow-y: auto;
  padding-right: 6px;
  width: min(100%, 700px);
}

.choice-panel.is-dual {
  align-items: stretch;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: none;
  overflow: visible;
  padding-right: 0;
  width: min(100%, 620px);
}

.choice-panel.is-dual .choice-button {
  min-height: 84px;
}

.choice-button,
.slot-card {
  background: linear-gradient(135deg, rgba(247, 238, 220, 0.12), rgba(247, 238, 220, 0.06));
  border: 1px solid rgba(247, 238, 220, 0.16);
  border-radius: var(--radius-md);
  color: var(--paper);
  padding: 14px 18px;
  text-align: center;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease;
  width: 100%;
}

.choice-button strong,
.slot-card strong {
  display: block;
  font-size: clamp(0.95rem, 1.6vw, 1rem);
  line-height: 1.45;
}

.choice-button strong,
.choice-button span {
  color: inherit;
}

.choice-button span,
.slot-card span,
.slot-card small {
  color: rgba(247, 238, 220, 0.72);
  display: block;
  margin-top: 4px;
}

.choice-button:hover,
.choice-button:focus-visible {
  border-color: var(--sun);
  color: var(--sun);
}

/* Hover effects for slot-card - exclude empty and disabled slots */
.slot-card:not(.is-empty):not(.is-disabled):hover,
.slot-card:not(.is-empty):not(.is-disabled):focus-visible {
  border-color: var(--sun);
  color: var(--sun);
}

.slot-card:not(.is-empty):not(.is-disabled):hover strong,
.slot-card:not(.is-empty):not(.is-disabled):focus-visible strong,
.slot-card:not(.is-empty):not(.is-disabled):hover span,
.slot-card:not(.is-empty):not(.is-disabled):focus-visible span,
.slot-card:not(.is-empty):not(.is-disabled):hover small,
.slot-card:not(.is-empty):not(.is-disabled):focus-visible small {
  color: var(--sun);
}

.slot-card:not(.is-empty):hover {
  background: linear-gradient(135deg, rgba(255, 212, 112, 0.18), rgba(247, 238, 220, 0.08));
}

.choice-button:hover {
  background: linear-gradient(135deg, rgba(255, 212, 112, 0.18), rgba(247, 238, 220, 0.08));
}

.choice-button:focus-visible {
  background: linear-gradient(135deg, rgba(255, 212, 112, 0.14), rgba(247, 238, 220, 0.08));
}

.slot-grid {
  display: grid;
  gap: 12px;
  margin: 12px 12px 12px;
}

.slot-card {
  background: linear-gradient(135deg, rgba(247, 238, 220, 0.12), rgba(247, 238, 220, 0.06));
  border: 1px solid rgba(247, 238, 220, 0.16);
  border-radius: var(--radius-md);
  padding: 0;
  position: relative;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.slot-card-main {
  background: transparent;
  border: 0;
  border-radius: inherit;
  color: inherit;
  cursor: pointer;
  display: block;
  padding: 0;
  text-align: inherit;
  width: 100%;
}

.slot-card-main:focus-visible {
  outline: 2px solid rgba(247, 238, 220, 0.72);
  outline-offset: 2px;
}

.slot-card-inner {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.slot-info {
  flex: 1;
  padding-right: 32px;
  text-align: left;
}

.slot-preview {
  border-radius: 16px;
  min-height: 96px;
  overflow: hidden;
  position: relative;
}

.slot-preview::after {
  background: linear-gradient(0deg, rgba(10, 12, 18, 0.6), transparent 60%);
  content: "";
  inset: 0;
  position: absolute;
}

.slot-preview-image {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  inset: 0;
  position: absolute;
}

.slot-card.is-empty .slot-preview {
  background: linear-gradient(135deg, rgba(247, 238, 220, 0.08), rgba(247, 238, 220, 0.04));
}

.slot-card:disabled,
.slot-card.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slot-card.is-disabled:hover {
  border-color: rgba(247, 238, 220, 0.16);
  color: var(--paper);
  transform: none;
}

.slot-card.is-disabled .slot-card-main {
  cursor: not-allowed;
  pointer-events: none;
}

.slot-delete-button {
  background: rgba(247, 238, 220, 0.12);
  border: 1px solid rgba(247, 238, 220, 0.2);
  border-radius: 50%;
  color: var(--paper);
  cursor: pointer;
  font-size: 14px;
  height: 28px;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 10px;
  bottom: 10px;
  transition: background-color 160ms ease, color 160ms ease;
  z-index: 2;
}

.slot-delete-button:hover,
.slot-delete-button:focus-visible {
  background: var(--danger);
  color: var(--paper);
}

.fade-overlay {
  align-items: center;
  background: #000000;
  display: grid;
  inset: 0;
  justify-items: center;
  opacity: 1;
  pointer-events: none;
  position: fixed;
  z-index: 100;
}

.fade-overlay[hidden] {
  display: none;
}

.loading-overlay {
  align-items: flex-end;
  background: #000000;
  display: grid;
  inset: 0;
  justify-content: flex-end;
  justify-items: center;
  opacity: 1;
  pointer-events: none;
  position: fixed;
  z-index: 200;
  transition: opacity 0.8s ease-in-out;
}

.loading-overlay.is-fading {
  opacity: 0;
  pointer-events: none;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-text {
  color: rgba(247, 238, 220, 0.72);
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  margin: 0 32px 28px 0;
  padding: 0;
}

.title-fade-overlay {
  align-items: center;
  background: #000000;
  display: grid;
  inset: 0;
  justify-items: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  z-index: 100;
  transition: opacity 1.5s ease-in;
}

.title-fade-overlay.is-fading {
  opacity: 1;
}

.overlay {
  align-items: center;
  background: rgba(6, 10, 14, 0.72);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 24px;
  position: fixed;
  z-index: 10;
}

.overlay[hidden] {
  display: none;
}

.modal-card {
  background: linear-gradient(170deg, rgba(18, 28, 36, 0.96), rgba(16, 19, 26, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  max-width: min(760px, 100%);
  width: 100%;
}

.large-card {
  max-width: min(920px, 100%);
}

.ending-card {
  max-width: min(560px, 100%);
  width: min(560px, 100%);
}

.ending-card .modal-body {
  padding: 32px;
}

.ending-card .side-copy {
  max-width: none;
}

.modal-header,
.modal-body {
  padding: 24px;
}

.modal-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 0;
}

.volume-form {
  display: grid;
  gap: 20px;
}

.volume-control {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(72px, 92px) 1fr minmax(48px, 56px);
}

.volume-label {
  color: rgba(247, 238, 220, 0.7);
  font-size: 0.92rem;
  font-weight: 500;
}

.volume-value {
  color: var(--paper);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.volume-control input[type='range'] {
  accent-color: var(--sun);
  cursor: pointer;
  width: 100%;
}

.icon-button {
  border-radius: 999px;
  padding: 10px 14px;
}

@media (max-width: 900px) {
  .title-shell {
    grid-template-columns: 1fr;
  }

  .character-stage {
    padding: 0 12px;
  }

  .dialogue-wrap {
    inset-inline: 12px;
    bottom: 12px;
  }

  .character-slot {
    max-width: 33%;
  }

  .dialogue-panel {
    z-index: 3;
  }

  .dialogue-actions-panel {
    pointer-events: auto;
    right: 18px;
    top: 10px;
    z-index: 4;
  }

  .dialogue-panel .dialogue-header {
    padding-right: clamp(110px, 22vw, 190px);
  }

  .slot-card-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell,
  .game-shell {
    padding: 16px;
  }

  .title-hero,
  .title-side,
  .dialogue-panel,
  .modal-body,
  .modal-header,
  .ending-card .modal-body {
    padding: 20px;
  }

  .stage-frame {
    min-height: 62vh;
  }

  .character-stage {
    align-items: flex-end;
    gap: 8px;
    justify-content: center;
    inset: 16px 0 0;
  }

  .character-slot[data-position="center"] {
    order: 2;
  }

  .character-slot[data-position="left"] {
    order: 1;
  }

  .character-slot[data-position="right"] {
    order: 3;
  }

  .character-slot img {
    max-height: 100%;
  }

  .dialogue-text {
    min-height: 4.8em;
  }

  .dialogue-wrap {
    inset-inline: 10px;
    bottom: 10px;
  }

  .dialogue-panel {
    max-height: min(34vh, 250px);
    min-height: clamp(170px, 30vh, 220px);
    padding: 16px 14px 14px;
    z-index: 3;
  }

  .dialogue-actions-panel {
    pointer-events: auto;
    right: 18px;
    top: 8px;
    z-index: 4;
  }

  .dialogue-panel .dialogue-header {
    padding-right: 0;
  }

  .choice-panel {
    max-height: min(28vh, 240px);
    width: min(100%, 94%);
  }

  .choice-panel.is-dual {
    width: min(100%, 94%);
  }

  .choice-button {
    padding: 12px 14px;
  }

  .choice-panel.is-dual .choice-button {
    min-height: 76px;
  }
}
