:root {
  color-scheme: light;
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  --ink: #241c27;
  --muted: #756b78;
  --paper: #f8f2e9;
  --mist: #17121b;
  --line: #55485a;
  --orange: #e96f35;
  --orange-dark: #b8451d;
  --amber: #f4b64f;
  --teal: #278d82;
  --berry: #b1496c;
  --violet: #75629a;
  --danger: #b22e32;
  --shadow: 0 18px 48px rgba(32, 28, 36, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--mist);
}

button,
dialog {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button:focus-visible {
  outline: 3px solid #5caea3;
  outline-offset: 3px;
}

.entry-flow {
  min-height: 100svh;
  color: #fff;
  background: #1c1720;
}

.entry-screen {
  min-height: 100svh;
}

.welcome-screen {
  position: relative;
  display: grid;
  overflow: hidden;
  background: #1b1520;
}

.welcome-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.welcome-screen::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 18%;
  background: rgba(23, 16, 26, 0.68);
  pointer-events: none;
}

.welcome-action {
  position: relative;
  z-index: 1;
  align-self: end;
  justify-self: center;
  padding: 0 18px clamp(28px, 7vh, 72px);
}

.entry-button {
  min-height: 54px;
  padding: 13px 24px;
  color: #2b1c20;
  background: #f2b04d;
  border: 1px solid #ffd27b;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(18, 12, 20, 0.3);
  font-weight: 900;
}

.entry-button:hover {
  background: #ffc566;
}

.story-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(390px, 0.65fr);
  background: #211a25;
}

.story-art-wrap {
  min-height: 100svh;
  overflow: hidden;
}

.story-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.story-copy {
  padding: clamp(34px, 6vw, 82px) clamp(28px, 5vw, 68px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  border-left: 1px solid #514254;
}

.speaker-line {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 16px;
}

.speaker-line img,
.ohm-reminder img {
  width: 76px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid #e7a64e;
  border-radius: 50%;
}

.speaker-line .eyebrow {
  color: #f3ae69;
}

.speaker-line h1 {
  font-size: clamp(30px, 3vw, 44px);
}

.setup-content h1 {
  font-size: clamp(30px, 4vw, 54px);
}

.story-text {
  margin: 34px 0 26px;
  color: #e7dfe8;
  font-size: 17px;
  line-height: 1.9;
}

.story-text p:last-child {
  margin-bottom: 0;
}

.setup-screen {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(480px, 1.1fr);
  color: var(--ink);
  background: #f7f2eb;
}

.setup-portrait {
  min-height: 100svh;
  overflow: hidden;
  background: #2a202c;
}

.setup-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.setup-content {
  width: min(640px, 100%);
  padding: clamp(34px, 7vw, 86px);
  align-self: center;
  justify-self: center;
}

.ohm-reminder {
  margin: 28px 0;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 16px;
}

.ohm-reminder img {
  width: 72px;
}

.ohm-reminder p {
  margin: 0;
  color: #514a55;
  line-height: 1.7;
}

.traveler-form {
  display: grid;
  gap: 16px;
}

.traveler-form label {
  display: grid;
  gap: 7px;
  color: #4f4751;
  font-size: 13px;
  font-weight: 800;
}

.traveler-form input {
  width: 100%;
  min-height: 50px;
  padding: 10px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #a9a0aa;
  border-radius: 5px;
  font: inherit;
}

.traveler-form input:focus {
  border-color: var(--orange-dark);
  outline: 3px solid rgba(232, 103, 39, 0.18);
}

.form-error {
  min-height: 20px;
  margin: -4px 0 0;
  color: #a4272d;
  font-size: 13px;
  font-weight: 800;
}

.setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.setup-actions .entry-button,
.setup-actions .secondary-button {
  flex: 1 1 190px;
}

.topbar {
  min-height: 88px;
  padding: 16px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: #201c24;
  border-bottom: 4px solid var(--orange);
}

.brand-block,
.top-actions,
.section-heading,
.status-item,
.rank-summary {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #221a24;
  background: var(--amber);
  border-radius: 50%;
  font-size: 28px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #f7b873;
}

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

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 4px;
  font-size: 17px;
  letter-spacing: 0;
}

.top-actions {
  gap: 8px;
}

.icon-button,
.dialog-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #353039;
  border: 1px solid #57505e;
  border-radius: 6px;
  font-weight: 900;
}

.icon-button:hover {
  background: #49414f;
}

main {
  width: min(1420px, 100%);
  margin: 0 auto;
}

.status-band {
  min-height: 92px;
  padding: 16px clamp(18px, 4vw, 52px);
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 0.7fr)) minmax(260px, 1.5fr);
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.status-item {
  min-height: 50px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.status-item + .status-item {
  padding-left: clamp(14px, 2vw, 28px);
}

.status-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-item strong {
  margin-top: 2px;
  font-size: 25px;
}

.rank-summary {
  position: relative;
  min-height: 58px;
  padding-left: clamp(18px, 3vw, 36px);
  gap: 12px;
}

.rank-summary > div:not(.rank-track) {
  display: grid;
}

.rank-icon {
  font-size: 30px;
}

.rank-track {
  position: absolute;
  left: clamp(18px, 3vw, 36px);
  right: 0;
  bottom: 0;
  height: 5px;
  overflow: hidden;
  background: #dfe4e1;
  border-radius: 3px;
}

.rank-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--teal);
  transition: width 280ms ease;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(520px, 1.65fr);
  min-height: 610px;
  background: #fff;
}

.role-panel {
  padding: 32px clamp(22px, 3vw, 38px);
  background: #f7faf8;
  border-right: 1px solid var(--line);
}

