:root {
  color-scheme: dark;
  --ink: #0d0b13;
  --night: #171020;
  --panel: #21182c;
  --panel-soft: #2b2037;
  --velvet: #55296f;
  --velvet-bright: #79409a;
  --ghost: #86edff;
  --ghost-pale: #dcfbff;
  --gold: #d8a64e;
  --candle: #ffd07a;
  --violet: #b17cff;
  --muted: #aca3b6;
  --cream: #f9f0df;
  --danger: #ff8099;
  --shadow: 0 30px 80px rgb(4 2 10 / 55%);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Avenir Next", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--night);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 8%, rgb(111 65 139 / 22%), transparent 30rem),
    linear-gradient(180deg, #191121 0%, #0e0b13 100%);
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid var(--ghost);
  outline-offset: 3px;
}

.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.42;
  background-image:
    linear-gradient(90deg, transparent 49.5%, rgb(216 166 78 / 11%) 50%, transparent 50.5%),
    radial-gradient(ellipse at 50% 0%, transparent 45%, rgb(216 166 78 / 7%) 46%, transparent 48%);
  background-size: 78px 100%, 156px 170px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.site-shell {
  width: min(1320px, calc(100% - 40px));
  min-height: calc(100dvh - 72px);
  margin: 0 auto;
  padding: 34px 0 28px;
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(330px, 460px) minmax(210px, 0.85fr);
  align-items: center;
  gap: clamp(24px, 4vw, 62px);
}

.intro {
  justify-self: end;
  width: min(100%, 330px);
}

.brand-mark {
  width: 62px;
  height: 62px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(216 166 78 / 36%);
  border-radius: 21px;
  background: linear-gradient(145deg, rgb(121 64 154 / 35%), rgb(21 15 28 / 80%));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 9%), 0 14px 40px rgb(0 0 0 / 28%);
}

.brand-ghost,
.completion-ghost {
  position: relative;
  display: block;
  width: 32px;
  height: 37px;
  clip-path: polygon(50% 0, 72% 6%, 90% 23%, 100% 47%, 100% 88%, 81% 77%, 66% 100%, 50% 80%, 34% 100%, 19% 77%, 0 88%, 0 47%, 10% 23%, 28% 6%);
  background: linear-gradient(180deg, var(--ghost-pale), var(--ghost));
  filter: drop-shadow(0 0 12px rgb(134 237 255 / 55%));
}

.brand-ghost i,
.completion-ghost i {
  position: absolute;
  top: 15px;
  width: 4px;
  height: 6px;
  border-radius: 50%;
  background: var(--night);
}

.brand-ghost i:first-child,
.completion-ghost i:first-child {
  left: 9px;
}

.brand-ghost i:last-child,
.completion-ghost i:last-child {
  right: 9px;
}

.eyebrow,
.card-label {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 8ch;
  margin-bottom: 18px;
  font-family: Iowan Old Style, Baskerville, Georgia, serif;
  font-size: clamp(3.6rem, 6vw, 5.8rem);
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 0.79;
}

h1 em {
  display: block;
  margin-left: 0.38em;
  color: var(--ghost);
  font-weight: inherit;
}

.intro-copy {
  max-width: 27ch;
  margin-bottom: 30px;
  color: #cdc5d3;
  font-size: 1.02rem;
  line-height: 1.55;
}

.how-card {
  padding: 18px 18px 12px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 20px;
  background: rgb(25 18 34 / 72%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%);
}

.how-card ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-card li {
  min-height: 42px;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  color: #cfc7d5;
  font-size: 0.86rem;
}

.step-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--ghost);
  background: rgb(134 237 255 / 10%);
  font-weight: 900;
}

.ghost-icon {
  color: var(--ghost-pale);
  text-shadow: 0 0 8px var(--ghost);
}

.lamp-icon {
  color: var(--candle);
  background: rgb(255 208 122 / 10%);
}

.ledger {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ledger > div {
  padding: 13px 14px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 15px;
  background: rgb(16 12 22 / 45%);
}

.ledger strong,
.ledger span {
  display: block;
}

.ledger strong {
  color: var(--cream);
  font-size: 1.08rem;
}

.ledger span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.69rem;
}

