/* The original skin stays in otome-style.css; remove this layer to restore it. */
body.royal-theme {
  --ink: #44383c;
  --muted: #806969;
  --line: #bd9a56;
  --gold: #c6a251;
  --ruby: #c92143;
  --ruby-dark: #9f1734;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "MS PMincho", serif;
  background: #c3b4ae;
  isolation: isolate;
  letter-spacing: 0;
}

/* Keep the artwork viewport-sized when dialogue makes the page taller. */
body.royal-theme:not(.title-active)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.88) 220px, transparent 340px),
    url("salon-background.png?v=20261019") center / cover no-repeat;
  pointer-events: none;
}

html:has(body.royal-theme.route-active) {
  scrollbar-gutter: stable;
}

.royal-theme .game-shell {
  width: min(1040px, calc(100% - 40px));
  padding: 16px 0 24px;
}

.royal-theme .top-bar {
  min-height: 94px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ddc68c;
}

.royal-theme .brand-logo {
  width: 232px;
  /* Trim transparent vertical margins without shrinking the logo artwork. */
  aspect-ratio: 2 / 1;
  object-fit: cover;
  object-position: center 56%;
  filter: none;
}

.royal-theme .kicker {
  color: #806969;
  font-size: 12px;
  font-weight: 400;
}

.royal-theme .brand-title {
  color: #463438;
  font-size: 28px;
  font-weight: 800;
}

.royal-theme .classic-link {
  display: none;
}

.royal-theme .icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid #c5a05b;
  color: #9f1734;
  background: #fff;
  box-shadow: inset 0 0 0 3px #fff7e5;
}

.royal-theme .icon-button:hover {
  transform: none;
  background: #fff3f5;
  box-shadow: inset 0 0 0 3px #fff7e5;
}

.royal-theme .stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  min-height: 0;
  padding: 28px 12px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: clip;
}

.royal-theme .stage::before,
.royal-theme .stage::after {
  content: none;
}

.royal-theme .background-sign {
  position: relative;
  inset: auto;
  justify-self: center;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0 30px 12px;
  border: 0;
  border-bottom: 1px solid #d2b575;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  text-align: center;
  transform: none;
}

.royal-theme .background-sign span {
  color: #9a7440;
  font-size: 12px;
}

.royal-theme .background-sign strong {
  color: #8f2543;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
}

.royal-theme .stage:not(.is-route-active) .character-card {
  display: none;
}

.royal-theme .dialogue-panel {
  align-self: auto;
  gap: 24px;
  min-height: 0;
}

.royal-theme .progress-row {
  display: none;
}

