:root {
  color-scheme: dark;
  --night: #07131f;
  --night-2: #0c2230;
  --night-3: #123745;
  --ink: #f5efdf;
  --muted: #a8b7b5;
  --teal: #1d6c69;
  --teal-light: #73c6b6;
  --plum: #7b355d;
  --amber: #e8ad4a;
  --amber-light: #ffdc8b;
  --brass: #aa7532;
  --danger: #d45b60;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
}

button {
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-underline-offset: 0.25em;
}

:focus-visible {
  outline: 3px solid var(--amber-light);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 15px;
  transform: translateY(-180%);
  background: #fff;
  color: #000;
}

.skip-link:focus {
  transform: none;
}

.game-header {
  position: fixed;
  z-index: 40;
  inset: 0 0 auto;
  display: flex;
  min-height: 74px;
  padding: 10px 24px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgb(232 173 74 / 24%);
  background: rgb(7 19 31 / 92%);
  backdrop-filter: blur(14px);
}

.game-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.game-brand__crest {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--amber);
  border-radius: 50%;
  background: radial-gradient(circle, #274b4b, #0b2029);
  color: var(--amber-light);
  font-family: Georgia, serif;
  box-shadow: inset 0 0 0 4px rgb(232 173 74 / 10%);
}

.game-brand strong,
.game-brand small {
  display: block;
}

.game-brand strong {
  font-family: var(--serif);
  letter-spacing: 0.09em;
}

.game-brand small {
  color: var(--muted);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
}

.game-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-header button,
.game-header__actions a,
.screen button,
dialog button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgb(245 239 223 / 28%);
  border-radius: 4px;
  background: rgb(7 19 31 / 36%);
  color: var(--ink);
}

.game-header__actions a {
  display: inline-flex;
  align-items: center;
}

.game-header button[aria-pressed="true"] {
  border-color: var(--amber);
  color: var(--amber-light);
}

.keyboard-guide {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  width: min(100%, 760px);
  margin: 0 auto 14px;
  padding: 10px 14px;
  border: 1px solid rgb(232 173 74 / 24%);
  border-radius: 8px;
  background: rgb(7 19 31 / 74%);
  color: var(--muted);
  font-size: 0.78rem;
}

.keyboard-guide span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.keyboard-guide kbd {
  min-width: 2rem;
  padding: 2px 6px;
  border: 1px solid rgb(245 239 223 / 28%);
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #102b38;
  color: var(--ink);
  font: 700 0.7rem/1.5 var(--sans);
  text-align: center;
}

main {
  padding-top: 74px;
}

.screen {
  min-height: calc(100vh - 74px);
}

.title-screen {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: calc(100svh - 74px);
  align-items: center;
}

.title-screen__art,
.title-screen__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.title-screen__art {
  object-fit: cover;
  object-position: 66% center;
}

.title-screen__shade {
  background:
    linear-gradient(90deg, rgb(3 11 18 / 98%) 0%, rgb(3 11 18 / 86%) 30%, rgb(3 11 18 / 32%) 58%, rgb(3 11 18 / 5%) 80%),
    linear-gradient(0deg, rgb(3 11 18 / 68%), transparent 44%);
}

.title-screen__content {
  position: relative;
  z-index: 2;
  width: min(100% - 48px, 1280px);
  margin-inline: auto;
  padding-block: 72px;
}

.chapter-label {
  margin: 0 0 12px;
  color: var(--amber-light);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.title-screen h1,
.screen-heading h1,
.mission-panel h1,
.ending-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.1em;
  text-shadow: 0 5px 28px rgb(0 0 0 / 62%);
}

.title-screen h1 {
  font-size: clamp(3.5rem, 8vw, 7.5rem);
}

.title-screen__content > p:not(.chapter-label, .control-note) {
  max-width: 37em;
  margin: 24px 0 0;
  color: rgb(245 239 223 / 82%);
  font-family: var(--serif);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 2;
}