.game-frame {
  position: relative;
  width: 100%;
  padding: 16px;
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: 30px;
  background:
    linear-gradient(155deg, rgb(255 255 255 / 5%), transparent 22%),
    #1c1525;
  box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / 8%);
}

.game-header {
  min-height: 54px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.room-button {
  min-width: 0;
  padding: 5px 6px;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 7px;
  border: 0;
  color: var(--cream);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.room-button:hover strong {
  color: var(--ghost);
}

.room-number {
  grid-column: 1 / -1;
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.room-button strong {
  max-width: 18ch;
  overflow: hidden;
  font-family: Iowan Old Style, Baskerville, Georgia, serif;
  font-size: 1.02rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 140ms ease;
}

.status-pills {
  display: flex;
  gap: 7px;
}

.status-pill {
  min-width: 55px;
  height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 13px;
  background: #100d16;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%);
  font-size: 0.78rem;
}

.status-pill strong {
  font-size: 0.75rem;
}

.mini-ghost {
  width: 15px;
  height: 18px;
  clip-path: polygon(50% 0, 78% 8%, 100% 34%, 100% 100%, 72% 77%, 50% 100%, 28% 77%, 0 100%, 0 34%, 22% 8%);
  background: var(--ghost);
  box-shadow: 0 0 8px var(--ghost);
}

.light-pill {
  min-width: 70px;
  color: var(--candle);
  transition: color 250ms ease, border-color 250ms ease, background 250ms ease;
}

.light-pill.is-dark {
  color: #d5bdff;
  border-color: rgb(177 124 255 / 25%);
  background: #151026;
}

.board-wrap {
  --board-ratio: 5 / 6;
  position: relative;
  isolation: isolate;
  padding: 9px;
  border: 1px solid rgb(216 166 78 / 22%);
  border-radius: 22px;
  background: #0c0910;
  box-shadow: inset 0 0 0 3px #281c31, inset 0 0 35px #000;
}

.board {
  --cols: 5;
  --rows: 6;
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: var(--board-ratio);
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);
  overflow: hidden;
  border-radius: 15px;
  background: #34283c;
  box-shadow: inset 0 0 40px rgb(255 196 98 / 8%);
  transition: background 380ms ease, filter 380ms ease;
}

.board.light-off {
  background: #19172c;
  filter: saturate(0.9);
  box-shadow: inset 0 0 55px rgb(59 37 105 / 34%);
}

.floor-tile {
  position: relative;
  min-width: 0;
  border-right: 1px solid rgb(255 255 255 / 3%);
  border-bottom: 1px solid rgb(0 0 0 / 15%);
  background:
    radial-gradient(circle at 50% 42%, rgb(255 224 164 / 7%), transparent 58%),
    linear-gradient(145deg, rgb(255 255 255 / 2%), rgb(0 0 0 / 4%));
}

.floor-tile.alt {
  background:
    radial-gradient(circle at 50% 42%, rgb(123 78 145 / 8%), transparent 58%),
    rgb(12 9 16 / 6%);
}

.floor-tile.path-preview::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background: rgb(134 237 255 / 28%);
  box-shadow: 0 0 13px rgb(134 237 255 / 42%);
  animation: path-fade 650ms ease both;
}

.floor-tile::before {
  content: "";
  position: absolute;
  inset: 11%;
  border: 1px solid rgb(216 166 78 / 4%);
  border-radius: 4px;
}

.board::before,
.board::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.board::before {
  inset: 0;
  background:
    radial-gradient(circle at 8% 8%, rgb(255 208 122 / 32%) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 8%, rgb(255 208 122 / 32%) 0 2px, transparent 3px),
    radial-gradient(circle at 8% 92%, rgb(255 208 122 / 22%) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 92%, rgb(255 208 122 / 22%) 0 2px, transparent 3px);
  box-shadow: inset 0 0 38px rgb(3 2 7 / 48%), inset 0 0 0 3px rgb(16 10 20 / 58%);
}

.board::after {
  left: 10%;
  right: 10%;
  bottom: 2.2%;
  height: 2%;
  border-radius: 50%;
  opacity: 0.35;
  background: #050407;
  filter: blur(5px);
}

.board-vignette {
  position: absolute;
  z-index: 8;
  inset: 9px;
  border-radius: 15px;
  pointer-events: none;
  box-shadow: inset 0 0 38px rgb(2 1 5 / 58%);
}

.exit-label {
  position: absolute;
  z-index: 9;
  color: rgb(134 237 255 / 36%);
  font-size: 0.45rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  pointer-events: none;
  text-shadow: 0 0 8px rgb(134 237 255 / 55%);
}

.exit-label-top,
.exit-label-bottom {
  left: 50%;
  transform: translateX(-50%);
}

.exit-label-top {
  top: 1px;
}

.exit-label-bottom {
  bottom: 0;
}

.exit-label-left,
.exit-label-right {
  top: 50%;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}

.exit-label-left {
  left: 0;
}

.exit-label-right {
  right: 0;
}

.ghost {
  position: relative;
  z-index: 6;
  width: calc(100% - 10px);
  height: calc(100% - 8px);
  min-width: 34px;
  min-height: 36px;
  padding: 0;
  place-self: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ghost-shape {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(74%, 62px);
  aspect-ratio: 0.9;
  transform: translate(-50%, -50%);
  clip-path: polygon(50% 0, 72% 5%, 90% 19%, 100% 42%, 100% 89%, 82% 76%, 66% 100%, 50% 80%, 34% 100%, 18% 76%, 0 89%, 0 42%, 10% 19%, 28% 5%);
  color: #102331;
  background:
    radial-gradient(circle at 37% 39%, #183346 0 4%, transparent 5%),
    radial-gradient(circle at 63% 39%, #183346 0 4%, transparent 5%),
    linear-gradient(180deg, rgb(226 252 255 / 96%), rgb(134 237 255 / 78%));
  filter: drop-shadow(0 0 8px rgb(134 237 255 / 55%)) drop-shadow(0 8px 6px rgb(0 0 0 / 25%));
  transition: filter 150ms ease, transform 150ms ease;
  animation: ghost-float 2.2s ease-in-out infinite;
}

.ghost:nth-of-type(3n) .ghost-shape {
  animation-delay: -0.7s;
}

.ghost:hover .ghost-shape,
.ghost:focus-visible .ghost-shape {
  transform: translate(-50%, -54%) scale(1.06);
  filter: drop-shadow(0 0 13px rgb(134 237 255 / 92%)) drop-shadow(0 10px 7px rgb(0 0 0 / 28%));
}

.direction-arrow {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  color: #0d5570;
  font-size: clamp(0.92rem, 3.6vw, 1.25rem);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 1px 0 rgb(255 255 255 / 40%);
}

.lantern-mark {
  position: absolute;
  right: 3%;
  top: -3%;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 2px solid #fff1b7;
  border-radius: 50%;
  color: #714406;
  background: var(--candle);
  box-shadow: 0 0 12px var(--candle);
  font-size: 0.7rem;
  font-weight: 900;
}

.ghost.hinting .ghost-shape {
  animation: hint-pulse 720ms ease-in-out 3;
}

.ghost.blocked {
  animation: ghost-shake 330ms ease;
}

.ghost.blocked .ghost-shape {
  filter: drop-shadow(0 0 11px var(--danger));
}

.ghost.blocker .ghost-shape {
  animation: blocker-pulse 420ms ease 2;
}

.ghost.leaving {
  pointer-events: none;
}

.ghost.leaving.dir-E {
  animation: leave-east 430ms cubic-bezier(0.45, 0.02, 0.82, 0.3) forwards;
}

.ghost.leaving.dir-W {
  animation: leave-west 430ms cubic-bezier(0.45, 0.02, 0.82, 0.3) forwards;
}

.ghost.leaving.dir-N {
  animation: leave-north 430ms cubic-bezier(0.45, 0.02, 0.82, 0.3) forwards;
}

.ghost.leaving.dir-S {
  animation: leave-south 430ms cubic-bezier(0.45, 0.02, 0.82, 0.3) forwards;
}

.barrier {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  border-radius: 99px;
  opacity: 0.2;
  transition: opacity 300ms ease, box-shadow 300ms ease, filter 300ms ease;
}

.barrier.vertical {
  width: 5px;
  transform: translateX(-50%);
}

.barrier.horizontal {
  height: 5px;
  transform: translateY(-50%);
}

.barrier.light {
  background: repeating-linear-gradient(0deg, #fff1ae 0 7px, #a86d16 7px 10px);
}

.barrier.dark {
  background: repeating-linear-gradient(0deg, #dbc3ff 0 7px, #642fa1 7px 10px);
}

.barrier.active {
  opacity: 1;
  filter: saturate(1.15);
}

.barrier.light.active {
  box-shadow: 0 0 8px 2px rgb(255 208 122 / 88%);
}

.barrier.dark.active {
  box-shadow: 0 0 8px 2px rgb(177 124 255 / 88%);
}

.barrier.blocker {
  animation: blocker-pulse 420ms ease 2;
}

.coach {
  min-height: 58px;
  margin-top: 12px;
  padding: 10px 13px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 9px;
  border: 1px solid rgb(134 237 255 / 11%);
  border-radius: 15px;
  color: #c9c1ce;
  background: rgb(10 8 14 / 34%);
}

.coach.blocked-message {
  border-color: rgb(255 128 153 / 25%);
}

.coach-spark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--ghost);
  background: rgb(134 237 255 / 10%);
}

.coach.blocked-message .coach-spark {
  color: var(--danger);
  background: rgb(255 128 153 / 10%);
}

.coach p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.35;
}

.controls {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.control-button {
  min-height: 52px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 14px;
  color: #b9b1c0;
  background: #15101c;
  cursor: pointer;
  transition: transform 130ms ease, border-color 130ms ease, color 130ms ease, background 130ms ease;
}

.control-button > span:first-child {
  color: var(--cream);
  font-size: 1.05rem;
  font-weight: 900;
}

.control-button > span:last-child {
  font-size: 0.63rem;
  font-weight: 700;
}

.control-button:hover:not(:disabled) {
  border-color: rgb(134 237 255 / 28%);
  color: var(--ghost);
  background: #1b1424;
  transform: translateY(-1px);
}

.control-button:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.control-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.hint-button {
  border-color: rgb(134 237 255 / 18%);
  background: rgb(35 61 70 / 42%);
}

.hint-button > span:first-child {
  color: var(--ghost);
}

.completion-panel {
  position: absolute;
  z-index: 12;
  inset: 9px;
  padding: 28px 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 32%, rgb(134 237 255 / 18%), transparent 35%),
    rgb(17 12 24 / 92%);
  backdrop-filter: blur(8px);
  animation: completion-in 430ms ease both;
}

.completion-panel[hidden] {
  display: none;
}

.completion-ghost {
  width: 54px;
  height: 62px;
  margin-bottom: 22px;
  animation: ghost-float 2s ease-in-out infinite;
}

.completion-ghost i {
  top: 23px;
  width: 6px;
  height: 9px;
}

.completion-ghost i:first-child {
  left: 15px;
}

.completion-ghost i:last-child {
  right: 15px;
}

.completion-panel h2 {
  margin-bottom: 8px;
  font-family: Iowan Old Style, Baskerville, Georgia, serif;
  font-size: 1.8rem;
}

.completion-panel > p:not(.eyebrow) {
  max-width: 27ch;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.stars {
  margin-bottom: 12px;
  color: var(--candle);
  font-size: 1.7rem;
  letter-spacing: 0.12em;
  text-shadow: 0 0 14px rgb(255 208 122 / 35%);
}

.stars .empty-star {
  color: rgb(255 255 255 / 15%);
  text-shadow: none;
}

.primary-button {
  min-height: 48px;
  margin-top: 5px;
  padding: 0 20px;
  border: 0;
  border-radius: 15px;
  color: #0c2f3a;
  background: linear-gradient(180deg, #b9f7ff, var(--ghost));
  box-shadow: 0 9px 24px rgb(88 214 233 / 22%), inset 0 1px 0 #fff;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
}

.primary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.side-note {
  width: min(100%, 290px);
  justify-self: start;
}

.legend-item {
  padding: 14px 0;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgb(255 255 255 / 7%);
}

.legend-swatch {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 900;
}

.legend-swatch.cyan {
  color: #0d5570;
  background: var(--ghost);
  box-shadow: 0 0 14px rgb(134 237 255 / 18%);
}

.legend-swatch.gold::after,
.legend-swatch.violet::after {
  content: "";
  width: 5px;
  height: 28px;
  border-radius: 99px;
}

.legend-swatch.gold {
  background: rgb(255 208 122 / 8%);
}

.legend-swatch.gold::after {
  background: var(--candle);
  box-shadow: 0 0 10px var(--candle);
}

.legend-swatch.violet {
  background: rgb(177 124 255 / 8%);
}

.legend-swatch.violet::after {
  background: #c6a1ff;
  box-shadow: 0 0 10px var(--violet);
}

.legend-item strong,
.legend-item span {
  display: block;
}

.legend-item strong {
  margin-bottom: 3px;
  font-size: 0.78rem;
}

.legend-item div span {
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.35;
}

.daily-button,
.daily-dialog-button {
  width: 100%;
  min-height: 62px;
  margin-top: 18px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgb(177 124 255 / 22%);
  border-radius: 18px;
  color: var(--cream);
  text-align: left;
  background: linear-gradient(135deg, rgb(86 44 124 / 48%), rgb(28 20 40 / 75%));
  cursor: pointer;
}

.daily-button:hover,
.daily-dialog-button:hover {
  border-color: rgb(177 124 255 / 48%);
  background: linear-gradient(135deg, rgb(107 54 153 / 58%), rgb(34 24 47 / 85%));
}

.daily-button > span:first-child {
  color: #d8c5ff;
  font-size: 1.35rem;
}

.daily-button strong,
.daily-button small,
.daily-dialog-button strong,
.daily-dialog-button small {
  display: block;
}

.daily-button strong,
.daily-dialog-button strong {
  font-size: 0.77rem;
}

.daily-button small,
.daily-dialog-button small {
  margin-top: 3px;
  color: #bdb1c9;
  font-size: 0.64rem;
}

footer {
  width: min(1320px, calc(100% - 40px));
  min-height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgb(255 255 255 / 6%);
  color: #7f7787;
  font-size: 0.67rem;
}

footer button {
  padding: 8px;
  border: 0;
  color: #8f8599;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
  cursor: pointer;
}

.room-dialog {
  width: min(480px, calc(100% - 28px));
  max-height: min(720px, calc(100dvh - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 25px;
  color: var(--cream);
  background: #1d1626;
  box-shadow: 0 28px 90px #000;
}

.room-dialog::backdrop {
  background: rgb(5 3 8 / 74%);
  backdrop-filter: blur(5px);
}

.dialog-shell {
  max-height: inherit;
  padding: 22px;
  overflow-y: auto;
}

.dialog-shell > header {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.dialog-shell h2 {
  margin: 0;
  font-family: Iowan Old Style, Baskerville, Georgia, serif;
  font-size: 1.7rem;
}

.close-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 14px;
  color: var(--cream);
  background: #120e18;
  font-size: 1.4rem;
  cursor: pointer;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}

.room-choice {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 15px;
  color: #c7bfcc;
  background: #15101c;
  cursor: pointer;
}

.room-choice:hover:not(:disabled),
.room-choice.current {
  border-color: rgb(134 237 255 / 35%);
  color: var(--ghost);
  background: rgb(38 63 70 / 35%);
}

.room-choice:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.room-choice strong {
  font-size: 0.88rem;
}

.room-choice .room-stars {
  position: absolute;
  bottom: 5px;
  color: var(--candle);
  font-size: 0.46rem;
  letter-spacing: -0.07em;
}

.daily-dialog-button {
  margin-top: 16px;
}

.moon-badge {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #d8c5ff;
  background: rgb(177 124 255 / 12%);
  font-size: 1.1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes ghost-float {
  0%,
  100% {
    margin-top: 1px;
  }
  50% {
    margin-top: -4px;
  }
}

@keyframes hint-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    filter: drop-shadow(0 0 8px rgb(134 237 255 / 55%));
  }
  50% {
    transform: translate(-50%, -54%) scale(1.14);
    filter: drop-shadow(0 0 20px rgb(134 237 255));
  }
}

@keyframes ghost-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px) rotate(-2deg);
  }
  55% {
    transform: translateX(5px) rotate(2deg);
  }
  78% {
    transform: translateX(-2px);
  }
}

@keyframes blocker-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 7px rgb(134 237 255 / 45%));
  }
  50% {
    filter: drop-shadow(0 0 15px var(--danger));
  }
}