.section-heading {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.date-chip {
  padding: 5px 9px;
  color: #fff;
  background: var(--teal);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
}

.role-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.role-placeholder {
  min-height: 310px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  background: #edf2ef;
  border: 1px dashed #adb8b2;
  border-radius: 6px;
  text-align: center;
}

.role-placeholder span {
  font-size: 56px;
}

.role-placeholder p {
  margin: 0;
}

.role-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.role-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.role-card-body {
  padding: 16px;
}

.role-card-body p {
  margin: 12px 0 0;
  color: #514a55;
  line-height: 1.65;
}

.role-owner {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.role-card.compact {
  display: grid;
  grid-template-columns: 88px 1fr;
  min-height: 88px;
}

.role-card.compact > img {
  width: 88px;
  height: 100%;
}

.role-card.compact .role-card-body {
  padding: 12px;
}

.role-card.compact h3 {
  margin-bottom: 5px;
}

.attribute {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.attribute-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  object-fit: contain;
}

.attribute.strength,
.fighter-button.strength em {
  color: #a83f1b;
}

.attribute.agility,
.fighter-button.agility em {
  color: #16756c;
}

.attribute.charm,
.fighter-button.charm em {
  color: #984064;
}

.attribute-key {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 48px;
  padding: 11px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--orange-dark);
  border: 1px solid var(--orange-dark);
}

.primary-button:hover:not(:disabled) {
  background: #873116;
}

.secondary-button {
  color: var(--ink);
  background: #fff;
  border: 1px solid #aca7ae;
}

.danger-button {
  color: #fff;
  background: var(--danger);
  border: 1px solid var(--danger);
}

.full-width {
  width: 100%;
}

.play-stage {
  min-width: 0;
  background: #252129;
}

.shop-approach {
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(310px, 1.1fr) minmax(320px, 0.9fr);
  color: #fff;
}

.shop-approach figure {
  min-height: 520px;
  margin: 0;
  overflow: hidden;
}

.shop-approach figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-approach-copy {
  padding: 38px clamp(28px, 5vw, 62px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.shop-approach-copy .eyebrow {
  color: #f3ae69;
}

.shop-approach-copy h2 {
  margin-bottom: 16px;
  font-size: 36px;
}

.shop-approach-copy p:not(.eyebrow) {
  color: #d6d0d8;
  line-height: 1.75;
}

.stage-idle {
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(290px, 0.9fr) minmax(320px, 1.1fr);
  color: #fff;
}

.stage-copy {
  padding: clamp(40px, 7vw, 88px) clamp(28px, 5vw, 70px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.stage-copy .eyebrow,
.encounter-copy .eyebrow {
  color: #f3ae69;
}

.stage-copy h2 {
  max-width: 13ch;
  margin-bottom: 18px;
  font-size: 38px;
}

.stage-copy p:not(.eyebrow) {
  max-width: 46ch;
  color: #d6d0d8;
  line-height: 1.75;
}

.stage-teaser {
  position: relative;
  min-height: 420px;
  overflow: hidden;
}

.stage-teaser::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 18px solid rgba(32, 28, 36, 0.56);
  pointer-events: none;
}

.stage-teaser img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.stage-teaser span {
  position: absolute;
  right: 22px;
  bottom: 24px;
  left: 22px;
  z-index: 1;
  padding: 12px 14px;
  color: #2c2022;
  background: #f5c165;
  border-radius: 4px;
  font-weight: 900;
  text-align: center;
}

.encounter-layout {
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(380px, 1.1fr);
  color: #fff;
}

.monster-figure {
  position: relative;
  min-height: 460px;
  margin: 0;
  overflow: hidden;
  border-right: 1px solid #514953;
}

.monster-figure img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.monster-figure figcaption {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 8px 12px;
  color: #241c22;
  background: var(--amber);
  border-radius: 4px;
  font-weight: 900;
}

.encounter-copy {
  padding: 36px clamp(26px, 4vw, 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.encounter-copy h2 {
  margin-bottom: 16px;
  font-size: 32px;
}

blockquote {
  margin: 0 0 18px;
  padding: 16px 18px;
  color: #f5eef5;
  background: #332e37;
  border-left: 4px solid var(--orange);
  border-radius: 0 4px 4px 0;
  line-height: 1.75;
}

.fighter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fighter-button {
  min-width: 0;
  min-height: 86px;
  padding: 0;
  display: grid;
  grid-template-columns: 74px 1fr;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 2px solid #fff;
  border-radius: 6px;
  text-align: left;
}

.fighter-button:hover:not(:disabled) {
  border-color: var(--amber);
}

.fighter-button .fighter-portrait {
  width: 74px;
  height: 100%;
  display: block;
  object-fit: cover;
}

.fighter-button span {
  min-width: 0;
  padding: 9px 10px;
  display: grid;
  align-content: center;
}

.fighter-button small,
.fighter-button em {
  font-size: 11px;
}

.fighter-button strong {
  overflow-wrap: anywhere;
}

.fighter-button em {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
}

.fighter-button em .attribute-icon {
  width: 20px;
  height: 20px;
}

.hidden-hint {
  margin: 14px 0 0;
  color: #aaa2ad;
  font-size: 12px;
  line-height: 1.6;
}

.outcome-notice {
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: 4px;
}

.outcome-notice p {
  margin: 4px 0 0;
  color: inherit;
  font-size: 13px;
  line-height: 1.55;
}

.outcome-notice.tie {
  color: #2a2113;
  background: #eabf5f;
}

.outcome-notice.failure {
  color: #fff;
  background: #8f303b;
}

.route-band {
  padding: 32px clamp(18px, 4vw, 52px) 44px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.route-heading > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.shop-route {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.shop-stop {
  min-height: 118px;
  padding: 0 16px 0 0;
  display: grid;
  grid-template-columns: 112px 1fr auto;
  align-items: center;
  gap: 10px;
  background: #f3f4f1;
  border: 1px solid var(--line);
  border-top: 5px solid #9f9f9a;
  border-radius: 6px;
}

.shop-thumbnail {
  width: 112px;
  height: 100%;
  min-height: 112px;
  display: block;
  object-fit: cover;
  border-right: 1px solid var(--line);
}

.shop-stop.amber { border-top-color: var(--amber); }
.shop-stop.orange { border-top-color: var(--orange); }
.shop-stop.violet { border-top-color: var(--violet); }
.shop-stop.teal { border-top-color: var(--teal); }
.shop-stop.berry { border-top-color: var(--berry); }

.shop-stop:not(.collected) {
  color: #716b74;
}

.shop-stop h3,
.shop-stop p {
  margin: 0;
}

.shop-stop h3 {
  font-size: 14px;
}

.shop-stop p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.shop-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 22px;
}

.game-dialog {
  width: min(820px, calc(100vw - 28px));
  max-height: min(88vh, 900px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.game-dialog::backdrop {
  background: rgba(24, 20, 27, 0.76);
}

.dialog-close {
  position: sticky;
  top: 12px;
  z-index: 3;
  margin: 12px 12px 0 auto;
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  font-size: 24px;
}

#dialogContent {
  padding: 6px clamp(22px, 5vw, 52px) 42px;
}

.dialog-heading {
  margin-bottom: 22px;
}

.dialog-heading p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
}

.reveal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.reveal-grid .role-card > img {
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  background: #1c151f;
}

.dialog-note {
  margin: 18px 0 0;
  padding: 12px 14px;
  color: #31564f;
  background: #e1efeb;
  border-left: 4px solid var(--teal);
  line-height: 1.6;
}

.reward-layout {
  display: grid;
  justify-items: center;
  text-align: center;
}

.reward-layout > p:not(.eyebrow):not(.result-story) {
  max-width: 48ch;
  color: var(--muted);
  line-height: 1.7;
}

.reward-image {
  width: min(360px, 100%);
  aspect-ratio: 1;
  margin-bottom: 20px;
  display: block;
  object-fit: cover;
  border-radius: 6px;
}

.reward-meta {
  margin: 12px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.reward-meta span {
  padding: 7px 10px;
  color: #fff;
  background: var(--teal);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
}

.result-story {
  margin: 10px 0 20px;
  padding: 14px;
  width: 100%;
  color: #514a55;
  background: #f2f4f1;
  border-radius: 4px;
  line-height: 1.7;
}

.shop-quote {
  margin: 0 0 20px;
  color: #6f2f42;
  font-weight: 800;
}

.collection-list {
  display: grid;
  gap: 10px;
}

.collection-entry {
  padding: 14px;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  background: #f5f6f3;
  border: 1px solid var(--line);
  border-radius: 6px;
}

button.collection-entry {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
}

.candy-collection-entry {
  min-height: 156px;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.candy-collection-entry:hover,
.candy-collection-entry:focus-visible {
  background: #3a303e;
  border-color: #c88a43;
  transform: translateY(-1px);
}

.candy-collection-entry:focus-visible {
  outline: 3px solid rgba(239, 184, 87, 0.34);
  outline-offset: 2px;
}

.candy-collection-entry .collection-image {
  width: 128px;
  height: 128px;
  object-fit: contain;
  background: #1c161f;
}

.collection-empty {
  min-height: 250px;
  padding: 36px 24px;
  display: grid;
  place-items: center;
  color: #cfc2d0;
  background: #322a36;
  border: 1px dashed #66536a;
  border-radius: 7px;
  text-align: center;
}

.collection-empty h3 {
  margin: 0 0 8px;
  color: #fff3df;
  font-size: 24px;
}

.collection-empty p {
  max-width: 36ch;
  margin: 0;
  line-height: 1.7;
}

.candy-detail-view {
  display: grid;
  justify-items: center;
  gap: 20px;
}

.candy-detail-back {
  justify-self: start;
  min-height: 40px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f8f2e9;
  background: #342b38;
  border-color: #655769;
  font-weight: 800;
}

.candy-detail-back:hover,
.candy-detail-back:focus-visible {
  color: #fff6e8;
  background: #473749;
  border-color: #c88a43;
}

.candy-detail-image {
  width: min(100%, 640px);
  max-height: min(62vh, 640px);
  display: block;
  object-fit: contain;
  background: #18121a;
  border: 1px solid #5f4e64;
  border-radius: 7px;
}

.candy-detail-copy {
  width: min(100%, 640px);
  text-align: center;
}

.candy-detail-copy h2 {
  margin: 4px 0 10px;
  color: #fff3df;
  font-size: clamp(26px, 4vw, 38px);
}

.candy-detail-copy > p:not(.eyebrow) {
  margin: 0;
  color: #cfc2d0;
  line-height: 1.7;
}

.candy-quality-summary {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.candy-quality-summary span {
  padding: 10px;
  display: grid;
  gap: 2px;
  color: #d7c9d7;
  background: #322a36;
  border: 1px solid #594c5e;
  border-radius: 5px;
  font-size: 12px;
}

.candy-quality-summary strong {
  color: #f4b64f;
  font-size: 20px;
}

@media (max-width: 600px) {
  .candy-collection-entry {
    min-height: 122px;
    grid-template-columns: 96px minmax(0, 1fr);
    padding: 10px;
  }

  .candy-collection-entry .collection-image {
    width: 96px;
    height: 96px;
  }

  .collection-empty {
    min-height: 210px;
    padding: 28px 18px;
  }

  .candy-detail-image {
    max-height: 56vh;
  }
}

.collection-image,
.collection-mystery {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 28px;
}

.rules-attributes {
  margin-bottom: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 18px;
  background: #f3f0f4;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.rules-attributes img {
  width: 150px;
  height: 150px;
  display: block;
  object-fit: contain;
}

.rules-attributes p {
  margin: 0;
  color: #514a55;
  line-height: 1.7;
}

.collection-entry h3,
.collection-entry p {
  margin: 0;
}

.collection-entry p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.collection-entry small {
  display: block;
  margin-top: 7px;
  color: var(--teal);
  font-weight: 800;
}

.collection-entry.locked {
  filter: grayscale(1);
  opacity: 0.58;
}

.rules-list {
  margin: 0;
  padding-left: 24px;
}

.rules-list li {
  padding: 9px 0;
  line-height: 1.65;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  color: #fff;
  background: #302b33;
  border-left: 4px solid var(--teal);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.toast.warning {
  border-left-color: var(--amber);
}

.toast.success {
  border-left-color: #69ba8c;
}

/* Immersive storybook presentation */

.welcome-mobile-title {
  display: none;
}

.entry-screen:not([hidden]) {
  animation: scene-in 320ms ease both;
}

.story-screen {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  overflow: hidden;
}

.story-art-wrap {
  position: absolute;
  inset: 0;
  min-height: 100svh;
}

.story-art {
  min-height: 100%;
}

.story-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 280px;
  padding: 28px clamp(28px, 5vw, 72px);
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(420px, 1.35fr) auto;
  align-items: center;
  gap: clamp(24px, 4vw, 60px);
  background: rgba(25, 18, 28, 0.95);
  border-top: 1px solid #6d586d;
  border-left: 0;
}

.speaker-line h1 {
  font-size: 42px;
}

.story-text {
  margin: 0;
  font-size: 16px;
}

.story-copy .entry-button {
  min-width: 220px;
}

.setup-screen {
  position: relative;
  display: block;
  min-height: 100svh;
  color: #fff;
  background: #1c1720;
  overflow: hidden;
}

.setup-portrait {
  position: absolute;
  inset: 0;
  min-height: 100%;
}

.setup-portrait img {
  object-position: center 38%;
}

.setup-content {
  position: relative;
  z-index: 1;
  width: min(620px, 48vw);
  min-height: 100svh;
  margin: 0 0 0 auto;
  padding: 64px clamp(36px, 5vw, 74px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  background: rgba(28, 22, 31, 0.96);
  border-left: 1px solid #6d586d;
}

.setup-content h1 {
  font-size: 46px;
}

.setup-content .eyebrow,
.story-copy .eyebrow {
  color: #f4b64f;
}

.ohm-reminder {
  padding: 14px 0;
  border-top: 1px solid #574a5b;
  border-bottom: 1px solid #574a5b;
}

.ohm-reminder p {
  color: #e1d8e2;
}

.traveler-form label {
  color: #e8dfe8;
}

.traveler-form input {
  color: #241c27;
  background: #fbf6ee;
  border-color: #827586;
}

.setup-actions .secondary-button {
  color: #f8f2e9;
  background: #332a37;
  border-color: #746779;
}

.app-shell {
  min-height: 100svh;
  color: #f8f2e9;
  background: #17121b;
}

.topbar {
  min-height: 76px;
  padding-top: 12px;
  padding-bottom: 12px;
  background: #1b161f;
  border-bottom-color: #c9572a;
}

.brand-mark {
  color: #33202b;
  background: #f4b64f;
}

.icon-button {
  color: #f8f2e9;
  background: #302735;
  border-color: #65596a;
}

.icon-button:hover {
  background: #46394a;
}

main {
  width: min(1480px, 100%);
}

.status-band {
  min-height: 78px;
  color: #fff;
  background: #261f2a;
  border-color: #4c4050;
}

.status-item {
  border-color: #55485a;
}

.status-label {
  color: #bfb2c1;
}

.rank-track {
  background: #4c4050;
}

.rank-track span {
  background: #46a699;
}

.game-layout {
  min-height: calc(100svh - 154px);
  padding: 24px;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.45fr);
  gap: 18px;
  background: #17121b;
}

.play-stage {
  order: 1;
  min-height: 660px;
  overflow: hidden;
  background: #241d27;
  border: 1px solid #514454;
  border-radius: 8px;
}

.role-panel {
  order: 2;
  min-width: 0;
  padding: 26px 22px;
  color: #f8f2e9;
  background: #241d27;
  border: 1px solid #514454;
  border-radius: 8px;
}

.role-panel .eyebrow {
  color: #f4b64f;
}

.role-card {
  color: #f8f2e9;
  background: #312837;
  border-color: #5a4c5f;
}

.role-card-body p,
.role-owner {
  color: #cfc2d0;
}

.role-placeholder {
  min-height: 330px;
  color: #c1b5c3;
  background: #2d2531;
  border-color: #706274;
}

.attribute-key {
  display: none;
}

.primary-button {
  color: #2b1d23;
  background: #f4b64f;
  border-color: #f8c86f;
}

.primary-button:hover:not(:disabled) {
  background: #ffc96f;
}

.secondary-button {
  color: #f8f2e9;
  background: #332a37;
  border-color: #746779;
}

.stage-idle {
  position: relative;
  height: 100%;
  min-height: 660px;
  display: grid;
  color: #fff;
  overflow: hidden;
}

.stage-teaser {
  position: absolute;
  inset: 0;
  height: 100%;
  min-height: 100%;
}

.stage-teaser::after {
  display: none;
}

.stage-teaser img {
  animation: art-reveal 480ms ease both;
}

.stage-teaser span {
  display: none;
}

.stage-copy {
  position: relative;
  z-index: 1;
  width: min(780px, calc(100% - 42px));
  margin: auto 0 22px 22px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  gap: 18px;
  color: #fff;
  background: rgba(27, 21, 30, 0.94);
  border: 1px solid #716174;
  border-radius: 7px;
}

.stage-guide-portrait {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border: 2px solid #f4b64f;
  border-radius: 50%;
}

.stage-guide-copy h2 {
  max-width: none;
  margin-bottom: 9px;
  font-size: 30px;
}

.stage-guide-copy p:not(.eyebrow) {
  max-width: 62ch;
  margin-bottom: 14px;
  color: #ded5df;
  line-height: 1.65;
}

.encounter-layout {
  height: 100%;
  min-height: 660px;
  grid-template-columns: minmax(360px, 1.12fr) minmax(360px, 0.88fr);
  background: #241d27;
}

.monster-figure {
  height: 100%;
  min-height: 660px;
  border-color: #514454;
}

.monster-figure img {
  animation: art-reveal 420ms ease both;
}

.monster-figure figcaption {
  color: #2b1d23;
  background: #f4b64f;
}

.encounter-copy {
  background: #241d27;
}

blockquote {
  color: #f1e8f0;
  background: #342b38;
  border-left-color: #e96f35;
}

.fighter-button {
  color: #f8f2e9;
  background: #332a37;
  border-color: #5c4f61;
}

.fighter-button:hover:not(:disabled) {
  border-color: #f4b64f;
}

.shop-approach {
  position: relative;
  height: 100%;
  min-height: 660px;
  display: grid;
  align-items: end;
  overflow: hidden;
}

.shop-approach figure {
  position: absolute;
  inset: 0;
  height: 100%;
  min-height: 100%;
}

.shop-approach figure img {
  animation: art-reveal 480ms ease both;
}

.shop-approach-copy {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100% - 44px));
  min-height: 0;
  margin: 0 0 22px 22px;
  padding: 22px 24px;
  color: #fff;
  background: rgba(27, 21, 30, 0.95);
  border: 1px solid #716174;
  border-radius: 7px;
}

.shop-approach-copy p:not(.eyebrow) {
  color: #ded5df;
}

.game-dialog {
  color: #f8f2e9;
  background: #241d27;
  border: 1px solid #615366;
}

.game-dialog::backdrop {
  background: rgba(12, 9, 14, 0.84);
}

.dialog-close {
  color: #f8f2e9;
  background: #342b38;
  border-color: #655769;
}

.dialog-heading p:not(.eyebrow),
.reward-layout > p:not(.eyebrow):not(.result-story):not(.shop-quote) {
  color: #cfc2d0;
}

.dialog-note {
  color: #d8efeb;
  background: #243c3a;
  border-left-color: #46a699;
}

.result-story,
.collection-entry,
.rules-attributes {
  color: #e9dfea;
  background: #322a36;
  border-color: #594c5e;
}

.collection-entry p,
.rules-attributes p {
  color: #cfc2d0;
}

.collection-entry.locked {
  filter: none;
  opacity: 0.76;
}

.collection-image {
  border-color: #645568;
}

.collection-shop {
  color: #f4b64f;
  font-size: 11px;
  font-weight: 900;
}

.shop-quote {
  color: #f2b3c7;
}

.reward-image {
  animation: candy-reveal 420ms ease both;
}

.danger-button {
  background: #a43842;
  border-color: #c95860;
}

@keyframes scene-in {
  from { transform: translateY(4px); }
  to { transform: translateY(0); }
}

@keyframes art-reveal {
  from { transform: scale(1.02); }
  to { transform: scale(1); }
}

@keyframes candy-reveal {
  from { transform: translateY(10px) scale(0.96); }
  to { transform: translateY(0) scale(1); }
}

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

  .story-art-wrap {
    min-height: 52svh;
    height: 52svh;
  }

  .story-copy {
    min-height: 48svh;
    border-top: 1px solid #514254;
    border-left: 0;
  }

  .setup-screen {
    grid-template-columns: minmax(300px, 0.75fr) minmax(450px, 1.25fr);
  }

  .status-band {
    grid-template-columns: repeat(3, 1fr);
  }

  .rank-summary {
    grid-column: 1 / -1;
    padding: 13px 0 0;
    border-top: 1px solid var(--line);
  }

  .rank-track {
    left: 0;
  }

  .game-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .stage-idle,
  .encounter-layout,
  .shop-approach {
    grid-template-columns: 1fr;
  }

  .stage-idle {
    min-height: 610px;
  }

  .stage-teaser {
    min-height: 300px;
    order: -1;
  }

  .stage-copy {
    padding: 34px 30px;
  }

  .monster-figure {
    min-height: 370px;
    border-right: 0;
    border-bottom: 1px solid #514953;
  }

  .shop-approach figure {
    min-height: 400px;
    height: 48vw;
    max-height: 560px;
  }

  .shop-approach-copy {
    min-height: 280px;
  }

  .shop-route {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 760px) {
  .welcome-art {
    object-fit: cover;
    object-position: 58% center;
  }

  .welcome-screen::after {
    height: 20%;
  }

  .welcome-action {
    width: 100%;
    display: grid;
  }

  .entry-button {
    width: 100%;
  }

  .story-art-wrap {
    min-height: 42svh;
    height: 42svh;
  }

  .story-copy {
    min-height: 58svh;
    padding: 28px 20px 34px;
  }

  .speaker-line {
    grid-template-columns: 62px 1fr;
    gap: 12px;
  }

  .speaker-line img {
    width: 62px;
  }

  .speaker-line h1,
  .setup-content h1 {
    font-size: 30px;
  }

  .story-text {
    margin: 24px 0 20px;
    font-size: 15px;
  }

  .setup-screen {
    grid-template-columns: 1fr;
  }

  .setup-portrait {
    min-height: 30svh;
    height: 30svh;
  }

  .setup-portrait img {
    object-position: center 42%;
  }

  .setup-content {
    padding: 30px 20px 38px;
  }

  .ohm-reminder {
    margin: 22px 0;
  }

  .topbar {
    min-height: 74px;
    padding: 12px 14px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  h1 {
    font-size: 19px;
  }

  .topbar .eyebrow {
    display: none;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .status-band {
    padding: 12px 14px;
  }

  .status-item {
    min-height: 46px;
  }

  .status-item + .status-item {
    padding-left: 10px;
  }

  .status-item strong {
    font-size: 20px;
  }

  .status-label {
    font-size: 10px;
  }

  .game-layout {
    display: flex;
    flex-direction: column;
  }

  .role-panel {
    padding: 24px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .role-placeholder {
    min-height: 150px;
  }

  .role-list:has(.role-card) {
    grid-template-columns: 1fr 1fr;
  }

  .role-card.compact {
    display: block;
  }

  .role-card.compact > img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .stage-copy h2,
  .encounter-copy h2 {
    font-size: 27px;
  }

  .encounter-copy {
    padding: 28px 16px;
  }

  .monster-figure {
    min-height: 340px;
    aspect-ratio: 1;
  }

  .shop-approach figure {
    min-height: 360px;
    height: 92vw;
  }

  .shop-approach-copy {
    min-height: 300px;
    padding: 30px 18px;
  }

  .shop-approach-copy h2 {
    font-size: 28px;
  }

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

  .route-band {
    padding: 26px 14px 34px;
  }

  .shop-route {
    grid-template-columns: 1fr;
  }

  .shop-stop {
    min-height: 96px;
    grid-template-columns: 92px 1fr auto;
  }

  .shop-thumbnail {
    width: 92px;
    min-height: 92px;
  }

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

  .rules-attributes {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .rules-attributes img {
    width: 132px;
    height: 132px;
    margin: 0 auto;
  }
}

@media (max-width: 430px) {
  .setup-actions {
    display: grid;
  }

  .setup-actions .entry-button,
  .setup-actions .secondary-button {
    width: 100%;
  }

  .brand-block {
    gap: 8px;
  }

  .brand-mark {
    display: none;
  }

  .top-actions {
    gap: 5px;
  }

  .status-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-item strong {
    font-size: 18px;
  }

  .role-list:has(.role-card) {
    gap: 8px;
  }

  .role-card.compact .role-card-body {
    padding: 9px;
  }

  .role-card.compact h3 {
    font-size: 14px;
  }

  .attribute-key {
    align-items: flex-start;
  }
}

@media (max-width: 1040px) {
  .story-art-wrap {
    position: absolute;
    inset: 0;
    min-height: 100%;
    height: auto;
  }

  .story-copy {
    min-height: 300px;
    padding: 24px 30px;
    grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
    gap: 24px 34px;
    border-top: 1px solid #6d586d;
  }

  .story-copy .entry-button {
    grid-column: 2;
    width: fit-content;
  }

  .setup-screen {
    display: block;
  }

  .setup-portrait {
    position: absolute;
    inset: 0;
    min-height: 100%;
    height: auto;
  }

  .setup-content {
    width: min(600px, 58vw);
  }

  .game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .stage-idle,
  .encounter-layout,
  .shop-approach {
    min-height: 620px;
  }

  .shop-approach {
    display: grid;
    grid-template-columns: 1fr;
  }

  .shop-approach figure {
    position: absolute;
    inset: 0;
    min-height: 100%;
    height: 100%;
    max-height: none;
  }

  .shop-approach-copy {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .welcome-screen::after {
    height: 28%;
  }

  .welcome-action {
    display: grid;
    gap: 14px;
  }

  .welcome-mobile-title {
    display: grid;
    margin: 0;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 10px rgba(10, 7, 12, 0.85);
  }

  .welcome-mobile-title span {
    color: #f4b64f;
    font-size: 12px;
    font-weight: 900;
  }

  .welcome-mobile-title strong {
    font-size: 24px;
  }

  .story-screen {
    min-height: 100svh;
    padding-top: 38svh;
    align-items: stretch;
  }

  .story-art-wrap {
    position: absolute;
    inset: 0;
    min-height: 100%;
    height: auto;
  }

  .story-art {
    object-position: 46% center;
  }

  .story-copy {
    min-height: 62svh;
    padding: 26px 20px 34px;
    display: block;
    background: rgba(25, 18, 28, 0.97);
  }

  .speaker-line h1 {
    font-size: 30px;
  }

  .story-text {
    margin: 22px 0;
    font-size: 15px;
  }

  .story-copy .entry-button {
    width: 100%;
  }

  .setup-screen {
    min-height: 100svh;
    padding-top: 34svh;
    overflow: auto;
  }

  .setup-portrait {
    position: absolute;
    inset: 0 0 auto;
    min-height: 0;
    height: 40svh;
  }

  .setup-content {
    width: 100%;
    min-height: 66svh;
    padding: 30px 20px 38px;
    background: rgba(28, 22, 31, 0.98);
    border-top: 1px solid #6d586d;
    border-left: 0;
  }

  .setup-content h1 {
    font-size: 32px;
  }

  .topbar {
    min-height: 68px;
  }

  .game-layout {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .play-stage {
    order: 1;
    min-height: 590px;
  }

  .role-panel {
    order: 2;
  }

  .stage-idle {
    min-height: 590px;
  }

  .stage-copy {
    width: calc(100% - 24px);
    margin: auto 12px 12px;
    padding: 16px;
    grid-template-columns: 58px 1fr;
    gap: 12px;
  }

  .stage-guide-portrait {
    width: 58px;
    height: 58px;
  }

  .stage-guide-copy h2 {
    font-size: 24px;
  }

  .stage-guide-copy p:not(.eyebrow) {
    font-size: 13px;
  }

  .encounter-layout {
    min-height: 0;
  }

  .monster-figure {
    min-height: 360px;
  }

  .shop-approach {
    min-height: 590px;
  }

  .shop-approach figure {
    position: absolute;
    inset: 0;
    min-height: 100%;
    height: 100%;
  }

  .shop-approach-copy {
    width: calc(100% - 24px);
    min-height: 0;
    margin: 0 12px 12px;
    padding: 18px;
  }

  .role-panel {
    color: #f8f2e9;
    background: #241d27;
    border: 1px solid #514454;
    border-radius: 8px;
  }

  .game-dialog {
    color: #f8f2e9;
    background: #241d27;
  }
}

@media (max-width: 430px) {
  .welcome-action {
    padding-right: 18px;
    padding-left: 18px;
  }

  .speaker-line {
    grid-template-columns: 56px 1fr;
  }

  .speaker-line img {
    width: 56px;
  }

  .story-copy {
    padding-right: 18px;
    padding-left: 18px;
  }

  .stage-copy {
    display: block;
  }

  .stage-guide-portrait {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
  }
}

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

/* Third page: role draw and the main Halloween game world */
.app-shell {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
}

.game-world-scene,
.game-world-shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.game-world-scene {
  z-index: -2;
  background: #17121b;
}

.game-world-background {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.game-world-background-mobile {
  display: none;
}

.game-world-shade {
  z-index: -1;
  background: rgba(18, 11, 22, 0.58);
}

.role-opening,
.game-interface {
  position: relative;
  z-index: 1;
}

.role-opening[hidden],
.game-interface[hidden],
.role-draw-intro[hidden],
.role-reveal-scene[hidden],
.opening-guide[hidden],
.opening-start-button[hidden],
.opening-guide-next[hidden] {
  display: none !important;
}

.role-opening {
  min-height: 100svh;
  color: #fff9ed;
}

.role-draw-intro {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.art-action {
  position: relative;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff5dd;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.art-action img {
  width: clamp(250px, 32vw, 440px);
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 20px rgba(7, 4, 9, 0.48)) drop-shadow(0 0 12px rgba(246, 166, 73, 0.2));
  transition: transform 220ms ease, filter 220ms ease;
}

.art-action:hover img,
.art-action:focus-visible img {
  transform: translateY(-5px) scale(1.025);
  filter: drop-shadow(0 16px 24px rgba(7, 4, 9, 0.56)) drop-shadow(0 0 25px rgba(255, 183, 80, 0.8));
}

.art-action:active img {
  transform: translateY(0) scale(0.985);
}

.art-action:focus-visible {
  outline: 3px solid #ffd37f;
  outline-offset: 8px;
  border-radius: 6px;
}

.art-action-copy {
  min-width: 210px;
  padding: 10px 18px 9px;
  display: grid;
  justify-items: center;
  gap: 2px;
  color: #fff4da;
  background: rgba(42, 24, 39, 0.92);
  border: 1px solid rgba(244, 182, 79, 0.76);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(7, 4, 9, 0.34);
}

.art-action-copy strong {
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: 0;
}

.art-action-copy small {
  color: #e7cda2;
  font-size: 14px;
}

.role-draw-button {
  animation: role-draw-breathe 2.8s ease-in-out infinite;
}

.role-draw-button .art-action-copy small {
  color: #fff4da;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 800;
}

.role-reveal-scene {
  min-height: 100svh;
  padding: clamp(22px, 3vh, 38px) clamp(28px, 4vw, 72px) clamp(26px, 4vh, 48px);
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(520px, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px 32px;
}

.opening-role-cards {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 38px);
}

.opening-role-card {
  position: relative;
  width: clamp(174px, 19vw, 242px);
  overflow: hidden;
  color: #fff8eb;
  background: rgba(37, 27, 40, 0.94);
  border: 1px solid rgba(245, 185, 91, 0.72);
  border-radius: 7px;
  box-shadow: 0 20px 45px rgba(5, 3, 8, 0.52);
  animation: opening-card-in 520ms ease-out both;
}

.opening-role-card:nth-child(2) {
  animation-delay: 110ms;
}

.opening-role-art {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: block;
  object-fit: cover;
}

.opening-role-copy {
  padding: 12px 14px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
}

.opening-role-copy p {
  grid-column: 1 / -1;
  margin: 0;
  overflow: hidden;
  color: #decfda;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opening-role-copy h3 {
  margin: 0;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.15;
}

.opening-role-copy .attribute {
  justify-self: end;
  font-size: 12px;
}

.opening-guide {
  position: absolute;
  z-index: 3;
  left: clamp(28px, 5vw, 76px);
  bottom: clamp(30px, 7vh, 76px);
  width: min(720px, calc(100% - 64px));
  min-width: 0;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: end;
  gap: 18px;
}

.opening-guide.is-leaving {
  pointer-events: none;
  animation: opening-guide-out 220ms ease-in both;
}

.opening-guide-avatar {
  width: 92px;
  height: 92px;
  display: block;
  object-fit: cover;
  border: 3px solid #f0b85f;
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(5, 3, 8, 0.5);
}

.opening-guide-message {
  position: relative;
  min-height: 176px;
  max-height: min(31svh, 280px);
  padding: 22px 70px 22px 26px;
  overflow-y: auto;
  color: #30202a;
  background: rgba(255, 248, 232, 0.96);
  border: 1px solid #c99c60;
  border-radius: 7px;
  box-shadow: 0 18px 40px rgba(5, 3, 8, 0.45);
}

.opening-guide-message::before {
  content: "";
  position: absolute;
  left: -13px;
  bottom: 28px;
  width: 24px;
  height: 24px;
  background: rgba(255, 248, 232, 0.96);
  border-bottom: 1px solid #c99c60;
  border-left: 1px solid #c99c60;
  transform: rotate(45deg);
}

.opening-guide-speaker {
  margin: 0 0 9px;
  color: #8b4d26;
  font-size: 16px;
  font-weight: 900;
}

.opening-guide-text {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.72;
}

.opening-guide-text p {
  margin: 0 0 6px;
}

.opening-guide-text p:last-child {
  margin-bottom: 0;
}

.opening-attribute-row {
  margin: 7px 0 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.opening-cycle-text {
  color: #6d3429;
}

.opening-cycle-text strong {
  display: block;
  font-size: clamp(12px, 1.2vw, 15px);
  letter-spacing: 0;
  white-space: nowrap;
}

.opening-guide-next {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid #b7773f;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff8e9;
  background: #8d462f;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  animation: opening-next-pulse 2.2s ease-in-out infinite;
}

.opening-guide-next span {
  display: block;
  line-height: 1;
  transform: translateY(-2px);
}

.opening-guide-next:hover,
.opening-guide-next:focus-visible {
  color: #3e2429;
  background: #f4b64f;
  outline: none;
}

.opening-start-button {
  position: absolute;
  z-index: 3;
  left: clamp(28px, 5vw, 76px);
  bottom: clamp(30px, 7vh, 76px);
  opacity: 0;
  transform: translateY(12px);
}

.opening-start-button.is-ready {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 300ms ease, transform 300ms ease;
}

.opening-start-button img {
  width: clamp(150px, 15vw, 220px);
}

.opening-start-button .art-action-copy {
  min-width: 190px;
  padding: 8px 14px;
}

.opening-start-button .art-action-copy strong {
  font-size: clamp(16px, 1.35vw, 21px);
}

@keyframes role-draw-breathe {
  0%, 100% { filter: brightness(0.98); }
  50% { filter: brightness(1.08); }
}

@keyframes opening-card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes opening-guide-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(12px); }
}

@keyframes opening-next-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(183, 119, 63, 0.22); }
  50% { box-shadow: 0 0 0 7px rgba(183, 119, 63, 0); }
}

@media (max-height: 780px) and (min-width: 761px) {
  .role-reveal-scene {
    padding-top: 16px;
    padding-bottom: 18px;
  }

  .opening-role-card {
    width: 158px;
  }

  .opening-role-copy {
    padding: 8px 10px 10px;
  }

  .opening-role-copy h3 {
    font-size: 21px;
  }

  .opening-guide-message {
    max-height: 220px;
  }

  .opening-start-button img {
    width: 130px;
  }
}

@media (max-width: 760px) {
  .game-world-background-desktop {
    display: none;
  }

  .game-world-background-mobile {
    display: block;
  }

  .game-world-shade {
    background: rgba(18, 11, 22, 0.52);
  }

  .role-draw-intro {
    padding: 22px 18px;
  }

  .role-draw-button img {
    width: min(78vw, 340px);
  }

  .art-action-copy {
    min-width: 190px;
  }

  .art-action-copy strong {
    font-size: 20px;
  }

  .role-reveal-scene {
    min-height: 100svh;
    padding: 18px 14px 28px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .opening-role-cards {
    align-self: center;
    width: min(100%, 470px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .opening-role-card {
    width: auto;
  }

  .opening-role-copy {
    padding: 8px 9px 10px;
    gap: 3px 5px;
  }

  .opening-role-copy p {
    font-size: 13px;
  }

  .opening-role-copy h3 {
    font-size: clamp(18px, 5.8vw, 23px);
  }

  .opening-role-copy .attribute {
    padding: 3px 5px;
    font-size: 10px;
  }

  .opening-role-copy .attribute-icon {
    width: 15px;
    height: 15px;
  }

  .opening-guide {
    left: 14px;
    bottom: 24px;
    width: 100%;
    width: calc(100% - 28px);
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 9px;
  }

  .opening-guide-avatar {
    width: 56px;
    height: 56px;
    border-width: 2px;
  }

  .opening-guide-message {
    min-height: 114px;
    max-height: none;
    padding: 12px 46px 12px 14px;
    overflow: visible;
  }

  .opening-guide-message::before {
    left: -8px;
    bottom: 17px;
    width: 14px;
    height: 14px;
  }

  .opening-guide-speaker {
    margin-bottom: 7px;
    font-size: 13px;
  }

  .opening-guide-text {
    font-size: 14px;
    line-height: 1.65;
  }

  .opening-guide-text p {
    margin-bottom: 5px;
  }

  .opening-cycle-text strong {
    font-size: clamp(10.5px, 2.85vw, 11.5px);
  }

  .opening-attribute-row {
    margin: 5px 0 6px;
    gap: 5px;
  }

  .opening-guide-next {
    right: 10px;
    bottom: 10px;
    width: 30px;
    height: 30px;
    font-size: 24px;
  }

  .opening-start-button {
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 12px);
  }

  .opening-start-button.is-ready {
    transform: translate(-50%, 0);
  }

  .opening-start-button img {
    width: min(38vw, 150px);
  }

  .opening-start-button .art-action-copy {
    min-width: 178px;
  }

  .opening-start-button .art-action-copy strong {
    font-size: 16px;
  }
}

@media (max-width: 390px) and (max-height: 760px) {
  .role-reveal-scene {
    padding-top: 10px;
  }

  .opening-role-cards {
    width: min(88%, 340px);
  }

  .opening-guide-text {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .role-draw-button,
  .opening-role-card,
  .opening-guide-next,
  .opening-guide.is-leaving {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }

  .art-action img,
  .opening-start-button.is-ready {
    transition-duration: 0.01ms !important;
  }
}

/* Desktop Halloween entrance */

.welcome-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.welcome-art-desktop,
.welcome-light {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.welcome-art-mobile,
.welcome-light-mobile,
.welcome-mobile-label {
  display: none;
}

.welcome-light {
  pointer-events: none;
  will-change: opacity, filter;
}

.welcome-light-one {
  animation: town-lights-one 5.8s ease-in-out infinite;
}

.welcome-light-two {
  animation: town-lights-two 4.3s ease-in-out infinite;
}

@keyframes town-lights-one {
  0%, 100% { opacity: 0.18; filter: brightness(0.92); }
  31% { opacity: 0.76; filter: brightness(1.08); }
  47% { opacity: 0.42; filter: brightness(0.98); }
  72% { opacity: 0.88; filter: brightness(1.12); }
}

@keyframes town-lights-two {
  0%, 100% { opacity: 0.22; filter: brightness(0.94); }
  24% { opacity: 0.92; filter: brightness(1.1); }
  57% { opacity: 0.38; filter: brightness(0.98); }
  82% { opacity: 0.7; filter: brightness(1.05); }
}

@keyframes sign-glow-breathe {
  0% { opacity: 0; filter: blur(3px); }
  45% { opacity: 0.26; filter: blur(1.8px); }
  100% { opacity: 0.13; filter: blur(1px); }
}

@keyframes mobile-town-lights-one {
  0%, 100% { opacity: 0.14; filter: brightness(0.94); }
  34% { opacity: 0.62; filter: brightness(1.04); }
  61% { opacity: 0.28; filter: brightness(0.98); }
  82% { opacity: 0.52; filter: brightness(1.02); }
}

@keyframes mobile-town-lights-two {
  0%, 100% { opacity: 0.12; filter: brightness(0.94); }
  27% { opacity: 0.5; filter: brightness(1.02); }
  52% { opacity: 0.2; filter: brightness(0.98); }
  76% { opacity: 0.58; filter: brightness(1.04); }
}

@keyframes mobile-sign-invite {
  0%, 72%, 100% { opacity: 0; filter: blur(2.5px); }
  82% { opacity: 0.14; filter: blur(1.5px); }
  90% { opacity: 0.06; filter: blur(1px); }
}

@media (min-width: 761px) {
  .welcome-screen {
    min-height: 100svh;
    height: 100svh;
    background: #171321;
  }

  .welcome-screen::after {
    display: none;
  }

  .welcome-action {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    padding: 0;
    display: grid;
    place-items: center;
  }

  .welcome-entry {
    position: relative;
    width: min(66vw, 86svh, 860px);
    min-height: 0;
    aspect-ratio: 1;
    padding: 0;
    color: #fff5dc;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    transform: translateY(1.5svh) scale(1);
    transition: transform 240ms ease, filter 240ms ease;
  }

  .welcome-entry:hover {
    background: transparent;
    transform: translateY(1svh) scale(1.025);
  }

  .welcome-entry:active {
    transform: translateY(1.5svh) scale(0.985);
  }

  .welcome-entry:focus-visible {
    outline: 3px solid #ffd47a;
    outline-offset: -18px;
  }

  .welcome-sign-art,
  .welcome-sign-art img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
  }

  .welcome-sign-art img {
    object-fit: contain;
    pointer-events: none;
  }

  .welcome-sign-base {
    filter: drop-shadow(0 22px 24px rgba(9, 6, 14, 0.5));
    transition: filter 240ms ease;
  }

  .welcome-sign-glow {
    opacity: 0;
    transform: translateY(4.2%);
    transition: opacity 320ms ease;
  }

  .welcome-entry:hover .welcome-sign-base,
  .welcome-entry:focus-visible .welcome-sign-base {
    filter: brightness(1.02) drop-shadow(0 24px 28px rgba(9, 6, 14, 0.58));
  }

  .welcome-entry:hover .welcome-sign-glow,
  .welcome-entry:focus-visible .welcome-sign-glow {
    opacity: 1;
    animation: sign-glow-breathe 720ms ease-out 1 forwards;
  }

  .welcome-enter-hint {
    position: absolute;
    left: 50%;
    bottom: 2.5%;
    padding: 7px 15px;
    color: #f8e6bc;
    background: rgba(24, 17, 29, 0.72);
    border: 1px solid rgba(240, 186, 91, 0.56);
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(8, 5, 12, 0.26);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    transform: translateX(-50%);
    transition: color 240ms ease, border-color 240ms ease;
  }

  .welcome-entry:hover .welcome-enter-hint,
  .welcome-entry:focus-visible .welcome-enter-hint {
    color: #fff8e8;
    border-color: rgba(255, 212, 122, 0.9);
  }
}

@media (max-width: 760px) {
  .welcome-art-desktop,
  .welcome-light-one,
  .welcome-light-two,
  .welcome-enter-hint {
    display: none;
  }

  .welcome-screen {
    min-height: 100svh;
    height: 100svh;
    background: #171321;
  }

  .welcome-screen::after,
  .welcome-mobile-title {
    display: none;
  }

  .welcome-art-mobile {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
  }

  .welcome-light-mobile {
    display: block;
    object-position: center;
  }

  .welcome-light-mobile-one {
    animation: mobile-town-lights-one 6.2s ease-in-out infinite;
  }

  .welcome-light-mobile-two {
    animation: mobile-town-lights-two 4.9s ease-in-out infinite;
  }

  .welcome-action {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    display: block;
    align-self: stretch;
    justify-self: stretch;
  }

  .welcome-entry {
    position: absolute;
    left: 50%;
    top: 55%;
    width: min(96vw, 500px);
    min-height: 0;
    aspect-ratio: 1;
    padding: 0;
    color: #fff5dc;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: translate(-50%, -50%);
    transition: transform 160ms ease;
  }

  .welcome-entry:hover {
    background: transparent;
  }

  .welcome-entry:active {
    transform: translate(-50%, -50%) scale(0.975);
  }

  .welcome-entry:focus-visible {
    outline: 2px solid #ffd47a;
    outline-offset: -14px;
  }

  .welcome-sign-art,
  .welcome-sign-art img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
  }

  .welcome-sign-art img {
    object-fit: contain;
    pointer-events: none;
  }

  .welcome-sign-base {
    filter: drop-shadow(0 14px 18px rgba(9, 6, 14, 0.48));
  }

  .welcome-sign-glow {
    opacity: 0;
    transform: translateY(4.2%);
    animation: mobile-sign-invite 4.8s ease-in-out infinite;
  }

  .welcome-entry:active .welcome-sign-glow {
    opacity: 0.2;
    filter: blur(1px);
    animation: none;
  }

  .welcome-mobile-label {
    position: absolute;
    left: 50%;
    bottom: 2%;
    padding: 6px 12px;
    display: block;
    color: #f8e6bc;
    background: rgba(24, 17, 29, 0.74);
    border: 1px solid rgba(240, 186, 91, 0.54);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(8, 5, 12, 0.28);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    transform: translateX(-50%);
  }
}

/* Moon Platform Station entry sequence */

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

.station-screen {
  position: relative;
  min-height: 100svh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #140f19;
}

.station-scene,
.station-shade {
  position: absolute;
  inset: 0;
}

.station-scene {
  z-index: -2;
}

.station-background {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.68) saturate(0.92);
  transform: scale(1.01);
}

.station-background-mobile {
  display: none;
}

.station-shade {
  z-index: -1;
  background: rgba(9, 7, 13, 0.42);
  transition: background-color 360ms ease;
}

.station-screen.registry-active .station-shade {
  background: rgba(9, 7, 13, 0.31);
}

.station-chat {
  position: absolute;
  z-index: 5;
  left: clamp(28px, 5vw, 76px);
  bottom: clamp(30px, 7vh, 76px);
  width: min(720px, calc(100% - 64px));
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: end;
  gap: 18px;
}

.station-chat-avatar {
  width: 92px;
  height: 92px;
  display: block;
  object-fit: cover;
  border: 3px solid #e7ad55;
  border-radius: 50%;
  box-shadow: 0 12px 32px rgba(4, 3, 7, 0.48);
}

.station-message {
  position: relative;
  min-height: 176px;
  padding: 22px 70px 22px 26px;
  color: #2c222c;
  background: rgba(249, 247, 242, 0.97);
  border: 1px solid rgba(255, 231, 183, 0.82);
  border-radius: 7px;
  box-shadow: 0 18px 52px rgba(4, 3, 7, 0.42);
}

.station-message::before {
  content: "";
  position: absolute;
  left: -13px;
  bottom: 28px;
  width: 24px;
  height: 24px;
  background: rgba(249, 247, 242, 0.97);
  border-bottom: 1px solid rgba(255, 231, 183, 0.82);
  border-left: 1px solid rgba(255, 231, 183, 0.82);
  transform: rotate(45deg);
}

.station-speaker {
  margin: 0 0 9px;
  color: #8b4d26;
  font-size: 16px;
  font-weight: 900;
}

.station-message-text {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.72;
}

.station-message-text p {
  margin: 0 0 6px;
}

.station-message-text p:last-child {
  margin-bottom: 0;
}

.station-message-text strong {
  color: #8c3a2f;
  font-size: 1.08em;
}

.station-next {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  color: #fff8e8;
  background: #8b4d26;
  border: 1px solid #c98545;
  border-radius: 50%;
  box-shadow: 0 5px 14px rgba(72, 34, 24, 0.25);
  font-family: Georgia, serif;
  font-size: 32px;
  line-height: 1;
  transition: background-color 160ms ease, transform 160ms ease;
  animation: station-next-pulse 2.2s ease-in-out infinite;
}

.station-next:hover,
.station-next:focus-visible {
  background: #a65b2d;
  transform: translateX(2px);
}

.station-chat.message-arriving .station-message {
  animation: station-message-in 280ms ease-out both;
}

.station-registry {
  position: absolute;
  z-index: 4;
  inset: 0;
}

.station-ohm-full {
  position: absolute;
  z-index: 1;
  left: -5vw;
  bottom: -4svh;
  width: min(67vw, 980px);
  max-height: 94svh;
  object-fit: contain;
  filter: drop-shadow(0 22px 30px rgba(5, 3, 7, 0.34));
  animation: station-ohm-in 480ms ease-out both;
}

.registry-paper {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: clamp(34px, 6vw, 98px);
  width: min(34vw, 470px);
  aspect-ratio: 1086 / 1448;
  display: block;
  transform: translateY(-50%);
  filter: drop-shadow(0 24px 38px rgba(5, 3, 7, 0.46));
  animation: registry-paper-in 460ms 120ms ease-out both;
}

.registry-paper-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.traveler-form .registry-field {
  position: absolute;
  z-index: 2;
  display: block;
  margin: 0;
}

.registry-human-field {
  top: 45.5%;
  right: 14.5%;
  left: 40%;
  height: 7.2%;
}

.registry-ai-field {
  top: 62.2%;
  right: 11.5%;
  left: 49%;
  height: 7.2%;
}

.traveler-form .registry-field input {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 6px 3px;
  color: #40291f;
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  font-size: clamp(15px, 1.45vw, 21px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  transform: translate(6px, -24px);
}

.traveler-form .registry-field input::placeholder {
  color: rgba(77, 51, 39, 0.5);
  opacity: 1;
}

.traveler-form .registry-field input:focus {
  background: transparent;
  border: 0;
  outline: 0;
}

.traveler-form .registry-field input[aria-invalid="true"] {
  background: rgba(166, 52, 45, 0.09);
  outline: 2px solid rgba(166, 52, 45, 0.58);
  outline-offset: -2px;
}

@media (min-width: 761px) {
  .station-ohm-full {
    z-index: 1;
    pointer-events: none;
  }

  .registry-paper {
    z-index: 2;
    top: 52%;
    right: auto;
    left: calc(-5vw + min(59.6vw, 872px) - 110px);
  }

  .traveler-form .registry-ai-field input {
    transform: translate(0.7em, -1.7em);
  }

  .traveler-form .registry-human-field input {
    transform: translate(1.35em, -1.25em);
  }
}

.registry-privacy-note {
  position: absolute;
  z-index: 3;
  top: 67.1%;
  right: 8.5%;
  left: 8.5%;
  margin: 0;
  color: rgba(74, 46, 34, 0.78);
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  font-size: clamp(11px, 0.9vw, 13px);
  line-height: 1.35;
  text-align: center;
}

.registry-privacy-note span {
  margin-right: 3px;
}

.registry-info-links {
  position: absolute;
  z-index: 5;
  top: 89.1%;
  left: 50%;
  width: max-content;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(72, 43, 31, 0.58);
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  font-size: clamp(11px, 0.88vw, 13px);
  line-height: 1;
  transform: translateX(-50%);
}

.registry-info-links button {
  min-height: 24px;
  padding: 3px 2px;
  color: #603b2c;
  background: transparent;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(96, 59, 44, 0.38);
  text-underline-offset: 3px;
}

.registry-info-links button:hover,
.registry-info-links button:focus-visible {
  color: #913e2f;
  text-decoration-color: currentColor;
}

.registry-error {
  position: absolute;
  z-index: 3;
  top: 69.7%;
  right: 11%;
  left: 11%;
  min-height: 18px;
  margin: 0;
  color: #8f2b29;
  font-size: clamp(10px, 0.88vw, 12px);
  text-align: center;
}

.registry-submit {
  position: absolute;
  z-index: 3;
  top: 73.4%;
  left: 50%;
  min-width: 128px;
  min-height: 38px;
  padding: 8px 19px;
  color: #fff3d5;
  background: #783c2b;
  border: 2px solid #c68a4d;
  border-radius: 5px;
  box-shadow: 0 5px 10px rgba(66, 38, 25, 0.22);
  font-size: 14px;
  font-weight: 900;
  transform: translateX(-50%);
  transition: background-color 160ms ease, transform 160ms ease;
}

.registry-submit:hover,
.registry-submit:focus-visible {
  background: #934d35;
  transform: translateX(-50%) translateY(-1px);
}

.registry-stamp {
  position: absolute;
  z-index: 4;
  top: 73%;
  left: 74%;
  width: 23%;
  height: auto;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.75) rotate(-12deg);
}

.station-registry.is-stamped .registry-submit {
  opacity: 0;
}

.station-registry.is-stamped .registry-stamp {
  animation: registry-stamp-drop 760ms cubic-bezier(0.18, 0.82, 0.3, 1.08) forwards;
}

.game-dialog.policy-dialog {
  width: min(900px, calc(100vw - 28px));
  max-height: min(92dvh, 900px);
  overflow: hidden;
  color: #2c222c;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.policy-dialog #dialogContent {
  padding: 18px 12px 20px;
}

.policy-dialog .dialog-close {
  position: absolute;
  top: 30px;
  right: 26px;
  z-index: 8;
  width: 36px;
  height: 36px;
  margin: 0;
  color: #70452f;
  background: #fffaf0;
  border-color: rgba(128, 80, 46, 0.34);
  border-radius: 50%;
  box-shadow: 0 5px 16px rgba(56, 31, 24, 0.18);
  font-size: 22px;
}

.policy-dialog-layout {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: end;
  gap: 18px;
}

.policy-dialog-avatar {
  width: 92px;
  height: 92px;
  display: block;
  object-fit: cover;
  border: 3px solid #e7ad55;
  border-radius: 50%;
  box-shadow: 0 12px 32px rgba(4, 3, 7, 0.48);
}

.policy-dialog-message {
  position: relative;
  max-height: calc(92dvh - 38px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #2c222c;
  background: rgba(249, 247, 242, 0.99);
  border: 1px solid rgba(255, 231, 183, 0.82);
  border-radius: 7px;
  box-shadow: 0 18px 52px rgba(4, 3, 7, 0.42);
}

.policy-dialog-message::before {
  content: "";
  position: absolute;
  left: -13px;
  bottom: 28px;
  width: 24px;
  height: 24px;
  background: rgba(249, 247, 242, 0.99);
  border-bottom: 1px solid rgba(255, 231, 183, 0.82);
  border-left: 1px solid rgba(255, 231, 183, 0.82);
  transform: rotate(45deg);
}

.policy-dialog-heading {
  flex: 0 0 auto;
  padding: 22px 68px 14px 26px;
}

.policy-dialog-heading .station-speaker {
  margin-bottom: 3px;
}

.policy-dialog-heading h2 {
  margin: 0;
  color: #3b2927;
  font-size: clamp(22px, 3vw, 32px);
}

.policy-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 26px;
  overflow: hidden;
  border: 1px solid #cdbb9f;
  border-radius: 6px;
}

.policy-tab {
  min-height: 40px;
  padding: 8px 10px;
  color: #684533;
  background: #fffaf0;
  border: 0;
  border-right: 1px solid #cdbb9f;
  border-radius: 0;
  font-size: 14px;
  font-weight: 900;
}

.policy-tab:last-child {
  border-right: 0;
}

.policy-tab[aria-selected="true"] {
  color: #fff5df;
  background: #7d442f;
}

.policy-tab:hover,
.policy-tab:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(185, 114, 59, 0.46);
}

.policy-copy {
  min-height: 0;
  flex: 1 1 auto;
  margin-top: 14px;
  padding: 2px 28px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #433330;
  font-size: 15px;
  line-height: 1.78;
}

.policy-copy p {
  margin: 0 0 14px;
}

.policy-copy p:last-child {
  margin-bottom: 0;
}

.policy-copy strong {
  color: #873f31;
}

.policy-lead {
  font-size: 1.08em;
}

.policy-quote {
  padding-left: 14px;
  border-left: 3px solid #bd7946;
}

.policy-production,
.policy-management {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #cdbb9f;
}

.policy-production h3,
.policy-management h3 {
  margin: 0 0 10px;
  color: #684533;
  font-size: 17px;
}

@keyframes station-message-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes station-next-pulse {
  0%, 70%, 100% { box-shadow: 0 5px 14px rgba(72, 34, 24, 0.25); }
  84% { box-shadow: 0 5px 14px rgba(72, 34, 24, 0.25), 0 0 0 7px rgba(198, 138, 77, 0.15); }
}

@keyframes station-ohm-in {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes registry-paper-in {
  from { opacity: 0; transform: translateY(-46%) rotate(1.5deg); }
  to { opacity: 1; transform: translateY(-50%) rotate(0); }
}

@keyframes registry-stamp-drop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.75) rotate(-12deg); }
  58% { opacity: 0.92; transform: translate(-50%, -50%) scale(0.88) rotate(-7deg); }
  76% { opacity: 0.78; transform: translate(-50%, -50%) scale(1.06) rotate(-7deg); }
  100% { opacity: 0.82; transform: translate(-50%, -50%) scale(1) rotate(-7deg); }
}

@media (max-width: 760px) {
  .station-background-desktop {
    display: none;
  }

  .station-background-mobile {
    display: block;
  }

  .station-background {
    object-position: center;
    filter: brightness(0.66) saturate(0.92);
  }

  .station-shade {
    background: rgba(9, 7, 13, 0.4);
  }

  .station-chat {
    left: 12px;
    right: 12px;
    bottom: max(20px, 4svh);
    width: auto;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
  }

  .station-chat-avatar {
    width: 54px;
    height: 54px;
    border-width: 2px;
  }

  .station-message {
    min-height: 178px;
    padding: 17px 48px 17px 17px;
  }

  .station-message::before {
    left: -9px;
    bottom: 20px;
    width: 17px;
    height: 17px;
  }

  .station-speaker {
    margin-bottom: 7px;
    font-size: 13px;
  }

  .station-message-text {
    font-size: 14px;
    line-height: 1.65;
  }

  .station-message-text p {
    margin-bottom: 5px;
  }

  .station-next {
    right: 12px;
    bottom: 12px;
    width: 34px;
    height: 34px;
    font-size: 27px;
  }

  .station-ohm-full {
    left: -8vw;
    top: -1svh;
    bottom: auto;
    width: 108vw;
    max-height: 38svh;
  }

  .registry-paper {
    top: 32svh;
    right: auto;
    left: 50%;
    width: min(88vw, 46svh);
    transform: translateX(-50%);
    animation-name: registry-paper-in-mobile;
  }

  .traveler-form .registry-field input {
    padding-right: 3px;
    padding-left: 3px;
    font-size: 16px;
    transform: translate(5px, -20px);
  }

  .traveler-form .registry-field {
    min-height: 44px;
  }

  .registry-human-field {
    top: 44%;
  }

  .registry-ai-field {
    top: 60.7%;
  }

  .registry-error {
    font-size: clamp(9px, 2.6vw, 11px);
  }

  .registry-submit {
    min-width: 108px;
    min-height: 32px;
    padding: 6px 13px;
    font-size: clamp(11px, 3vw, 13px);
  }

  .registry-privacy-note {
    top: 66.8%;
    right: 7%;
    left: 7%;
    font-size: clamp(10px, 3vw, 12.5px);
  }

  .registry-info-links {
    top: 88.9%;
    font-size: clamp(10px, 2.9vw, 12px);
  }

  .policy-dialog #dialogContent {
    padding: 12px 4px 14px;
  }

  .policy-dialog .dialog-close {
    top: 22px;
    right: 14px;
    width: 34px;
    height: 34px;
  }

  .policy-dialog-layout {
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: end;
    gap: 10px;
  }

  .policy-dialog-avatar {
    width: 54px;
    height: 54px;
    border-width: 2px;
  }

  .policy-dialog-message {
    max-height: calc(96dvh - 24px);
  }

  .policy-dialog-message::before {
    left: -9px;
    bottom: 19px;
    width: 16px;
    height: 16px;
  }

  .policy-dialog-heading {
    padding: 18px 48px 11px 16px;
  }

  .policy-dialog-heading .station-speaker {
    font-size: 13px;
  }

  .policy-dialog-heading h2 {
    font-size: 21px;
  }

  .policy-tabs {
    margin: 0 14px;
  }

  .policy-tab {
    min-height: 38px;
    padding: 7px 5px;
    font-size: 12px;
  }

  .policy-copy {
    margin-top: 11px;
    padding: 2px 16px 20px;
    font-size: 13px;
    line-height: 1.72;
  }

  @keyframes registry-paper-in-mobile {
    from { opacity: 0; transform: translateX(-50%) translateY(16px) rotate(1.5deg); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) rotate(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .station-next,
  .station-chat.message-arriving .station-message,
  .station-ohm-full,
  .registry-paper,
  .station-registry.is-stamped .registry-stamp {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
}

/* Main game: compact adventure stage */
.interface-active .game-world-shade {
  background: rgba(18, 11, 22, 0.66);
}

.game-interface {
  min-height: 100svh;
  padding: 16px clamp(16px, 2.4vw, 38px) 28px;
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}

.game-topbar {
  width: min(1320px, 100%);
  min-height: 58px;
  margin: 0 auto 14px;
  padding: 4px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff6e8;
}

.game-topbar .brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-topbar .brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: inherit;
  background: transparent;
  border-radius: 0;
}

.game-topbar .brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(5, 3, 8, 0.45));
}

.game-topbar .eyebrow,
.game-topbar h1 {
  margin: 0;
}

.game-topbar .eyebrow {
  color: #e5bd78;
  font-size: 14px;
}

.game-topbar h1 {
  font-size: clamp(19px, 2vw, 26px);
  letter-spacing: 0;
}

.game-topbar .date-chip {
  color: #f3ddbc;
  background: rgba(44, 27, 39, 0.78);
  border: 1px solid rgba(223, 169, 88, 0.48);
}

.game-main {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.adventure-layout {
  min-height: calc(100svh - 116px);
  display: grid;
  grid-template-columns: minmax(0, 920px) minmax(280px, 320px);
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 24px);
}

.play-stage {
  order: initial;
  width: 100%;
  min-height: clamp(520px, 74svh, 720px);
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.adventure-sidebar {
  width: 100%;
  max-height: calc(100svh - 112px);
  overflow-y: auto;
  color: #fff7ea;
  background: rgba(31, 20, 30, 0.92);
  border: 1px solid rgba(222, 170, 91, 0.46);
  border-radius: 7px;
  box-shadow: 0 22px 48px rgba(6, 3, 8, 0.35);
  scrollbar-color: #8b5539 transparent;
}

.side-panel {
  padding: 17px 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(222, 170, 91, 0.24);
  border-radius: 0;
}

.side-panel:last-child {
  border-bottom: 0;
}

.side-panel-kicker {
  margin: 0 0 4px;
  color: #e8b965;
  font-size: 13px;
  font-weight: 800;
}

.side-panel h2 {
  margin: 0 0 12px;
  color: #fff8ea;
  font-size: 20px;
  letter-spacing: 0;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(222, 170, 91, 0.2);
  border-bottom: 1px solid rgba(222, 170, 91, 0.2);
}

.status-panel .status-item {
  min-width: 0;
  padding: 11px 7px;
  border-right: 1px solid rgba(222, 170, 91, 0.2);
}

.status-panel .status-item:last-child {
  border-right: 0;
}

.status-panel .status-label {
  display: block;
  color: #cdbbc8;
  font-size: 10px;
  white-space: nowrap;
}

.status-panel .status-item strong {
  display: block;
  margin-top: 3px;
  color: #fff7e7;
  font-size: 18px;
}

.status-panel .rank-summary {
  position: relative;
  margin-top: 12px;
  padding: 0 0 9px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.status-panel .rank-icon {
  font-size: 22px;
}

.status-panel .rank-summary strong {
  display: block;
  color: #fff7e7;
  font-size: 15px;
}

.status-panel .rank-summary .status-label {
  font-size: 13px;
}

.status-panel .rank-track {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 40px;
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
}

.role-panel {
  order: initial;
  min-width: 0;
  padding: 17px 18px;
  color: #fff7ea;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(222, 170, 91, 0.24);
  border-radius: 0;
}

.role-panel .section-heading {
  margin: 0;
}

.role-list {
  gap: 8px;
  margin-bottom: 10px;
}

.role-card.compact {
  grid-template-columns: 64px minmax(0, 1fr);
  min-height: 64px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  border-radius: 5px;
}

.role-card.compact > img {
  width: 64px;
}

.role-card.compact .role-card-body {
  padding: 8px 9px;
}

.role-card.compact .role-owner {
  font-size: 13px;
}

.role-card.compact h3 {
  margin: 2px 0 4px;
  font-size: 17px;
}

.role-card.compact .attribute {
  padding: 2px 5px;
  font-size: 10px;
}

.role-card.compact .attribute-icon {
  width: 16px;
  height: 16px;
}

.role-panel .secondary-button {
  min-height: 40px;
  padding: 8px 12px;
  color: #f6dfbd;
  background: rgba(70, 42, 57, 0.58);
  border-color: rgba(223, 169, 88, 0.42);
}

.game-dialog.reward-dialog .dialog-close {
  display: none;
}

.fighter-button {
  width: 100%;
  min-height: 78px;
  grid-template-columns: 70px minmax(0, 1fr);
  color: #fff7ea;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(231, 184, 105, 0.38);
  border-radius: 5px;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}

.fighter-button:hover:not(:disabled),
.fighter-button:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: #f2bd62;
}

.fighter-button:disabled {
  filter: grayscale(0.65);
  opacity: 0.42;
}

.fighter-portrait {
  width: 70px;
  height: 100%;
  object-fit: cover;
}

.fighter-button > span {
  min-width: 0;
  padding: 8px 10px;
  display: grid;
  align-content: center;
  gap: 2px;
}

.fighter-button small {
  overflow: hidden;
  color: #d8c3d1;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fighter-button strong {
  font-size: 17px;
}

.fighter-button em {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.hint-panel p:not(.side-panel-kicker):not(.attribute-cycle) {
  margin: 8px 0 0;
  color: #cfbeca;
  font-size: 12px;
  line-height: 1.65;
}

.attribute-cycle {
  margin: 0;
  color: #f1bf6b;
  font-size: 13px;
  font-weight: 900;
}

.utility-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.utility-panel button {
  min-height: 38px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #f8e8ce;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(223, 169, 88, 0.3);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.utility-panel button:hover,
.utility-panel button:focus-visible {
  color: #fff;
  background: rgba(155, 76, 48, 0.52);
  border-color: #efba61;
}

.stage-home {
  position: relative;
  min-height: inherit;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.stage-home::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 47% 44%, rgba(225, 144, 65, 0.09), transparent 42%);
  pointer-events: none;
}

.stage-home-copy {
  width: min(540px, calc(100% - 40px));
  margin: 0 0 18px auto;
  padding: 15px 18px;
  color: #fff6e8;
  background: rgba(30, 18, 29, 0.78);
  border: 1px solid rgba(222, 170, 91, 0.34);
  border-radius: 6px;
}

.stage-home-copy .eyebrow,
.event-copy .eyebrow {
  margin: 0 0 5px;
  color: #edb961;
  font-size: 11px;
}

.stage-home-copy h2 {
  margin: 0 0 7px;
  font-size: clamp(23px, 2.5vw, 34px);
  letter-spacing: 0;
}

.stage-home-copy p:last-child {
  margin: 0;
  color: #d8cad3;
  line-height: 1.65;
}

.adventure-start-button {
  position: absolute;
  left: 0;
  bottom: 8px;
  width: min(210px, 27%);
  gap: 4px;
}

.adventure-start-button img {
  width: 100%;
}

.adventure-start-button > span {
  padding: 7px 12px;
  color: #fff3dd;
  background: rgba(45, 25, 41, 0.88);
  border: 1px solid rgba(240, 184, 91, 0.62);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 900;
}

.event-card {
  position: relative;
  width: min(880px, 100%);
  height: clamp(520px, 72svh, 700px);
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  color: #fff7ea;
  background: rgba(29, 19, 29, 0.9);
  border: 1px solid rgba(225, 174, 91, 0.52);
  border-radius: 7px;
  box-shadow: 0 24px 58px rgba(5, 3, 8, 0.42);
}

.journey-card {
  width: min(680px, 100%);
}

.combat-card {
  width: min(720px, 100%);
}

.event-visual {
  position: relative;
  min-height: 0;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(19, 13, 21, 0.5);
}

.shop-visual img {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  display: block;
  object-fit: contain;
  animation: art-reveal 480ms ease both;
}

.event-copy {
  min-height: 126px;
  padding: 17px 190px 18px 22px;
  border-top: 1px solid rgba(225, 174, 91, 0.28);
}

.event-copy h2 {
  margin: 0 0 7px;
  color: #fff8e9;
  font-size: clamp(24px, 2.7vw, 34px);
  letter-spacing: 0;
}

.event-copy .shop-owner {
  margin: -1px 0 7px;
  color: #efb857;
  font-size: 13px;
  font-weight: 800;
}

.event-copy > p:last-child {
  margin: 0;
  color: #d8ccd4;
  line-height: 1.65;
}

.event-next-button {
  position: absolute;
  right: 22px;
  bottom: 25px;
  min-width: 144px;
  min-height: 48px;
  padding: 9px 14px 9px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #fff8e9;
  background: #8e462e;
  border: 1px solid #d99c57;
  border-radius: 5px;
  font-weight: 900;
}

.event-next-button span:last-child {
  font-size: 26px;
  line-height: 1;
}

.event-next-button:hover,
.event-next-button:focus-visible {
  background: #a75736;
  border-color: #f2c26f;
}

.monster-stage {
  position: relative;
  background:
    radial-gradient(circle at 50% 53%, rgba(231, 147, 55, 0.18), transparent 43%),
    rgba(18, 12, 20, 0.56);
}

.monster-stage img {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
  filter: none;
  animation: monster-settle 430ms ease-out both;
}

.monster-stage figcaption {
  position: absolute;
  left: 18px;
  bottom: 16px;
  padding: 7px 11px;
  color: #43242b;
  background: #f2bd62;
  border-radius: 4px;
  font-weight: 900;
}

.monster-clue-copy {
  padding-right: 22px;
}

.monster-clue-copy blockquote {
  margin: 9px 0 8px;
  padding: 11px 14px;
  color: #f7eadb;
  background: rgba(75, 44, 58, 0.58);
  border-left-color: #e58b42;
  line-height: 1.65;
}

.monster-clue-copy .hidden-hint {
  color: #c9b8c4;
  font-size: 12px;
}

.game-interface.is-monster-revealing::after {
  content: "";
  position: fixed;
  z-index: 20;
  inset: 0;
  background: rgba(9, 5, 12, 0.72);
  pointer-events: none;
  animation: monster-dim 2.5s ease-in-out both;
}

.monster-reveal-overlay {
  position: fixed;
  z-index: 21;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgba(239, 155, 61, 0.14), transparent 46%);
  pointer-events: none;
}

.monster-reveal-art {
  width: min(70%, 590px);
  max-height: 83%;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(255, 236, 188, 0.98)) drop-shadow(0 20px 30px rgba(5, 2, 8, 0.64));
  animation: monster-arrival 2.5s ease-in-out both;
}

.monster-alert-banner {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: min(76%, 650px);
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 18px rgba(5, 2, 8, 0.56));
  animation: monster-alert-in 2.5s ease-in-out both;
}

.battle-result-layout {
  display: grid;
  justify-items: start;
}

.battle-result-layout h2 {
  margin-top: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.battle-result-role {
  color: #d9c7d2;
}

.battle-result-layout .primary-button {
  margin-top: 16px;
}

.shop-information-entry small {
  color: #bfaebc;
  line-height: 1.55;
}

.shop-information-entry .shop-owner-line {
  color: #efb857;
  font-weight: 800;
}

@keyframes monster-settle {
  from { opacity: 0; transform: translateY(24px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes monster-arrival {
  0% { opacity: 0; transform: translateY(80px) scale(0.48) rotate(-4deg); }
  18% { opacity: 1; transform: translateY(-8px) scale(1.04) rotate(1deg); }
  27%, 74% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
  88%, 100% { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

@keyframes monster-alert-in {
  0%, 12% { opacity: 0; transform: translateX(-50%) scaleX(0.72); }
  24%, 74% { opacity: 1; transform: translateX(-50%) scaleX(1); }
  88%, 100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

@keyframes monster-dim {
  0% { opacity: 0; }
  12%, 78% { opacity: 1; }
  100% { opacity: 0; }
}

@media (max-width: 980px) {
  .game-interface {
    padding: 10px 12px 24px;
  }

  .game-topbar {
    min-height: 52px;
    margin-bottom: 8px;
  }

  .game-topbar .brand-mark {
    width: 48px;
    height: 48px;
  }

  .game-topbar .eyebrow {
    display: none;
  }

  .adventure-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
  }

  .play-stage {
    order: 1;
    min-height: 0;
  }

  .adventure-sidebar {
    display: contents;
  }

  .role-panel {
    order: 2;
    background: rgba(31, 20, 30, 0.94);
    border: 1px solid rgba(222, 170, 91, 0.42);
    border-radius: 6px;
  }

  .status-panel {
    order: 3;
    background: rgba(31, 20, 30, 0.94);
    border: 1px solid rgba(222, 170, 91, 0.42);
    border-radius: 6px;
  }

  .hint-panel {
    order: 4;
    background: rgba(31, 20, 30, 0.94);
    border: 1px solid rgba(222, 170, 91, 0.42);
    border-radius: 6px;
  }

  .utility-panel {
    order: 5;
    background: rgba(31, 20, 30, 0.94);
    border: 1px solid rgba(222, 170, 91, 0.42);
    border-radius: 6px;
  }

  .stage-home {
    min-height: 68svh;
  }

  .stage-home-copy {
    width: min(100%, 520px);
    margin-bottom: 0;
  }

  .adventure-start-button {
    width: min(34vw, 180px);
    bottom: 132px;
  }

  .event-card {
    height: auto;
    min-height: 0;
    grid-template-rows: minmax(320px, 58svh) auto;
  }

  .event-copy {
    padding-right: 180px;
  }

}

@media (max-width: 600px) {
  .game-interface {
    padding: 8px 9px 22px;
  }

  .game-topbar h1 {
    font-size: 18px;
  }

  .game-topbar .date-chip {
    padding: 4px 7px;
    font-size: 10px;
  }

  .stage-home {
    min-height: 72svh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 10px;
  }

  .stage-home-copy {
    width: 100%;
    padding: 13px 14px;
  }

  .stage-home-copy h2 {
    font-size: 23px;
  }

  .stage-home-copy p:last-child {
    font-size: 13px;
  }

  .adventure-start-button {
    position: relative;
    left: auto;
    bottom: auto;
    align-self: center;
    width: min(47vw, 172px);
    order: -1;
  }

  .event-card {
    grid-template-rows: minmax(250px, 48svh) auto auto;
  }

  .event-copy,
  .monster-clue-copy {
    min-height: 0;
    padding: 14px 15px;
  }

  .event-copy h2 {
    font-size: 24px;
  }

  .event-copy > p:last-child,
  .monster-clue-copy blockquote {
    font-size: 13px;
  }

  .event-next-button {
    position: static;
    width: calc(100% - 30px);
    margin: 0 15px 15px;
  }

  .monster-stage figcaption {
    left: 10px;
    bottom: 10px;
    font-size: 13px;
  }

  .monster-reveal-art {
    width: min(94vw, 500px);
    max-height: 70svh;
  }

  .monster-alert-banner {
    bottom: 7%;
    width: min(96%, 520px);
  }

  .side-panel {
    padding: 15px;
  }

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

  .role-card.compact {
    display: block;
  }

  .role-card.compact > img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
  }

  .role-list.is-selecting {
    grid-template-columns: 1fr;
  }

  .fighter-button {
    min-height: 78px;
  }

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

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

@media (prefers-reduced-motion: reduce) {
  .monster-reveal-art,
  .monster-alert-banner,
  .monster-stage img {
    animation-duration: 0.01ms !important;
  }
}