.royal-theme .stage:not(.is-route-active) .message-box {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.royal-theme .stage:not(.is-route-active) .message-box::before,
.royal-theme .stage:not(.is-route-active) .message-box::after {
  content: none;
}

.royal-theme .stage:not(.is-route-active) .speaker {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  color: #9f1734;
  background: transparent;
  font-family: var(--serif);
  font-size: 16px;
}

.royal-theme .message {
  font-size: 17px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.royal-theme .character-select {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.royal-theme .character-select .choice-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 220px auto;
  gap: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #bca066;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 5px 16px rgba(65, 127, 142, 0.1);
  text-align: center;
}

.royal-theme .selection-portrait {
  --selection-left: -125%;
  --selection-top: 0%;
  position: relative;
  grid-row: 1;
  display: block;
  min-width: 0;
  overflow: clip;
  background: #e7f6ff;
  pointer-events: none;
}

.royal-theme .selection-teshigawara {
  --selection-left: -130%;
  --selection-top: -8%;
  background: #e7f4ed;
}

.royal-theme .selection-ado {
  --selection-left: -108%;
  background: #eff0fc;
}

.royal-theme .selection-portrait img {
  position: absolute;
  top: var(--selection-top);
  left: var(--selection-left);
  display: block;
  width: 350%;
  max-width: none;
  height: auto;
}

.royal-theme .choice-copy {
  align-self: center;
  padding: 16px 14px 18px;
}

.royal-theme .choice-title {
  margin-bottom: 6px;
  color: #9f1734;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.4;
}

.royal-theme .choice-meta {
  color: #806969;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.royal-theme .choice-button:hover {
  color: var(--ink);
  background: #fff8fa;
  border-color: #ac2947;
  box-shadow: 0 5px 18px rgba(172, 41, 71, 0.12);
  transform: none;
}

.royal-theme .choice-button:hover .choice-meta {
  color: #806969;
}

.royal-theme.route-active .game-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  min-height: 100svh;
}

.royal-theme .stage.is-route-active {
  --dialogue-pink-hue: 352.6153846154;
  --dialogue-pink: hsl(var(--dialogue-pink-hue) 80% 78%);
  --dialogue-pink-dark: hsl(var(--dialogue-pink-hue) 45% 40%);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(min-content, 1fr) auto;
  gap: 0;
  padding: 0 12px 8px;
}

.royal-theme .life-meter {
  position: absolute;
  /* Anchor below the header; the heart artwork also has white image margins. */
  top: calc(100% + 3px);
  right: 6px;
  z-index: 4;
  display: flex;
  gap: 4px;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.royal-theme .life-meter[hidden] {
  display: none;
}

.royal-theme .life-heart {
  display: block;
  flex: 0 0 37.5px;
  width: 37.5px;
  height: 42.5px;
  object-fit: contain;
  user-select: none;
}

.royal-theme .stage.is-route-active .background-sign {
  display: none;
  position: absolute;
  top: 0;
  left: 50%;
  width: auto;
  padding: 0 22px 8px;
  border: 0;
  border-bottom: 1px solid #d2b575;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  transform: translateX(-50%);
  white-space: nowrap;
}

.royal-theme .stage.is-route-active .background-sign strong {
  color: #8f2543;
  font-family: var(--serif);
  font-size: 22px;
}

.royal-theme .stage.is-route-active .background-sign span {
  color: #9a7440;
}

.royal-theme .stage.is-route-active .character-card,
.royal-theme .stage.is-route-active .character-card:has(.has-portrait-art) {
  position: relative;
  inset: auto;
  align-self: start;
  justify-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  margin: 48px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.royal-theme .stage.is-route-active .portrait.has-portrait-art {
  width: min(540px, 132%, max(220px, calc((100svh - 360px) * 1.18)));
  min-height: 0;
  aspect-ratio: 571 / 410;
  transform: translateY(-12px) scale(1.06);
  transform-origin: center top;
  filter: drop-shadow(0 8px 10px rgba(49, 98, 113, 0.12));
}

.royal-theme .stage.is-route-active .dialogue-panel {
  position: relative;
  inset: auto;
  width: 100%;
  gap: 14px;
  margin: 0;
}

@media (min-width: 921px), (orientation: portrait) {
  .royal-theme .stage.is-route-active.is-ending {
    grid-template-rows: minmax(min-content, 1fr);
  }

  /* Let longer results grow upward without moving or shrinking the portrait. */
  .royal-theme .stage.is-route-active.is-ending .character-card,
  .royal-theme .stage.is-route-active.is-ending .dialogue-panel {
    grid-area: 1 / 1;
  }

  .royal-theme .stage.is-route-active.is-ending .dialogue-panel {
    align-self: end;
    margin-top: 64px;
  }
}

.royal-theme .stage.is-route-active .message-box {
  min-height: 132px;
  padding: 34px 28px 22px;
  border: solid var(--dialogue-pink);
  border-width: 1px 3px 4px 1px;
  border-radius: 18px;
  color: #3d292d;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 5px 16px hsl(var(--dialogue-pink-hue) 80% 78% / 0.14);
}

.royal-theme .stage.is-route-active .message-box::before,
.royal-theme .stage.is-route-active .message-box::after {
  content: none;
}

.royal-theme .stage.is-route-active .speaker {
  top: -19px;
  left: -1px;
  min-width: 90px;
  min-height: 36px;
  max-width: calc(100% - 12px);
  align-items: center;
  padding: 4px 18px;
  border: solid hsl(var(--dialogue-pink-hue) 90% 70%);
  border-width: 1px 2px 2px 1px;
  border-radius: 7px;
  color: hsl(var(--dialogue-pink-hue) 35% 28%);
  background: var(--dialogue-pink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.95);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  overflow-wrap: anywhere;
}

.royal-theme .stage.is-route-active:not(.is-ending):has(.portrait-sato, .portrait-teshigawara) .speaker {
  width: 126px;
}

.royal-theme .stage.is-route-active .speaker::before,
.royal-theme .stage.is-route-active .speaker::after {
  content: none;
}

.royal-theme .stage.is-route-active .message {
  padding-top: 0;
  font-size: 18px;
  line-height: 1.8;
  text-shadow: none;
}

.royal-theme .message .reaction-status {
  color: #626d78;
  font-size: 1em;
  font-weight: 400;
}

.royal-theme .message .reaction-status-up {
  color: var(--dialogue-pink-dark);
  font-weight: 700;
}

.royal-theme .message .reaction-status-down {
  color: #52667a;
  font-weight: 700;
}

.royal-theme .stage.is-route-active .choices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 10px;
  padding: 0;
}

.royal-theme .stage.is-route-active .choice-button,
.royal-theme .stage.is-route-active .primary-button {
  min-height: 58px;
  padding: 12px 22px;
  border: 3px double #c6a251;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 10px rgba(65, 127, 142, 0.1);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
  transform: none;
}

.royal-theme .stage.is-route-active .primary-button {
  width: min(320px, 100%);
  border-color: var(--dialogue-pink);
  background: hsl(var(--dialogue-pink-hue) 80% 97%);
  text-shadow: none;
}

.royal-theme .stage.is-route-active .primary-button::before,
.royal-theme .stage.is-route-active .primary-button::after {
  content: none;
}

.royal-theme .stage.is-route-active .choice-button:hover {
  color: var(--ink);
  border-color: #c6a251;
  background: #fff;
}

.royal-theme button:focus-visible,
.royal-theme .brand-logo-link:focus-visible {
  outline: 3px solid #286b81;
  outline-offset: 4px;
}

@media (min-width: 921px) {
  .royal-theme .selection-portrait { --selection-left: -73%; }
  .royal-theme .selection-teshigawara { --selection-left: -77%; }
  .royal-theme .selection-ado { --selection-left: -64%; }
  .royal-theme .selection-portrait img { width: 250%; }
}

@media (max-width: 920px) {
  .royal-theme .game-shell,
  .royal-theme.route-active .game-shell {
    width: min(640px, calc(100% - 24px));
    gap: 12px;
    padding: max(10px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
  }

  .royal-theme .top-bar,
  .royal-theme.route-active .top-bar {
    min-height: 0;
    gap: 8px;
    padding: 0 0 12px;
  }

  .royal-theme .brand-lockup,
  .royal-theme.route-active .brand-lockup {
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 3px 8px;
  }

  .royal-theme .brand-copy {
    display: flex;
    flex-direction: column;
    grid-column: 2;
    grid-row: 1;
    gap: 3px;
  }

  .royal-theme .brand-logo-link {
    grid-row: 1;
  }

  .royal-theme .brand-logo,
  .royal-theme.route-active .brand-logo {
    width: 128px;
  }

  .royal-theme .brand-title,
  .royal-theme.route-active .brand-title {
    font-size: 20px;
    line-height: 1.3;
  }

  .royal-theme .kicker {
    font-size: 11px;
    line-height: 1.5;
  }

  .royal-theme .icon-button {
    width: 36px;
    height: 36px;
  }

  .royal-theme .stage {
    gap: 16px;
    padding: 18px 0 0;
  }

  .royal-theme .background-sign strong {
    font-size: 24px;
  }

  .royal-theme .dialogue-panel {
    gap: 18px;
  }

  .royal-theme .message {
    font-size: 14px;
    line-height: 1.8;
  }

  .royal-theme .character-select {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .royal-theme .character-select .choice-button {
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: 120px;
    text-align: left;
  }

  .royal-theme .selection-portrait {
    grid-column: 1;
    grid-row: 1;
  }

  .royal-theme .choice-copy {
    grid-column: 2;
    grid-row: 1;
    padding: 12px 16px;
  }

  .royal-theme .choice-title {
    font-size: 21px;
  }

  .royal-theme .choice-meta {
    font-size: 12px;
  }

  .royal-theme .stage.is-route-active {
    padding: 0 0 6px;
  }

  .royal-theme .life-meter {
    right: -6px;
  }

  .royal-theme .stage.is-route-active .background-sign strong {
    font-size: 21px;
  }

  .royal-theme .stage.is-route-active .character-card,
  .royal-theme .stage.is-route-active .character-card:has(.has-portrait-art) {
    margin-top: 48px;
  }

  .royal-theme .stage.is-route-active .message-box {
    min-height: 110px;
    padding: 28px 16px 16px;
  }

  .royal-theme .stage.is-route-active .speaker {
    min-width: 90px;
  }

  .royal-theme .stage.is-route-active .message {
    font-size: 16px;
    line-height: 1.75;
  }

  .royal-theme .stage.is-route-active .choices {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .royal-theme .stage.is-route-active .choice-button,
  .royal-theme .stage.is-route-active .primary-button {
    min-height: 54px;
    padding: 10px 22px;
    font-size: 16px;
  }

  .royal-theme .stage.is-route-active .primary-button {
    width: min(300px, 90%);
  }
}

@media (max-width: 360px) {
  .royal-theme .brand-lockup,
  .royal-theme.route-active .brand-lockup {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 3px 6px;
  }

  .royal-theme .brand-logo,
  .royal-theme.route-active .brand-logo {
    width: 104px;
  }

  .royal-theme .brand-title,
  .royal-theme.route-active .brand-title {
    font-size: 19px;
  }

  .royal-theme .kicker { font-size: 10px; }

  .royal-theme .character-select .choice-button {
    grid-template-columns: 94px minmax(0, 1fr);
    grid-template-rows: 110px;
  }

  .royal-theme .choice-copy { padding: 10px 12px; }
}

@media (max-width: 920px) and (orientation: landscape) {
  .royal-theme .stage.is-route-active {
    grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
    grid-template-rows: auto;
    gap: 12px;
  }

  .royal-theme .stage.is-route-active .background-sign {
    left: 21%;
    padding-inline: 8px;
  }

  .royal-theme .stage.is-route-active .background-sign strong { font-size: 17px; }

  .royal-theme .stage.is-route-active .character-card,
  .royal-theme .stage.is-route-active .character-card:has(.has-portrait-art) {
    grid-column: 1;
    grid-row: 1;
  }

  .royal-theme .stage.is-route-active .portrait.has-portrait-art {
    width: min(320px, 132%);
  }

  .royal-theme .stage.is-route-active .dialogue-panel {
    grid-column: 2;
    grid-row: 1;
  }
}

.royal-theme .character-select .choice-button:not(:has(.selection-portrait)) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  min-height: 110px;
}

.royal-theme .character-select .choice-button:not(:has(.selection-portrait)) .choice-copy {
  grid-column: 1;
  grid-row: 1;
}

.royal-theme .stage.is-selecting {
  gap: 8px;
  padding-bottom: 0;
}

.royal-theme .selection-prompt {
  display: none;
}

.royal-theme .stage.is-selecting .selection-prompt {
  display: block;
  margin: 0;
  color: #9a7440;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}

.royal-theme .stage.is-selecting .message-box {
  display: none;
}

.royal-theme .stage.is-selecting .dialogue-panel {
  display: block;
  min-width: 0;
}

.royal-theme .character-showcase {
  --figure-art-height: min(680px, max(340px, calc(100svh - 205px)));
  --figure-art-scale: 1.28;
  --lineup-height: calc(var(--figure-art-height) * var(--figure-art-scale));
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.royal-theme .character-lineup {
  position: relative;
  grid-area: 1 / 1;
  width: min(680px, 100%);
  height: var(--lineup-height);
  margin-inline: auto;
}

.royal-theme .character-figure {
  position: absolute;
  top: 0;
  left: calc(var(--figure-index) * 100% / var(--figure-count));
  z-index: 1;
  width: calc(100% / var(--figure-count));
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  opacity: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.royal-theme .character-figure img {
  position: absolute;
  top: 0;
  left: var(--figure-art-center, 50%);
  display: block;
  width: auto;
  max-width: none;
  height: var(--figure-art-height);
  transform: translateX(-50%) scale(var(--figure-art-scale));
  transform-origin: center top;
  pointer-events: none;
  user-select: none;
  filter: brightness(0.78) saturate(0.65);
  transition: filter 180ms ease;
}

.royal-theme .figure-teshigawara {
  --figure-art-center: 75%;
}

.royal-theme .figure-sato {
  --figure-art-center: 52%;
}

.royal-theme .figure-ado {
  --figure-art-center: 35%;
}

.royal-theme .character-figure:hover img {
  filter: brightness(0.9) saturate(0.85);
}

.royal-theme .character-figure.is-selected {
  z-index: 2;
  opacity: 1;
}

.royal-theme .character-figure.is-selected img {
  filter: none;
}

.royal-theme .character-figure:focus-visible {
  outline-offset: -4px;
}

.royal-theme .selection-detail {
  position: relative;
  grid-area: 1 / 1;
  align-self: start;
  justify-self: center;
  z-index: 3;
  width: min(360px, calc(100% - 40px));
  margin-top: calc(var(--lineup-height) * 0.42);
  padding: 20px 24px;
  border: 3px double #bd9a56;
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 20px rgba(65, 127, 142, 0.1);
  text-align: center;
}

.royal-theme .selection-detail h2 {
  margin: 0 0 8px;
  color: #8f2543;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
}

.royal-theme .selection-detail p {
  min-height: 44px;
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.royal-theme .selection-confirm {
  width: min(240px, 100%);
  min-height: 50px;
  padding: 10px 20px;
  border: 3px double #edcf89;
  border-radius: 4px;
  color: #fff;
  background: linear-gradient(#e23955, #b31c3b);
  box-shadow: 0 3px 8px rgba(146, 42, 63, 0.16);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.4;
}

.royal-theme .selection-confirm:hover {
  color: #fff;
  background: linear-gradient(#ef4b67, #c52245);
  transform: none;
}

@media (max-width: 920px) {
  .royal-theme .character-showcase {
    --figure-art-height: min(680px, max(340px, calc(100svh - 205px)), calc((100vw - 24px) * 1.45));
  }
}

@media (min-width: 921px) {
  .royal-theme .character-showcase {
    --figure-art-height: min(680px, max(340px, calc(100svh - 260px)));
  }
}

@media (max-width: 360px) {
  .royal-theme .selection-detail {
    width: calc(100% - 24px);
    padding: 14px 18px;
  }
  .royal-theme .selection-detail h2 { font-size: 24px; }
  .royal-theme .selection-detail p { font-size: 14px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .royal-theme .character-showcase { --figure-art-height: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  .royal-theme .character-figure img { transition: none; }
}