@keyframes leave-east {
  to {
    transform: translateX(650%) scale(0.72);
    opacity: 0;
    filter: blur(2px);
  }
}

@keyframes leave-west {
  to {
    transform: translateX(-650%) scale(0.72);
    opacity: 0;
    filter: blur(2px);
  }
}

@keyframes leave-north {
  to {
    transform: translateY(-760%) scale(0.72);
    opacity: 0;
    filter: blur(2px);
  }
}

@keyframes leave-south {
  to {
    transform: translateY(760%) scale(0.72);
    opacity: 0;
    filter: blur(2px);
  }
}

@keyframes path-fade {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  to {
    transform: scale(1.2);
    opacity: 0.18;
  }
}

@keyframes completion-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 1040px) {
  .site-shell {
    grid-template-columns: minmax(190px, 260px) minmax(330px, 460px);
    justify-content: center;
  }

  .side-note {
    display: none;
  }
}

@media (min-width: 741px) and (max-height: 820px) {
  .site-shell {
    padding-top: 20px;
    padding-bottom: 18px;
  }

  .game-frame {
    width: min(100%, 400px);
    justify-self: center;
    padding: 13px;
  }

  .game-header {
    min-height: 48px;
    margin-bottom: 8px;
  }

  .coach {
    min-height: 52px;
    margin-top: 8px;
  }

  .controls {
    margin-top: 8px;
  }

  .control-button {
    min-height: 48px;
  }
}