.title-actions,
.mission-actions {
  display: flex;
  margin-top: 30px;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button {
  border-color: var(--amber) !important;
  background: linear-gradient(#f0bd61, #c98a31) !important;
  color: #17110a !important;
  font-weight: 800;
  box-shadow: 0 8px 24px rgb(232 173 74 / 20%);
}

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

.control-note,
.board-note,
.dialog-note {
  color: var(--muted);
  font-size: 0.7rem;
}

.screen-shell {
  width: min(100% - 48px, 1260px);
  margin-inline: auto;
  padding-block: clamp(50px, 7vw, 92px);
}

.stage-screen {
  background:
    radial-gradient(circle at 15% 10%, rgb(29 108 105 / 25%), transparent 32%),
    radial-gradient(circle at 90% 80%, rgb(123 53 93 / 20%), transparent 30%),
    var(--night);
}

.screen-heading {
  display: flex;
  margin-bottom: 36px;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.screen-heading h1 {
  font-size: clamp(2.7rem, 6vw, 5rem);
}

.screen-heading p:not(.chapter-label) {
  max-width: 44em;
  color: var(--muted);
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.stage-card {
  position: relative;
  display: flex;
  min-height: 210px;
  padding: 18px !important;
  align-items: flex-start;
  flex-direction: column;
  overflow: hidden;
  border-color: rgb(232 173 74 / 32%) !important;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 5%), transparent 48%),
    #102733 !important;
  text-align: left;
}

.stage-card::after {
  position: absolute;
  right: -20px;
  bottom: -44px;
  width: 120px;
  height: 150px;
  border: 5px double rgb(232 173 74 / 18%);
  border-radius: 60px 60px 0 0;
  content: "";
}

.stage-card:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.stage-card:not(:disabled):hover {
  border-color: var(--amber) !important;
  transform: translateY(-3px);
}

.stage-card__no,
.stage-card__title,
.stage-card__meta {
  position: relative;
  z-index: 1;
  display: block;
}

.stage-card__no {
  color: var(--amber-light);
  font-family: Georgia, serif;
  font-size: 1.65rem;
}

.stage-card__title {
  margin-top: auto;
  font-family: var(--serif);
  font-size: 1rem;
}

.stage-card__meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.67rem;
}

.progress-card {
  display: grid;
  margin-top: 28px;
  padding: 22px;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 24px;
  border: 1px solid rgb(232 173 74 / 28%);
  background: #102733;
}

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

.progress-card span {
  color: var(--muted);
  font-size: 0.7rem;
}

.progress-card strong {
  font-family: var(--serif);
  font-size: 1.3rem;
}

.progress-card progress {
  width: 100%;
  height: 10px;
  border: 0;
  background: #1f3b47;
}

progress::-webkit-progress-bar {
  background: #1f3b47;
}

progress::-webkit-progress-value {
  background: var(--amber);
}

progress::-moz-progress-bar {
  background: var(--amber);
}

.play-screen {
  background:
    radial-gradient(circle at 75% 22%, rgb(232 173 74 / 10%), transparent 36%),
    var(--night);
}

.play-layout {
  display: grid;
  min-height: calc(100vh - 74px);
  grid-template-columns: minmax(310px, 0.34fr) minmax(620px, 0.66fr);
}

.mission-panel {
  display: flex;
  padding: clamp(28px, 4vw, 62px);
  flex-direction: column;
  border-right: 1px solid rgb(232 173 74 / 19%);
  background: linear-gradient(180deg, #112d38, #0a1b27);
}

.back-button {
  width: fit-content;
}

.mission-panel .chapter-label {
  margin-top: 44px;
}

.mission-panel h1 {
  font-size: clamp(2.2rem, 4vw, 3.9rem);
  word-break: auto-phrase;
  line-break: strict;
}

.mission-panel > p:not(.chapter-label) {
  color: var(--muted);
  font-family: var(--serif);
}

.mission-stats {
  margin: 24px 0 0;
  border-top: 1px solid rgb(245 239 223 / 16%);
}

.mission-stats div {
  display: flex;
  padding: 10px 0;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgb(245 239 223 / 11%);
}

.mission-stats dt {
  color: var(--muted);
  font-size: 0.72rem;
}

.mission-stats dd {
  margin: 0;
  color: var(--amber-light);
  font-weight: 800;
}

.ruka-message {
  display: grid;
  min-height: 104px;
  margin-top: 18px;
  padding: 12px 14px 12px 5px;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 8px;
  border: 1px solid rgb(232 173 74 / 28%);
  background: rgb(4 17 25 / 58%);
}

.ruka-message img {
  width: 88px;
  height: 92px;
  object-fit: contain;
}

.ruka-message p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.mission-actions {
  margin-top: 18px;
}

.room-legend {
  display: flex;
  margin-top: 18px;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.68rem;
}

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

.room-legend i {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 4px;
  background: #203e46;
  font-style: normal;
}

[data-mark="a"] {
  color: #eb7ab3;
}

[data-mark="b"] {
  color: #7bd7b0;
}

[data-mark="c"] {
  color: #f3c75e;
}

.board-panel {
  position: relative;
  display: grid;
  min-width: 0;
  padding: clamp(22px, 3.5vw, 54px);
  align-content: center;
  justify-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgb(232 173 74 / 9%), transparent 54%),
    linear-gradient(135deg, #0a1a27, #101b30);
}

.hotel-frame {
  width: min(100%, var(--level-width, 920px));
  padding: 11px;
  border: 2px solid #7b5428;
  border-radius: 18px;
  background: linear-gradient(145deg, #c18b43, #6e4922 46%, #dfaa5c);
  box-shadow: 0 35px 75px rgb(0 0 0 / 48%), inset 0 0 0 3px #291b14;
}

.hotel-frame__top {
  display: grid;
  min-height: 46px;
  padding: 7px 12px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid #6b481f;
  border-radius: 9px 9px 4px 4px;
  background: #081923;
  color: #cdbb91;
  font-size: 0.64rem;
  letter-spacing: 0.13em;
}

.hotel-frame__top strong {
  color: var(--amber-light);
  font-family: Georgia, serif;
  font-size: 1.12rem;
}

.hotel-frame__top span:last-child {
  text-align: right;
}

.hotel-frame__top span[data-open="true"] {
  color: #9cf0cd;
}

.hotel-board {
  --columns: 9;
  position: relative;
  display: grid;
  width: 100%;
  padding: clamp(7px, 1.2vw, 14px);
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: clamp(2px, 0.42vw, 5px);
  border: 1px solid #432e1b;
  border-top: 0;
  border-radius: 0 0 9px 9px;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 3%) 1px, transparent 1px),
    linear-gradient(rgb(255 255 255 / 3%) 1px, transparent 1px),
    #102c35;
  perspective: 900px;
}

.board-cell {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0 !important;
  aspect-ratio: 1;
  padding: 0 !important;
  overflow: visible;
  border: 1px solid rgb(230 194 132 / 25%) !important;
  border-radius: 4px !important;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 11%), transparent 35%),
    linear-gradient(#a77a57, #77513e) !important;
  box-shadow: inset 0 -6px 0 rgb(49 30 27 / 40%), 0 3px 2px rgb(0 0 0 / 25%);
  touch-action: manipulation;
}