@media (max-width: 740px) {
  body {
    background: #130e1a;
  }

  .site-shell {
    width: 100%;
    min-height: 100dvh;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    display: block;
  }

  .intro {
    width: 100%;
    padding: 13px 18px 9px;
    display: grid;
    grid-template-columns: 36px 1fr;
    align-items: center;
    column-gap: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    margin: 0;
    border-radius: 12px;
  }

  .brand-ghost {
    width: 18px;
    height: 22px;
  }

  .brand-ghost i {
    top: 9px;
    width: 2px;
    height: 3px;
  }

  .brand-ghost i:first-child {
    left: 5px;
  }

  .brand-ghost i:last-child {
    right: 5px;
  }

  .intro .eyebrow,
  .intro-copy,
  .how-card,
  .ledger {
    display: none;
  }

  h1 {
    max-width: none;
    margin: 0;
    font-size: 1.55rem;
    letter-spacing: -0.04em;
    line-height: 1;
  }

  h1 em {
    display: inline;
    margin-left: 0.1em;
  }

  .game-frame {
    width: 100%;
    min-height: calc(100dvh - 58px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 10px 12px 12px;
    border-width: 1px 0 0;
    border-radius: 24px 24px 0 0;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%);
  }

  .game-header {
    min-height: 48px;
    margin-bottom: 7px;
  }

  .board-wrap {
    width: min(100%, 52dvh);
    margin-inline: auto;
  }

  .coach {
    min-height: 50px;
    margin-top: 8px;
    padding: 8px 10px;
  }

  .controls {
    margin-top: 8px;
  }

  .control-button {
    min-height: 50px;
  }

  footer {
    display: none;
  }
}

@media (max-width: 390px) {
  .status-pill {
    min-width: 48px;
    padding: 0 7px;
  }

  .light-pill {
    min-width: 62px;
  }

  .room-button strong {
    max-width: 13ch;
  }

  .coach p {
    font-size: 0.7rem;
  }

  .control-button {
    min-height: 47px;
  }
}

@media (max-width: 740px) and (max-height: 620px) {
  .intro {
    padding: 7px 14px 5px;
  }

  .game-frame {
    min-height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding-top: 7px;
  }

  .game-header {
    min-height: 40px;
    margin-bottom: 5px;
  }

  .board-wrap {
    width: min(100%, 44dvh);
  }

  .coach {
    min-height: 42px;
    margin-top: 6px;
    padding: 6px 9px;
  }

  .coach p {
    font-size: 0.65rem;
  }

  .controls {
    margin-top: 6px;
    gap: 6px;
  }

  .control-button {
    min-height: 44px;
  }
}

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