.board-cell:not(:disabled):hover {
  border-color: var(--amber-light) !important;
}

.board-cell--wall {
  border-color: #4d382a !important;
  background:
    linear-gradient(145deg, #37595a, #203c40 64%),
    #203c40 !important;
  box-shadow: inset 0 7px 0 rgb(255 255 255 / 6%), inset 0 -11px 0 #14292d, 0 5px 5px rgb(0 0 0 / 35%);
  cursor: default;
}

.board-cell--wall::before {
  position: absolute;
  inset: 10% 15% auto;
  height: 18%;
  border: 1px solid rgb(232 173 74 / 16%);
  border-radius: 50%;
  background: rgb(232 173 74 / 5%);
  content: "";
}

.board-cell--furniture {
  border-color: #8c6335 !important;
  background:
    linear-gradient(145deg, rgb(255 224 169 / 22%), transparent 32%),
    repeating-linear-gradient(90deg, #815737 0 8px, #6b452d 8px 16px) !important;
  box-shadow: inset 0 7px 0 #b4834e, inset 0 -9px 0 #3b261d, 0 6px 6px rgb(0 0 0 / 38%);
}

.board-cell--furniture::after {
  position: absolute;
  inset: 18%;
  border: 2px solid rgb(240 195 117 / 35%);
  border-radius: 4px;
  content: "";
}

.board-cell--gate {
  background:
    linear-gradient(90deg, transparent 46%, rgb(255 224 156 / 55%) 47% 53%, transparent 54%),
    linear-gradient(145deg, #674629, #2f241f) !important;
}

.board-cell--gate::before {
  position: absolute;
  z-index: 2;
  inset: 8%;
  border: 3px double #f1bd62;
  border-radius: 18px 18px 5px 5px;
  box-shadow: inset 0 0 13px rgb(255 213 122 / 28%);
  content: "";
}

.board-cell--gate[data-open="false"] {
  filter: saturate(0.55) brightness(0.72);
}

.board-cell--gate[data-open="true"] {
  background:
    radial-gradient(circle, rgb(255 226 153 / 52%), transparent 65%),
    linear-gradient(#1d363a, #10262c) !important;
  box-shadow: inset 0 0 20px rgb(255 221 142 / 42%), 0 0 18px rgb(232 173 74 / 32%);
}

.board-cell--exit {
  background:
    linear-gradient(90deg, transparent 47%, rgb(250 215 142 / 46%) 48% 52%, transparent 53%),
    linear-gradient(#6d4b28, #241b18) !important;
}

.board-cell--exit::before {
  position: absolute;
  inset: 10%;
  border: 3px double #d6a24c;
  border-radius: 16px 16px 4px 4px;
  content: "";
}

.board-cell--exit[data-open="true"] {
  box-shadow: inset 0 0 18px rgb(255 220 139 / 65%), 0 0 18px rgb(232 173 74 / 38%);
}

.board-cell--exit[data-open="false"] {
  filter: saturate(0.42) brightness(0.72);
}

.board-cell--target {
  isolation: isolate;
}

.board-cell--target::after {
  position: absolute;
  z-index: 1;
  inset: 13%;
  display: grid;
  place-items: center;
  border: 3px solid currentColor;
  border-radius: 22% 22% 45% 45%;
  background: rgb(8 25 35 / 58%);
  box-shadow: 0 0 16px currentColor, inset 0 0 12px rgb(255 255 255 / 16%);
  content: attr(data-target);
  color: #fff;
  font: 900 clamp(0.62rem, 1.25vw, 1rem) / 1 system-ui, sans-serif;
  text-transform: uppercase;
}

.board-cell--target[data-target="a"] {
  color: #ff8eba;
}

.board-cell--target[data-target="b"] {
  color: #6fe4b6;
}

.board-cell--target[data-target="c"] {
  color: #ffd261;
}

.board-cell--target[data-target="d"] {
  color: #77c9ff;
}

.piece {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 4%;
  left: 0;
  display: grid;
  height: 112%;
  place-items: end center;
  pointer-events: none;
  animation: piece-in 180ms ease-out;
}

.piece img {
  display: block;
  width: 112%;
  height: 112%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 8px 4px rgb(0 0 0 / 45%));
}

.piece--ruka {
  z-index: 5;
  height: 126%;
}

.piece--ruka img {
  width: 124%;
  height: 124%;
}

.piece--ruka[data-facing="left"] img {
  transform: scaleX(-1);
}

.piece--ruka[data-facing="up"] img {
  filter: brightness(0.86) drop-shadow(0 8px 4px rgb(0 0 0 / 45%));
}

.piece--guest {
  height: 100%;
}

.piece--guest img {
  width: 96%;
  height: 96%;
}

.piece--guest[data-guest="a"] {
  --guest-color: #ff8eba;
}

.piece--guest[data-guest="b"] {
  --guest-color: #6fe4b6;
}

.piece--guest[data-guest="c"] {
  --guest-color: #ffd261;
}

.piece--guest[data-guest="d"] {
  --guest-color: #77c9ff;
}

.piece--guest[data-active="true"] {
  filter: drop-shadow(0 0 8px var(--guest-color)) drop-shadow(0 0 18px var(--guest-color));
  animation: active-guest 620ms ease-in-out infinite alternate;
}

.piece--guest[data-settled="true"] {
  filter: saturate(0.8) brightness(0.94);
}

.piece__badge {
  position: absolute;
  z-index: 7;
  top: 2%;
  right: 2%;
  display: grid;
  width: clamp(17px, 2.1vw, 26px);
  height: clamp(17px, 2.1vw, 26px);
  place-items: center;
  border: 2px solid #07151e;
  border-radius: 50%;
  background: var(--guest-color);
  color: #07151e;
  font: 1000 clamp(0.55rem, 1.2vw, 0.82rem) / 1 system-ui, sans-serif;
  box-shadow: 0 3px 8px rgb(0 0 0 / 45%);
}

.board-cell--hint {
  outline: 3px solid var(--amber-light);
  outline-offset: -3px;
  animation: hint-pulse 800ms ease-in-out infinite alternate;
}

.board-cell--hint-stand {
  outline: 3px dashed #fff2b8;
  outline-offset: -6px;
  box-shadow:
    inset 0 0 0 3px rgb(232 173 74 / 36%),
    0 0 24px rgb(255 226 147 / 55%);
}

.board-cell--hint-stand::before {
  position: absolute;
  z-index: 8;
  inset: 9%;
  border: 2px dotted #fff2b8;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

@keyframes active-guest {
  from {
    transform: translateY(0) scale(1);
  }

  to {
    transform: translateY(-3%) scale(1.04);
  }
}

.dpad {
  display: grid;
  width: 236px;
  margin-top: 18px;
  grid-template: repeat(2, 52px) / repeat(4, 52px);
  gap: 5px;
}

.dpad button {
  min-height: 52px;
  padding: 0;
  border-color: rgb(232 173 74 / 42%);
  background: #102c35;
  font-size: 1.35rem;
}

.dpad button[data-move-direction="up"] {
  grid-area: 1 / 2;
}

.dpad button[data-move-direction="left"] {
  grid-area: 2 / 1;
}

.dpad button[data-move-direction="down"] {
  grid-area: 2 / 2;
}

.dpad button[data-move-direction="right"] {
  grid-area: 2 / 3;
}

.dpad button[data-punch-guest] {
  grid-area: 1 / 4 / 3 / 5;
  border-color: #e8ad4a;
  background: linear-gradient(180deg, #d49a3e, #8d5d25);
  color: #fff8dd;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.board-note {
  max-width: 52em;
  margin: 12px 0 0;
  text-align: center;
}

.ending-screen {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.ending-screen > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
}

.ending-screen::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgb(10 27 39 / 38%), rgb(5 13 21 / 94%));
  content: "";
}

.ending-copy {
  position: relative;
  z-index: 2;
  width: min(100% - 48px, 680px);
  padding: 60px;
  border: 1px solid rgb(232 173 74 / 34%);
  background: rgb(7 19 31 / 82%);
  text-align: center;
}

.ending-copy h1 {
  font-size: clamp(3rem, 7vw, 6rem);
}

.ending-score {
  margin-top: 24px;
  color: var(--muted);
}

.ending-score strong {
  display: block;
  color: var(--amber-light);
  font-size: 2rem;
}

dialog {
  width: min(100% - 32px, 680px);
  padding: 0;
  border: 1px solid #9c7036;
  border-radius: 10px;
  background: #102733;
  color: var(--ink);
  box-shadow: 0 30px 90px rgb(0 0 0 / 70%);
}

dialog::backdrop {
  background: rgb(2 8 13 / 82%);
  backdrop-filter: blur(5px);
}

.tutorial-dialog {
  padding: 28px;
}

.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-heading h2,
.result-content h2,
.confirm-dialog h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4vw, 2.7rem);
}

.tutorial-dialog ol {
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.tutorial-dialog li {
  display: grid;
  padding: 13px 0;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  border-top: 1px solid rgb(245 239 223 / 14%);
}

.tutorial-dialog li > span {
  color: var(--amber-light);
  font-family: Georgia, serif;
}

.tutorial-dialog p {
  margin: 4px 0 0;
  color: var(--muted);
}

.result-content {
  padding: 30px;
  text-align: center;
}

.result-content > img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.result-content dl {
  display: grid;
  margin: 18px 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgb(245 239 223 / 16%);
}

.result-content dl div {
  padding: 14px 8px;
  background: #102733;
}

.result-content dt {
  color: var(--muted);
  font-size: 0.66rem;
}

.result-content dd {
  margin: 4px 0 0;
  color: var(--amber-light);
  font-weight: 800;
}

.result-content > p:not(.chapter-label) {
  color: var(--muted);
}

.result-content > div:last-child,
.confirm-dialog > div {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.confirm-dialog {
  padding: 30px;
  text-align: center;
}

.confirm-dialog p {
  color: var(--muted);
}

.danger-button {
  border-color: var(--danger) !important;
  color: #ffafb3 !important;
}

.toast {
  position: fixed;
  z-index: 90;
  right: 20px;
  bottom: 20px;
  max-width: min(90vw, 420px);
  padding: 12px 18px;
  border: 1px solid var(--amber);
  background: #102733;
  color: var(--ink);
  box-shadow: 0 10px 40px rgb(0 0 0 / 48%);
}

@keyframes piece-in {
  from {
    opacity: 0.35;
    transform: translateY(-12px) scale(0.92);
  }
}

@keyframes hint-pulse {
  to {
    filter: brightness(1.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1040px) {
  .play-layout {
    grid-template-columns: 1fr;
  }

  .mission-panel {
    border-right: 0;
    border-bottom: 1px solid rgb(232 173 74 / 19%);
  }

  .mission-panel .chapter-label {
    margin-top: 26px;
  }

  .stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .game-header {
    position: static;
    padding: 9px 14px;
  }

  .game-header__actions a {
    display: none;
  }

  .game-brand small {
    display: none;
  }

  main {
    padding-top: 0;
  }

  .screen {
    min-height: calc(100svh - 68px);
  }

  .title-screen {
    align-items: end;
  }

  .title-screen__art {
    object-position: 64% center;
  }

  .title-screen__shade {
    background: linear-gradient(0deg, rgb(3 11 18 / 98%) 0%, rgb(3 11 18 / 70%) 58%, rgb(3 11 18 / 20%));
  }

  .title-screen__content {
    width: min(100% - 28px, 620px);
    padding-block: 42px;
  }

  .title-screen h1 {
    font-size: clamp(2.4rem, 11vw, 3.6rem);
  }

  .title-screen__content > p:not(.chapter-label, .control-note) {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .screen-shell {
    width: min(100% - 28px, 620px);
  }

  .screen-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .stage-card {
    min-height: 155px;
  }

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

  .mission-panel,
  .board-panel {
    padding: 24px 14px;
  }

  .mission-panel h1 {
    font-size: 2.65rem;
  }

  .hotel-frame {
    padding: 6px;
  }

  .hotel-frame__top {
    grid-template-columns: 1fr auto;
    font-size: 0.55rem;
  }

  .hotel-frame__top span:last-child {
    display: none;
  }

  .hotel-board {
    padding: 5px;
    gap: 2px;
  }

  .board-cell {
    box-shadow: inset 0 -3px 0 rgb(49 30 27 / 40%), 0 2px 1px rgb(0 0 0 / 24%);
  }

  .piece {
    bottom: 1%;
  }

  .room-legend {
    margin-top: 14px;
  }

  .result-content dl {
    grid-template-columns: 1fr;
  }

  .ending-copy {
    padding: 36px 22px;
  }
}

@media (max-width: 430px) {
  .game-header {
    gap: 8px;
    padding-inline: 10px;
  }

  .game-brand > span:last-child {
    display: none;
  }

  .game-brand__crest {
    width: 34px;
    height: 34px;
  }

  .game-header__actions {
    gap: 6px;
  }

  .game-header button {
    min-height: 40px;
    padding: 6px 9px;
    font-size: 0.72rem;
  }

  .title-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .title-actions button {
    width: 100%;
  }

  .board-panel {
    padding-inline: 6px;
  }

  .hotel-frame__top {
    min-height: 38px;
  }

  .guest-mark {
    font-size: 0.5rem;
  }
}
