:root {
  color-scheme: light dark;
  --gold: #d7a900;
  --gold-bright: #f0c43b;
  --paper: #f6f2e8;
  --ink: #171918;
  --focus: #f4c732;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0e0f10;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select { font: inherit; }

button,
select { -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

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

.skip-link {
  position: fixed;
  z-index: 3000;
  top: 8px;
  left: 8px;
  padding: 8px 11px;
  border-radius: 4px;
  background: #151718;
  color: #f4c732;
  font-size: 12px;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.app-shell,
.engine-stage,
.engine-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.engine-stage {
  --prairie-turn-duration: 900ms;
  --prairie-turn-ease: cubic-bezier(0.62, 0.02, 0.18, 1);
  --prairie-turn-intensity: 0.86;
  isolation: isolate;
  overflow: hidden;
  background: #f6f2e8;
}

.engine-frame {
  z-index: 0;
  display: block;
  border: 0;
  background: #f6f2e8;
}

.engine-frame.is-active {
  z-index: 0;
  visibility: visible;
  opacity: 1;
  clip-path: inset(0);
  pointer-events: auto;
}

.engine-frame.is-standby {
  z-index: 1;
  visibility: hidden;
  opacity: 1;
  clip-path: inset(0 100% 0 0);
  pointer-events: none;
}

.engine-stage.prairie-turn-staging .engine-frame {
  pointer-events: none;
  will-change: clip-path, opacity;
}

.engine-stage.prairie-turn-staging .engine-frame.is-standby,
.engine-stage.prairie-turn-revealing .engine-frame.is-standby {
  visibility: visible;
}

.engine-stage.prairie-turn-revealing .engine-frame.is-standby {
  z-index: 2;
  animation: prairie-turn-frame-reveal var(--prairie-turn-duration) var(--prairie-turn-ease) both;
}

.worldline-transition {
  position: absolute;
  z-index: 390;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-100%, 0, 0);
  transform-origin: right center;
}

.engine-stage.prairie-turn-revealing .worldline-transition {
  animation: prairie-turn-worldline-sweep var(--prairie-turn-duration) var(--prairie-turn-ease) both;
  will-change: transform, opacity;
}

.worldline-wake {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: clamp(150px, 28vw, 360px);
  overflow: hidden;
  opacity: var(--prairie-turn-intensity);
  background: linear-gradient(90deg, transparent 0%, rgba(215, 169, 0, 0.018) 54%, rgba(240, 196, 59, 0.13) 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.28) 24%, #000 66%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.28) 24%, #000 66%);
}

.worldline-contour {
  position: absolute;
  right: -16%;
  display: block;
  width: 116%;
  height: 31%;
  border-top: 1px solid rgba(19, 18, 14, 0.72);
  border-radius: 50%;
  filter: drop-shadow(0 -1px 0 rgba(240, 196, 59, 0.66));
  transform-origin: right center;
}

.worldline-contour:nth-child(1) {
  top: 5%;
  transform: rotate(-7deg) scaleY(0.74);
}

.worldline-contour:nth-child(2) {
  top: 29%;
  right: -7%;
  width: 108%;
  transform: rotate(5deg) scaleY(1.08);
}

.worldline-contour:nth-child(3) {
  top: 55%;
  right: -20%;
  width: 125%;
  transform: rotate(-4deg) scaleY(0.86);
}

.worldline-contour:nth-child(4) {
  top: 78%;
  right: -11%;
  width: 112%;
  transform: rotate(8deg) scaleY(0.62);
}

.worldline-seam {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: block;
  width: 2px;
  opacity: clamp(0.78, var(--prairie-turn-intensity), 1);
  background: linear-gradient(180deg, transparent 0%, #d7a900 5%, #f0c43b 48%, #d7a900 95%, transparent 100%);
  box-shadow:
    -1px 0 0 rgba(23, 25, 24, 0.72),
    1px 0 0 rgba(246, 242, 232, 0.68),
    0 0 11px rgba(240, 196, 59, 0.78),
    -12px 0 28px rgba(215, 169, 0, 0.18);
}

@keyframes prairie-turn-frame-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}

@keyframes prairie-turn-worldline-sweep {
  0% { opacity: 0; transform: translate3d(-100%, 0, 0); }
  4% { opacity: 1; }
  96% { opacity: 1; }
  100% { opacity: 0.92; transform: translate3d(0, 0, 0); }
}

@keyframes prairie-turn-frame-dissolve {
  from { opacity: 0.08; }
  to { opacity: 1; }
}

.simulation-ui {
  --simulation-clearance: clamp(48px, 11vh, 104px);
  position: fixed;
  z-index: 400;
  left: 50%;
  bottom: var(--simulation-clearance);
  width: min(790px, calc(100vw - 48px));
  color: #171918;
  transform: translateX(-50%);
}

.simulation-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(35, 32, 25, 0.4);
  border-radius: 6px;
  background: rgba(246, 242, 232, 0.96);
  box-shadow:
    0 8px 26px rgba(35, 32, 25, 0.16),
    inset 0 0 0 3px rgba(246, 242, 232, 0.82),
    inset 0 0 0 4px rgba(138, 122, 92, 0.16);
  backdrop-filter: blur(4px);
}

.simulation-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  width: 100%;
  margin: 0;
}

.simulation-input,
.simulation-button {
  height: 44px;
  min-height: 44px;
  margin: 0;
  border: 1px solid #232019;
  border-radius: 3px;
  color: #171918;
  font-family: "Times New Roman", Times, serif;
}

.simulation-input {
  appearance: none;
  min-width: 0;
  padding: 0 13px;
  background: rgba(246, 242, 232, 0.34) !important;
  color-scheme: light;
  font-size: 17px;
  -webkit-text-fill-color: #171918;
}

.simulation-input::placeholder {
  color: rgba(23, 25, 24, 0.58);
  font-style: italic;
}

.simulation-input:hover:not(:disabled),
.simulation-input:focus,
.simulation-button:hover:not(:disabled) {
  border-color: #000;
}

.simulation-input:focus {
  outline: 2px solid rgba(122, 92, 46, 0.64);
  outline-offset: 2px;
}

.simulation-button {
  min-width: 76px;
  padding: 0 15px;
  background: rgba(246, 242, 232, 0.98);
  cursor: pointer;
  font-size: 14px;
}

.advance-button {
  background: rgba(239, 233, 218, 0.98);
  font-style: italic;
}

.simulation-input:disabled,
.simulation-button:disabled {
  cursor: default;
  opacity: 0.58;
}

.simulation-narrative {
  grid-column: 1 / -1;
  min-height: 1.4em;
  max-height: min(92px, calc(var(--simulation-clearance) + 24px));
  margin: 0;
  padding: 9px 12px 3px 16px;
  border-top: 1px solid rgba(35, 32, 25, 0.18);
  border-left: 3px solid rgba(183, 137, 0, 0.58);
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  color: #000;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(13px, 1.45vw, 16px);
  font-style: normal;
  line-height: 1.35;
  text-align: left;
  -webkit-overflow-scrolling: touch;
}

.engine-help {
  z-index: 405;
  display: flex;
  align-items: center;
}

.title-help {
  position: fixed;
  top: calc(50% + 87px);
  left: calc(50% + 312px);
  transform: translateY(-50%);
}

.world-help {
  position: relative;
  justify-self: center;
}

.help-button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(35, 32, 25, 0.62);
  border-radius: 50%;
  background: rgba(246, 242, 232, 0.58);
  color: #171918;
  cursor: help;
  font-family: "Times New Roman", Times, serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(35, 32, 25, 0.09);
  backdrop-filter: blur(3px);
}

.help-button:hover,
.help-button:focus-visible,
.engine-help.is-open .help-button {
  border-color: #232019;
  background: rgba(246, 242, 232, 0.86);
}

.help-card {
  position: absolute;
  width: min(290px, calc(100vw - 92px));
  padding: 14px 16px;
  border: 1px solid rgba(35, 32, 25, 0.32);
  border-radius: 4px;
  background: rgba(246, 242, 232, 0.94);
  color: #171918;
  box-shadow: 0 8px 24px rgba(35, 32, 25, 0.13);
  backdrop-filter: blur(5px);
}

.title-help .help-card {
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
}

.world-help .help-card {
  right: 0;
  bottom: 46px;
}

.help-card p {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.42;
}

.program-controls {
  position: fixed;
  z-index: 420;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  isolation: isolate;
  transform: translateZ(0);
}

.model-control {
  position: static;
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(244px + 2ch);
  min-width: 0;
  min-height: 36px;
  padding: 0 7px 0 10px;
  border: 1px solid rgba(122, 92, 46, 0.34);
  border-radius: 4px;
  background: rgba(246, 242, 232, 0.94);
  color: #232019;
  font-family: "Hoefler Text", "Iowan Old Style", Baskerville, "Palatino", "Book Antiqua", Georgia, serif;
  box-shadow: 0 1px 4px rgba(35, 32, 25, 0.12);
}

.home-button {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(246, 242, 232, 0.34);
  border-radius: 3px;
  background: rgba(14, 15, 16, 0.88);
  color: #dadbd4;
  cursor: pointer;
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.03em;
  box-shadow: 0 1px 4px rgba(14, 15, 16, 0.24);
}

.home-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--gold-bright);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.home-button:hover:not(:disabled),
.model-control:hover {
  border-color: rgba(122, 92, 46, 0.58);
}

.home-button:hover:not(:disabled) { background: #171918; }
.model-control:hover { background: #f6f2e8; }

.home-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.model-control label {
  color: #8a7a5c;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.model-control .model-input-wrap select {
  height: 34px;
  border: 0;
  border-left: 1px solid rgba(138, 122, 92, 0.34);
  border-radius: 0;
  background: transparent;
  color: #232019;
  color-scheme: light;
  font: inherit;
  font-size: 13px;
  box-shadow: none;
  cursor: pointer;
}

.model-control .model-input-wrap select:focus {
  border-left-color: rgba(122, 92, 46, 0.68);
  outline: 0;
  background: rgba(215, 169, 0, 0.07);
  box-shadow: inset 0 0 0 1px rgba(183, 137, 0, 0.34);
}

.model-control .select-caret { color: #8a7a5c; }

.model-control option {
  background: #f6f2e8;
  color: #232019;
  font-family: "Hoefler Text", "Iowan Old Style", Baskerville, "Palatino", "Book Antiqua", Georgia, serif;
}

.world-stamp {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(185px, 18vw, 220px);
  aspect-ratio: 2500 / 750;
  border: 0;
  background: transparent;
  opacity: 0.96;
  pointer-events: none;
  transform: translateY(-10px);
  user-select: none;
}

.world-stamp img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.world-stamp.is-working { animation: stamp-breathe 2.6s ease-in-out infinite; }

@keyframes stamp-breathe {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .world-stamp.is-working { animation: none; opacity: 0.94; }
}

.model-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.model-input-wrap select {
  appearance: none;
  width: 100%;
  height: 25px;
  padding: 0 28px 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 4px;
  outline: 0;
  background: #151718;
  color: #dedfd7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 9px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.52);
}

.model-input-wrap select:focus { border-color: rgba(224, 170, 0, 0.65); }

.model-input-wrap select:disabled {
  cursor: default;
  opacity: 0.58;
}

.select-caret {
  position: absolute;
  top: 50%;
  right: 9px;
  color: var(--gold);
  font-size: 13px;
  pointer-events: none;
  transform: translateY(-60%);
}

.operation-lock {
  position: fixed;
  z-index: 410;
  inset: 0;
  display: grid;
  place-items: center;
  cursor: default;
  background: rgba(246, 242, 232, 0.18);
  color: #171918;
  backdrop-filter: blur(1.5px);
}

.loading-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 178px;
  padding: 22px 28px 20px;
  border: 1px solid rgba(35, 32, 25, 0.34);
  border-radius: 6px;
  background: rgba(246, 242, 232, 0.92);
  box-shadow: 0 10px 34px rgba(35, 32, 25, 0.2);
}

.engine-stage.prairie-turn-revealing .operation-lock {
  background: transparent;
  backdrop-filter: none;
}

.engine-stage.prairie-turn-revealing .loading-card {
  visibility: hidden;
  opacity: 0;
}

.loading-mechanism {
  display: flex;
  align-items: center;
  gap: 13px;
  height: 36px;
}

.loading-mechanism span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #171918;
  animation: prairie-loading-pulse 1.2s ease-in-out infinite;
}

.loading-mechanism span:nth-child(2) { animation-delay: 0.15s; }
.loading-mechanism span:nth-child(3) { animation-delay: 0.3s; }

.operation-label {
  font-family: "Times New Roman", Times, serif;
  font-size: 27px;
  font-style: italic;
  letter-spacing: 0.02em;
}

@keyframes prairie-loading-pulse {
  0%, 60%, 100% { opacity: 0.28; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.connection-wall {
  position: fixed;
  z-index: 1500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 46%, #35383a 0%, #1a1c1d 34%, #0b0c0d 78%),
    #0b0c0d;
}

.connection-wall::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.012) 4px);
  opacity: 0.35;
}

.connection-wall.is-hidden { display: none; }

.connection-panel {
  position: relative;
  z-index: 1;
  width: min(410px, calc(100vw - 48px));
  max-height: calc(100vh - 40px);
  padding: 30px 34px 27px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: linear-gradient(145deg, #292c2e, #1b1d1f 48%, #141617);
  color: #ddd9cb;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -2px 8px rgba(0, 0, 0, 0.55),
    0 35px 90px rgba(0, 0, 0, 0.62);
}

.connection-panel::after {
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 6px;
  pointer-events: none;
  content: "";
}

.connection-mark {
  float: right;
  width: 62px;
  height: 62px;
  margin: -5px -5px 10px 16px;
  object-fit: contain;
  filter: drop-shadow(0 7px 16px rgba(0, 0, 0, 0.42));
}

.eyebrow {
  margin: 0;
  color: var(--gold-bright);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.connection-panel h1 {
  margin: 8px 0 9px;
  color: #f0ede3;
  font-size: 28px;
  font-weight: 370;
  letter-spacing: -0.035em;
}

.connection-message {
  max-width: 310px;
  margin: 0 0 24px;
  color: #b7bab3;
  font-size: 13px;
  line-height: 1.55;
}

.connection-form {
  display: grid;
  gap: 8px;
}

.connection-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.connection-form label,
.advanced-field label {
  margin-top: 4px;
  color: #bfc0b9;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.045em;
}

.connection-form > input,
.wall-model-wrap select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  outline: 0;
  background: #101213;
  color: var(--paper);
  font-size: 12px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.66);
}

.connection-form > input:focus,
.wall-model-wrap select:focus {
  border-color: rgba(228, 177, 17, 0.8);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.66), 0 0 0 1px rgba(228, 177, 17, 0.15);
}

.inline-link {
  width: fit-content;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 216, 95, 0.5);
  background: transparent;
  color: #f0ca57;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.35;
}

.inline-link:hover:not(:disabled) {
  border-color: var(--focus);
  color: #ffe38a;
}

.wall-model-wrap {
  position: relative;
  width: 100%;
}

.wall-model-wrap select {
  padding-right: 34px;
  border-left: 2px solid var(--gold);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.wall-model-wrap select:hover {
  border-color: rgba(255, 255, 255, 0.24);
  border-left-color: var(--gold-bright);
  background: #12191a;
}

.wall-model-wrap .select-caret {
  right: 13px;
  color: var(--gold-bright);
  font-size: 15px;
}

.model-row-label { margin-top: 2px; }

.roster-count {
  color: #8b8f88;
  font-size: 10px;
  font-weight: 620;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 42px;
  border-radius: 5px;
  cursor: pointer;
}

.primary-button {
  margin-top: 12px;
  border: 1px solid #b28500;
  background: linear-gradient(180deg, #e7b500 0%, #b48600 52%, #8a6600 100%);
  color: #171309;
  font-size: 12px;
  font-weight: 710;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.36),
    inset 0 -2px rgba(83, 57, 0, 0.38),
    0 8px 20px rgba(0, 0, 0, 0.35);
}

.primary-button:hover:not(:disabled) {
  background: linear-gradient(180deg, #f5c41c 0%, #c69500 54%, #936e00 100%);
}

.secondary-button {
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.055);
  color: #e1e2da;
  font-size: 11px;
  font-weight: 640;
}

.secondary-button:hover:not(:disabled) {
  border-color: rgba(255, 216, 95, 0.58);
  background: rgba(255, 255, 255, 0.09);
}

.primary-button:disabled,
.secondary-button:disabled,
.inline-link:disabled {
  cursor: default;
  opacity: 0.48;
}

.recovery-actions {
  display: grid;
  gap: 9px;
}

.recovery-actions .primary-button { margin-top: 0; }

.forget-key-button {
  justify-self: center;
  margin-top: 4px;
}

.connection-error {
  margin: 15px 0 0;
  padding: 10px 11px;
  border: 1px solid rgba(241, 138, 114, 0.25);
  border-radius: 4px;
  background: rgba(89, 33, 24, 0.23);
  color: #f0a18e;
  font-size: 11px;
  line-height: 1.45;
}

.secret-note {
  margin: 12px 0 0;
  color: #92968f;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 1800;
  right: 18px;
  bottom: 18px;
  max-width: min(390px, calc(100vw - 36px));
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(18, 20, 21, 0.92);
  color: #e4e2d8;
  font-size: 11px;
  line-height: 1.45;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(10px);
}

@media (max-width: 620px) {
  .program-controls {
    top: 10px;
    right: 10px;
    left: 10px;
    justify-content: flex-end;
  }
  .model-control { width: min(calc(244px + 2ch), calc(100vw - 104px)); }
  .model-control label { display: none; }
  .world-stamp {
    width: min(180px, calc(100vw - 104px));
    transform: translateY(-6px);
  }
  .home-button { flex: 0 0 auto; }
  .connection-panel { padding: 26px 25px 24px; }

  .simulation-ui {
    --simulation-clearance: max(20px, env(safe-area-inset-bottom));
    bottom: var(--simulation-clearance);
    width: calc(100vw - 20px);
  }

  .simulation-panel {
    grid-template-columns: minmax(0, 1fr) 36px;
    align-items: start;
    gap: 6px;
    padding: 7px;
  }

  .simulation-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .advance-button { grid-column: 1 / -1; }
  .simulation-button { min-width: 72px; }
  .simulation-narrative { padding-top: 7px; }

  .title-help { bottom: auto; }
  .title-help .help-card { left: auto; right: 0; transform: none; }
  .help-card { width: min(270px, calc(100vw - 64px)); }
  .world-help .help-card { right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-mechanism span { animation: none; }
  .loading-mechanism span:nth-child(2) { opacity: 0.62; }
  .loading-mechanism span:nth-child(3) { opacity: 0.3; }

  .engine-stage.prairie-turn-revealing .engine-frame.is-standby {
    clip-path: none;
    animation: prairie-turn-frame-dissolve 90ms linear both;
  }

  .engine-stage.prairie-turn-revealing .worldline-transition {
    opacity: 0;
    animation: none;
    transform: translate3d(-100%, 0, 0);
  }
}

@media (forced-colors: active) {
  .home-button,
  .world-stamp,
  .model-control,
  .connection-panel { border-color: CanvasText; }

  .simulation-input,
  .simulation-button,
  .help-button,
  .help-card {
    border-color: CanvasText;
    background: Canvas;
    color: CanvasText;
    box-shadow: none;
  }

  .operation-lock { background: Canvas; color: CanvasText; }
  .loading-mechanism span { background: CanvasText; }
  .worldline-seam { background: CanvasText; box-shadow: none; }
  .worldline-contour { border-top-color: CanvasText; filter: none; }
}

/* Local simulation menus: compact list rows, translucent panes, no scene blur. */
body[data-scene="world"] .simulation-ui {
  left: 20px; bottom: 20px; width: min(340px, calc(100vw - 40px)); transform: none;
}
body[data-scene="world"] .simulation-panel,
.scene-menu {
  color: #fff8e9; background: rgba(17, 23, 25, .58);
  border: 1px solid rgba(247, 237, 209, .5); border-radius: 2px;
  box-shadow: 0 2px 10px #0003, inset 0 0 0 1px #0005;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  font-family: Tahoma, Verdana, sans-serif; font-size: 13px;
  text-shadow: 0 1px 2px #000;
}
body[data-scene="world"] .simulation-panel { display: flex; flex-direction: column; align-items: stretch; padding: 0; gap: 0; }
.menu-caption { display: flex; justify-content: space-between; align-items: center; min-height: 30px; padding: 5px 10px; background: #bba56b20; border-bottom: 1px solid #fff3; font-size: 11px; letter-spacing: .05em; }
.menu-caption h2 { margin: 0; font: inherit; font-weight: bold; }
.menu-caption button { color: inherit; border: 0; padding: 3px 6px; background: transparent; font: inherit; cursor: pointer; }
body[data-scene="world"] .simulation-form { display: grid; grid-template-columns: 1fr; padding: 8px 10px 0; gap: 0; }
body[data-scene="world"] .simulation-input { height: 36px; min-height: 36px; padding: 6px 8px; border: 1px solid #fff6; color: #fff8e9; -webkit-text-fill-color: #fff8e9; font: 13px Tahoma, Verdana, sans-serif; background: #0003 !important; border-radius: 1px; }
body[data-scene="world"] .simulation-input::placeholder { color: #fff9; font-style: normal; }
body[data-scene="world"] .simulation-button,
.simulation-menu button, .menu-action {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  height: auto; min-height: 31px; padding: 7px 8px; margin: 0;
  border: 0; border-bottom: 1px solid #f3e9cc26; border-radius: 0;
  background: transparent; color: #fff8e9; text-shadow: 0 1px 2px #000;
  text-align: left; font: 13px Tahoma, Verdana, sans-serif; cursor: pointer;
}
body[data-scene="world"] .simulation-button::before { content: "›"; margin-right: 8px; }
body[data-scene="world"] .simulation-button { justify-content: flex-start; }
.simulation-menu { padding: 0 10px 6px; }
.simulation-menu button:hover:not(:disabled), .menu-action:hover:not(:disabled),
body[data-scene="world"] .simulation-button:hover:not(:disabled) { background: #d9bd7950; }
.simulation-menu button:focus-visible, .scene-menu :focus-visible, .show-controls:focus-visible { outline: 2px solid #edcf8c; outline-offset: -2px; }
body[data-scene="world"] .simulation-narrative { margin: 0; padding: 11px 12px; border: 0; border-top: 1px solid #fff4; max-height: min(180px, 24vh); color: #fff8e9; background: #0001; font: 14px/1.45 Georgia, serif; }
body[data-scene="world"] .world-help { align-self: flex-end; padding-right: 10px; }
body[data-scene="world"] .world-help .help-button { width: 24px; height: 24px; min-width: 24px; background: transparent; color: #fff8e9; font: 16px Georgia, serif; border: 0; box-shadow: none; }
body[data-scene="world"] .world-stamp { opacity: .65; width: 210px; }
body[data-scene="world"] .home-button { background: #11171980; border: 1px solid #fff5; box-shadow: none; padding: 6px 12px; min-height: 34px; font-size: 12px; }
.scene-menu { position: fixed; z-index: 450; left: 372px; bottom: 20px; width: min(350px, calc(100vw - 40px)); max-height: calc(100vh - 100px); overflow-y: auto; }
.scene-menu[data-menu="load"] { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(660px, calc(100vw - 40px)); background: #111719db; }
.menu-page { padding: 14px; }
.menu-page label { display: block; margin: 0 0 6px; color: #f5d996; font-size: 12px; }
.menu-page input, .menu-page textarea, .menu-page select { width: 100%; margin: 0 0 13px; padding: 8px; border: 1px solid #fff6; border-radius: 1px; color: #fff8e9; -webkit-text-fill-color: #fff8e9; background: #10151880; font: 13px/1.4 Tahoma, Verdana, sans-serif; color-scheme: dark; }
.menu-page textarea { resize: vertical; max-height: 220px; }
.menu-page .menu-action { margin-bottom: 14px; border: 1px solid #fff5; }
.menu-note { margin: 0 0 14px; font-size: 12px; line-height: 1.5; color: #ebe5d5; }
.save-library { display: grid; gap: 6px; }
.save-library details { border: 1px solid #fff4; }
.save-library summary { padding: 11px; cursor: pointer; }
.save-library summary small { display: block; margin: 5px 0 0 14px; color: #ddd3be; }
.saved-frame { width: 100%; display: block; text-align: left; padding: 10px 12px; background: #0002; color: #fff8e9; border: 0; border-top: 1px solid #fff3; font: 12px/1.5 Tahoma, sans-serif; cursor: pointer; }
.saved-frame:hover { background: #d9bd7935; }
.saved-frame strong, .saved-frame small { display: block; }
.saved-frame small { color: #ddd3be; }
.show-controls, .title-load { position: fixed; z-index: 450; bottom: 20px; border: 1px solid #baa575; border-radius: 2px; padding: 9px 15px; cursor: pointer; font: 13px Tahoma, sans-serif; }
.show-controls { left: 20px; color: #fff8e9; background: #11171980; }
.title-load { right: 24px; color: #232019; background: #f6f2e8b8; }
body.controls-hidden .program-controls { visibility: hidden; }
body[data-scene="world"] .operation-lock { background: transparent; }
@media (max-width: 760px) { .scene-menu:not([data-menu="load"]) { left: 20px; bottom: 20px; background: #111719ed; } }

/* Both active APIs stay visible, with an explicit two-column model chooser. */
.model-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left; }
.model-summary small { display: block; font-size: 10px; line-height: 1.6; font-weight: normal; }
.model-summary b { font-weight: normal; }
#model-control { padding: 0; background: #f6f2e8c9; border: 1px solid #8b806755; border-radius: 2px; }
#engine-model { width: 100%; padding: 8px 12px; border: 0; background: transparent; color: #232019; font: 12px Tahoma, sans-serif; cursor: pointer; }
#engine-model small { font-size: 11px; }
#engine-model small b { margin-left: 8px; font-weight: bold; }
.scene-menu[data-menu="models"] { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 40px)); background: #111719d6; }
.model-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.model-columns fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.model-columns legend { padding: 0; font-size: 16px; font-family: Georgia, serif; color: #f5d996; }
.model-purpose { margin: 6px 0 12px; color: #ddd3be; font-size: 11px; }
.menu-page .model-choice { display: flex; align-items: flex-start; gap: 8px; padding: 10px 8px; margin: 0; border: 1px solid transparent; border-bottom-color: #fff2; color: #fff8e9; cursor: pointer; }
.menu-page .model-choice:has(input:checked) { border-color: #f5d99680; background: #c5ab7130; }
.menu-page .model-choice:hover { background: #fff1; }
.menu-page .model-choice input { width: 14px; height: 14px; margin: 2px 0 0; accent-color: #f5d996; flex: 0 0 auto; }
.model-choice strong, .model-choice small { display: block; line-height: 1.5; }
.model-choice strong { font-size: 12px; }
.model-choice small { font-size: 10px; color: #e4ddcc; }
.model-choice .model-route { color: #c8bfae; font-size: 9px; overflow-wrap: anywhere; }
.model-pricing-note { margin: 14px 0; color: #ddd3be; font-size: 10px; line-height: 1.5; }
.model-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid #fff3; padding-top: 12px; }
.model-footer .menu-note { margin: 0; }
.model-footer .menu-action { width: auto; min-width: 140px; margin: 0; }
body[data-scene="world"] .simulation-panel { max-height: calc(100vh - 100px); overflow-y: auto; }
@media (max-width: 620px) { .model-columns { grid-template-columns: 1fr; } }

/* Mobile browser host: preserve the complete scene and keep controls reachable. */
@supports (height: 100dvh) {
  html, body, .app-shell, .engine-stage { height: 100dvh; min-height: 100dvh; }
}
html, body { width: 100%; overscroll-behavior: none; }
body { min-height: 100svh; }
.job-notice {
  position: fixed; z-index: 700; top: calc(env(safe-area-inset-top) + 115px); left: 50%;
  pointer-events: none;
  width: min(520px, calc(100vw - 24px)); transform: translateX(-50%);
  padding: 12px 14px; border: 1px solid #fff7; border-radius: 3px;
  color: #fff8e9; background: rgba(17, 23, 25, .9); box-shadow: 0 3px 18px #0005;
  font: 16px/1.45 Tahoma, Verdana, sans-serif; text-align: center;
}
.job-notice[hidden] { display: none; }

@media (max-width: 760px) {
  .program-controls { top: calc(env(safe-area-inset-top) + 8px); right: calc(env(safe-area-inset-right) + 10px); }
  #model-control { max-width: min(58vw, 260px); }
  #engine-model { min-height: 48px; padding: 8px 10px; font-size: 14px; }
  #engine-model small, #engine-model small b { font-size: 12px; }
  .home-button, .show-controls, .title-load { min-height: 48px; padding: 10px 14px; font-size: 15px; }
  .title-load { right: calc(env(safe-area-inset-right) + 12px); bottom: calc(env(safe-area-inset-bottom) + 12px); }
  .show-controls { left: calc(env(safe-area-inset-left) + 12px); bottom: calc(env(safe-area-inset-bottom) + 12px); }
  body[data-scene="world"] .simulation-ui {
    left: calc(env(safe-area-inset-left) + 10px); right: calc(env(safe-area-inset-right) + 10px);
    bottom: calc(env(safe-area-inset-bottom) + 10px); width: auto; max-width: 440px;
  }
  body[data-scene="world"] .simulation-panel { max-height: min(58dvh, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px)); }
  body[data-scene="world"] .simulation-input { min-height: 48px; height: 48px; font-size: 16px; padding: 10px 12px; }
  body[data-scene="world"] .simulation-button, .simulation-menu button, .menu-action,
  .saved-frame, .save-library summary, .menu-caption button { min-height: 44px; font-size: 15px; }
  body[data-scene="world"] .simulation-narrative { max-height: min(24dvh, 190px); font-size: 16px; }
  .scene-menu, .scene-menu[data-menu="load"], .scene-menu[data-menu="models"] {
    left: calc(env(safe-area-inset-left) + 8px); right: calc(env(safe-area-inset-right) + 8px);
    top: auto; bottom: calc(env(safe-area-inset-bottom) + 8px); transform: none;
    width: auto; max-width: 720px; max-height: min(82dvh, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px));
    margin-inline: auto; overflow-y: auto; overscroll-behavior: contain;
    border-radius: 10px 10px 2px 2px; background: rgba(17, 23, 25, .94);
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .menu-caption { position: sticky; top: 0; z-index: 1; min-height: 48px; font-size: 15px; }
  .menu-page { padding: 16px; }
  .menu-page label { font-size: 15px; }
  .menu-page input, .menu-page textarea, .menu-page select { min-height: 48px; padding: 10px 12px; font-size: 16px; }
  .menu-page textarea { min-height: 112px; }
  .model-choice { min-height: 52px; }
  .model-choice strong { font-size: 15px; }
  .model-choice small { font-size: 13px; }
  .model-choice .model-route { font-size: 12px; }
  .menu-note, .model-purpose, .model-pricing-note { font-size: 14px; }
  .model-footer { align-items: stretch; flex-direction: column; }
  .model-footer .menu-action { width: 100%; }
  .job-notice { width: calc(100vw - 24px); }
}

@media (max-height: 500px) and (orientation: landscape) {
  body[data-scene="world"] .simulation-panel { max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px); }
  .scene-menu, .scene-menu[data-menu="load"], .scene-menu[data-menu="models"] { max-height: 92dvh; }
  .menu-page textarea { min-height: 72px; }
}

.nine-home{position:fixed;left:max(16px,env(safe-area-inset-left));top:max(12px,env(safe-area-inset-top));font:12px Georgia,serif;color:#314333;z-index:20;background:#f5f1e8dd;padding:9px 12px;border-radius:3px;text-decoration:none}.nine-allowance{position:fixed;right:max(16px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));z-index:20;font:12px system-ui,sans-serif;color:#314333;background:#f5f1e8dd;padding:9px 12px;border-radius:3px;pointer-events:none}

/* Leave a dedicated row for shared account/navigation on narrow screens. */
body .program-controls{top:calc(env(safe-area-inset-top) + 54px)}
@media(max-width:700px){.nine-home{left:10px;padding:8px 9px;font-size:11px}.nine-allowance{right:10px;padding:8px 9px;font-size:11px}body .program-controls{top:calc(env(safe-area-inset-top) + 49px)}}
#engine-model small{display:flex;gap:6px;min-width:0;white-space:nowrap}
#engine-model small b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#engine-model>span:first-child{min-width:0;flex:1}
#engine-model>span:last-child{flex:0 0 auto}
#engine-model small b{margin-left:0}

/* Canonical beta readability: one landing toolbar, prominent narration. */
body[data-scene="title"] .program-controls {
  left: 50%; right: auto; top: calc(env(safe-area-inset-top) + 58px);
  transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 8px;
  padding: 8px; border: 1px solid #8b806744; border-radius: 8px; background: #f6f2e8ed;
}
.program-controls .title-load {
  position: static; min-height: 44px; padding: 10px 14px; font-size: 15px;
  background: transparent; border-color: #8b806755; white-space: nowrap;
}
body[data-scene="title"] #model-control { max-width: 270px; background: transparent; }
body[data-scene="title"] .home-button { min-height: 44px; }
body[data-scene="world"] .simulation-ui { width: min(420px, calc(100vw - 40px)); }
body[data-scene="world"] .simulation-narrative {
  order: -1; flex: 0 0 auto; padding: 18px 20px; border-top: 0; border-bottom: 1px solid #fff4;
  font: 20px/1.6 Georgia, serif; max-height: min(30dvh, 260px);
  color: #fffaf0; background: #101719ed; text-shadow: none; text-align: left;
}
body[data-scene="world"] .scene-menu:not([data-menu="load"]):not([data-menu="models"]) { left: 452px; }
@media (max-width: 760px) {
  body[data-scene="title"] .program-controls { top: calc(env(safe-area-inset-top) + 48px); gap: 6px; padding: 6px; }
  body[data-scene="title"] #model-control { flex: 1 1 100%; max-width: none; order: -1; }
  body[data-scene="title"] #engine-model { min-height: 44px; padding: 6px 10px; }
  .program-controls .title-load, body[data-scene="title"] .home-button { min-height: 44px; }
  body[data-scene="world"] .simulation-ui { width: auto; }
  body[data-scene="world"] .simulation-narrative { font-size: 19px; line-height: 1.55; padding: 16px; max-height: 28dvh; }
  body[data-scene="world"] .scene-menu:not([data-menu="load"]):not([data-menu="models"]) { left: calc(env(safe-area-inset-left) + 8px); }
}

/* Da Vinci folio: quiet chat by default, instruments on request. */
:root { --folio-paper: #f3eddc; --folio-ink: #30291e; --folio-rule: #aa91634d; --folio-brass: #846831; }
body[data-scene="world"] .simulation-panel, .scene-menu,
.scene-menu[data-menu="load"], .scene-menu[data-menu="models"] {
  color: var(--folio-ink); background: linear-gradient(115deg,#faf6e9f5,#eae0c9f5);
  border: 1px solid #a88e61; border-radius: 5px; text-shadow: none;
  box-shadow: 0 8px 32px #241d1633, inset 0 0 0 4px #faf6e980;
  font-family: Georgia, serif;
}
body[data-scene="world"] .simulation-ui { width: min(520px, calc(100vw - 40px)); }
body[data-scene="world"] .simulation-narrative {
  color: var(--folio-ink); background: transparent; border-color: var(--folio-rule);
  font-weight: 400; padding: 20px 22px; max-height: 30dvh;
}
body[data-scene="world"] .simulation-form { grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 12px 14px; }
body[data-scene="world"] .simulation-input {
  color: var(--folio-ink); -webkit-text-fill-color: var(--folio-ink); background: #fffaf066 !important;
  border: 0; border-bottom: 1px solid #9c8456; border-radius: 0;
  font: 17px/1.5 Georgia,serif; height: 46px; min-height: 46px;
}
body[data-scene="world"] .simulation-input::placeholder { color: #786b53; }
body[data-scene="world"] .simulation-button, .simulation-menu button, .menu-action {
  color: var(--folio-ink); text-shadow: none; font: 16px/1.45 Georgia,serif;
  min-height: 44px; border-color: var(--folio-rule); padding: 10px 12px;
}
body[data-scene="world"] #simulation-submit { width: auto; justify-content: center; gap: 10px; border: 1px solid #a58b57; border-radius: 3px; background: #e1d0a455; }
body[data-scene="world"] .simulation-button::before { content: none; }
.advanced-tools { border-top: 1px solid var(--folio-rule); padding: 0 14px 6px; }
.advanced-tools summary { list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 40px; cursor: pointer; color: #77603a; font: 14px Georgia,serif; letter-spacing: .04em; }
.advanced-tools summary::-webkit-details-marker { display: none; }
.advanced-tools[open] summary span { transform: rotate(45deg); }
.advanced-tools summary:focus-visible { outline: 2px solid var(--folio-brass); outline-offset: 2px; }
.advanced-tools .simulation-menu { padding: 0; }
.advanced-tools .menu-caption { border: 0; background: transparent; color: #786b53; padding: 4px 0; }
.advanced-tools .world-help { display: none; }
body[data-scene="world"] .scene-menu:not([data-menu="load"]):not([data-menu="models"]) { left: 552px; }
.scene-menu .menu-caption { background: #d7c49d55; border-color: var(--folio-rule); color: var(--folio-ink); font: 17px Georgia,serif; min-height: 48px; }
.scene-menu .menu-caption button { min-width: 44px; min-height: 44px; font-size: 24px; }
.scene-menu .menu-page label, .model-columns legend { color: #72582c; font-family: Georgia,serif; }
.scene-menu input, .scene-menu textarea, .scene-menu select {
  color: var(--folio-ink); -webkit-text-fill-color: var(--folio-ink); background: #fffbef;
  border-color: #ad9668; color-scheme: light; font: 16px/1.5 Georgia,serif;
}
.scene-menu .menu-note, .model-purpose, .model-pricing-note,
.scene-menu .model-choice small, .scene-menu .model-choice .model-route,
.save-library summary small, .saved-frame small { color: #72644d; }
.scene-menu .model-choice { color: var(--folio-ink); border-color: var(--folio-rule); }
.scene-menu .model-choice:has(input:checked) { border-color: #9b7c3e; background: #d8bd7833; }
.scene-menu .model-choice input { accent-color: #846831; }
.saved-frame { color: var(--folio-ink); background: #f8f2e4; border-color: var(--folio-rule); font: 15px/1.5 Georgia,serif; }
.save-library details, .model-footer { border-color: var(--folio-rule); }
body[data-scene="title"] #model-control { width: auto; min-width: 100px; }
body[data-scene="title"] #engine-model { min-height: 44px; font: 15px Georgia,serif; }
.program-controls .title-load, .home-button, .show-controls, body[data-scene="world"] .home-button {
  color: var(--folio-ink); background: #f3eddcf0; border: 1px solid #aa9163;
  font-family: Georgia,serif; text-shadow: none; box-shadow: none;
}
.nine-home, .nine-allowance { color: #625031; background: #f3eddce8; font-family: Georgia,serif; }
body[data-scene="world"] .world-stamp { display: none; }
@media(max-width: 940px) { body[data-scene="world"] .scene-menu:not([data-menu="load"]):not([data-menu="models"]) { left: 10px; bottom: 10px; max-width: calc(100vw - 20px); } }
@media(max-width: 760px) {
  body[data-scene="world"] .simulation-ui { width: auto; max-width: 520px; }
  body[data-scene="world"] .simulation-narrative { font-size: 19px; padding: 16px 18px; }
  body[data-scene="title"] #model-control { flex: 0 1 auto; order: 0; }
  body[data-scene="title"] .program-controls { flex-wrap: nowrap; }
  body[data-scene="title"] #engine-model, .program-controls .title-load, body[data-scene="title"] .home-button { padding: 8px 10px; font-size: 14px; }
}

/* A brief acknowledgement; generation continues without a central overlay. */
.job-notice { top: calc(env(safe-area-inset-top) + 52px); left: max(12px,env(safe-area-inset-left)); right: auto; width: auto; max-width: calc(100vw - 24px); transform: none; padding: 10px 14px; color: #4c3d25; background: #f3eddcf2; border: 1px solid #aa9163; font: 15px/1.4 Georgia,serif; text-align: left; animation: frame-notice 2.6s ease both; }
@keyframes frame-notice { 0% { opacity: 0; transform: translateY(-5px); } 12%,72% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-3px); } }
.speaker-label { grid-column: 1 / -1; color: #79623a; font: 13px Georgia,serif; letter-spacing: .04em; }
body[data-scene="world"] .simulation-narrative::before { content: "The Engine"; display: block; margin-bottom: 8px; color: #79623a; font: 13px Georgia,serif; letter-spacing: .04em; }
@media(prefers-reduced-motion:reduce) { .job-notice { animation: none; } }

/* Keep an expanded instrument card below the shared account controls on short screens. */
@media (max-height: 500px) and (orientation: landscape) {
  body[data-scene="world"] #simulation-ui:has(#advanced-tools[open]) {
    top: calc(env(safe-area-inset-top) + 96px);
    bottom: calc(env(safe-area-inset-bottom) + 10px);
    left: 50%;
    right: auto;
    width: min(520px, calc(100vw - 20px));
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
  }
  body[data-scene="world"] #simulation-ui:has(#advanced-tools[open]) .simulation-panel {
    width: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
  }
  body[data-scene="world"] .scene-menu[data-menu="load"] {
    top: calc(env(safe-area-inset-top) + 96px);
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(env(safe-area-inset-bottom) + 10px);
    left: max(10px, env(safe-area-inset-left));
    width: auto;
    max-height: none;
    margin-inline: auto;
    transform: none;
    overflow-y: auto;
  }
}

/* On portrait phones, leave the full landscape artwork visible above the controls. */
@media (max-width: 760px) and (orientation: portrait) {
  html[data-prairie-landscape-frame="true"] body[data-scene="world"] .simulation-narrative {
    max-height: max(60px, min(30dvh, calc(100dvh - 96px - var(--prairie-landscape-image-height) - 162px)));
    overflow-y: auto;
  }
}

/* Earlier folio menu layout, overridden by the central frame below. */
#landing-menu{position:fixed;top:30px;left:32px;right:32px;display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px 20px;z-index:20;font:14px Georgia,serif}#landing-menu button,#landing-menu a{font:inherit;background:none;border:0;color:#4a443a;text-decoration:none;padding:8px 0;cursor:pointer}.core-dialog{color:#232019;background:#f6f2e8;border:1px solid #a89a7c;border-radius:3px;width:min(480px,calc(100% - 48px));max-height:calc(100dvh - 64px);padding:30px;box-shadow:0 12px 80px #302a2022}.core-dialog::backdrop{background:#f6f2e877}.core-dialog h2{font:28px Georgia,serif;margin-top:32px}.core-dialog input{width:100%;padding:14px;margin:12px 0;font:24px monospace;letter-spacing:.12em;background:#fffaf0;border:1px solid #a89a7c}.core-close{display:block;margin-left:auto;background:none;border:0;color:#4a443a;cursor:pointer;padding:8px;font:14px Georgia,serif}.retail-dialog{width:min(1120px,calc(100% - 64px));height:calc(100dvh - 80px);padding:12px}.retail-dialog iframe{display:block;border:0;width:100%;height:calc(100% - 38px)}body[data-scene="world"] #landing-menu{display:none}@media(max-width:600px){#landing-menu{top:20px;left:24px;right:24px;justify-content:center;gap:2px 16px;font-size:13px}.core-dialog{padding:18px}.retail-dialog{width:calc(100% - 32px);height:calc(100dvh - 40px);max-height:calc(100dvh - 40px);padding:6px}}

/* The menu frame is the space between the title's tagline and gears. */
:root{--menu-left:50%;--menu-top:50%;--menu-width:0px;--menu-height:0px}
#landing-menu{position:fixed;left:var(--menu-left);top:var(--menu-top);right:auto;width:var(--menu-width);height:var(--menu-height);display:grid;grid-template-columns:1fr 1fr;align-content:center;gap:0 26px;padding:8px 6px;font:17px Georgia,serif;visibility:hidden;overflow:auto}
body[data-landing-ready] #landing-menu{visibility:visible}
#landing-menu button,#landing-menu a{display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;min-height:49px;padding:12px 5px;border-bottom:1px solid #a89a7c66;letter-spacing:.015em}
#landing-menu button:hover,#landing-menu a:hover{color:#7a5c2e;background:#8a7a5c09}
#landing-back{position:fixed;left:var(--menu-left);top:calc(var(--menu-top) + var(--menu-height) - 32px);z-index:25;border:0;background:none;color:#8a7a5c;font:14px Georgia,serif;cursor:pointer;padding:8px}
body[data-landing="entry"] #landing-menu,body[data-scene="world"] #landing-menu,body[data-scene="world"] #landing-back{display:none}
body:not([data-landing="entry"]) #title-help{visibility:hidden}
body[data-scene="title"] .program-controls{display:none!important}
.core-dialog,.retail-dialog,body[data-scene="title"] .scene-menu{position:fixed;inset:auto;left:var(--menu-left);top:var(--menu-top);width:var(--menu-width);height:var(--menu-height);max-width:none;max-height:var(--menu-height);margin:0;transform:none;padding:8px 6px;border:0;border-radius:0;box-shadow:none;background:#f6f2e8;overflow:auto}
.core-dialog::backdrop{background:transparent}
.core-dialog h2{font:24px Georgia,serif;margin:0 0 8px}.core-dialog p{margin:8px 0;font-size:14px}.core-dialog input{font-size:19px;padding:9px;margin:6px 0;max-width:280px;display:block}.core-close{padding:4px 0 8px;font-size:13px}
.retail-dialog{overflow:hidden}.retail-dialog iframe{height:calc(100% - 28px)}
@media(max-width:600px){#landing-menu{font-size:15px;gap:0 18px;padding:0}#landing-menu button,#landing-menu a{min-height:48px}.core-dialog,.retail-dialog{padding:4px 0}}

/* Fixed original title/gears; controls compress into the measured existing gap. */
#landing-menu{grid-template-columns:repeat(3,minmax(0,1fr));gap:0 16px;padding:0 4px;font-size:14px;align-content:center}
#landing-menu button,#landing-menu a{min-height:32px;padding:7px 3px;gap:5px;font-size:inherit;line-height:1.2}
.core-dialog,.retail-dialog,body[data-scene="title"] .scene-menu{padding:0 4px}
.core-close{font-size:12px;padding:0 0 4px;line-height:18px}
.retail-dialog iframe{height:calc(100% - 22px)}
#access-form{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 10px}
#access-form .core-close{grid-column:2;grid-row:1}#access-form h2{grid-column:1;grid-row:1;font-size:17px;margin:0}
#access-form>p:first-of-type{display:none}#access-form label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#access-form input{grid-column:1;grid-row:2;width:100%;max-width:none;min-width:0;font-size:16px;padding:5px 8px;margin:0;height:32px}
#access-form .primary-button{grid-column:2;grid-row:2;min-height:32px;padding:5px 10px;font:13px Georgia,serif;background:transparent;color:#232019;border:1px solid #a89a7c;box-shadow:none}
#access-form [data-retail]{grid-column:1;grid-row:3;width:max-content;background:none;border:0;padding:3px 0;color:#8a7a5c;font:12px Georgia,serif}
#access-status{grid-column:1/-1;margin:0!important;font-size:12px!important}#access-status:empty{display:none}
@media(max-width:600px){#landing-menu{grid-template-columns:1fr 1fr;gap:0 16px;font-size:14px}#landing-menu button,#landing-menu a{min-height:36px;padding:8px 2px}#access-form h2{font-size:16px}}

/* One direct code entry, two secondary choices; the surrounding frame stays fixed. */
#landing-menu{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;padding:0 4px;overflow:auto}
#landing-code-form{width:min(390px,100%);margin:0;text-align:center}
#landing-code{width:100%;height:35px;padding:2px 8px 5px;border:0;border-bottom:1px solid #a89a7c;border-radius:0;background:transparent;color:#232019;text-align:center;font:24px/1.2 Georgia,serif;letter-spacing:.18em;outline-offset:3px}
#landing-code::placeholder{color:#a3967c;opacity:1}
#landing-code-status{margin:3px 0 0;color:#8a7a5c;font:11px/1.3 Georgia,serif;min-height:14px}
#landing-menu .landing-links{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:5px 22px}
#landing-menu .landing-links button{border:0;min-height:24px;padding:4px 0;font:12px Georgia,serif;color:#76664c;letter-spacing:0}
@media(max-width:600px){#landing-code-form{width:min(280px,100%)}#landing-code{height:40px;font-size:25px}#landing-menu{gap:8px}#landing-menu .landing-links button{min-height:30px;font-size:13px}}

/* One small purchase entrance; retain the original hover/focus help. */
#landing-menu .landing-links #get-a-code{border:1px solid #a89a7c99;border-radius:3px;padding:3px 12px;min-height:25px;font-size:12px;background:transparent;color:#76664c}
#landing-menu .landing-links #get-a-code:hover{background:#8a7a5c10}
body[data-scene="title"] #title-help{visibility:visible}

#landing-menu{pointer-events:none}#landing-menu form,#landing-menu .landing-links{pointer-events:auto}

/* Public entry: Get a code, code field, then the existing help at the right. */
body[data-scene="title"] #landing-menu:has(#landing-code-form:not([hidden])){display:grid;grid-template-columns:90px minmax(0,390px);justify-content:center;align-content:center;align-items:start;column-gap:14px;row-gap:0;padding-right:48px}
#landing-code-form{grid-column:2;grid-row:1;width:100%}
#landing-menu:has(#landing-code-form:not([hidden])) .landing-links{grid-column:1;grid-row:1;align-self:start;padding-top:5px}
#landing-menu .landing-links #get-a-code{white-space:nowrap}
@media(max-width:600px){body[data-scene="title"] #landing-menu:has(#landing-code-form:not([hidden])){grid-template-columns:77px minmax(0,1fr);column-gap:8px;padding-right:40px}#landing-code-form{width:100%;min-width:0}#landing-code{font-size:21px;letter-spacing:.08em;padding-inline:0}#landing-menu .landing-links #get-a-code{padding-inline:7px;font-size:11px}#landing-menu:has(#landing-code-form:not([hidden])) .landing-links{padding-top:8px}#landing-code-status{font-size:10px}}

/* Quiet, integrated entry controls in the fixed landing frame. */
body[data-scene="title"] #landing-menu:has(#landing-code-form:not([hidden])){grid-template-columns:100px minmax(0,350px);column-gap:22px}
#landing-menu .landing-links #get-a-code{border:0;border-radius:0;box-shadow:none;background:transparent;padding:7px 0;min-height:35px;font:italic 14px Georgia,serif;color:#8a7a5c;letter-spacing:.01em;transition:color .18s ease}
#landing-menu .landing-links #get-a-code::after{content:'↗';font-style:normal;font-size:12px;margin-left:7px;opacity:.55;transition:opacity .18s ease,transform .18s ease}
#landing-menu .landing-links #get-a-code:hover{background:transparent;color:#4a443a}
#landing-menu .landing-links #get-a-code:hover::after{opacity:1;transform:translate(1px,-1px)}
#landing-menu:has(#landing-code-form:not([hidden])) .landing-links{padding-top:0}
#landing-code{border-bottom:1px solid #a89a7c88;color:#4a443a;font-size:23px;letter-spacing:.13em}
#landing-code::placeholder{color:#aa9e86}
#landing-code-status{color:#a3967c;font-size:10px;letter-spacing:.015em;margin-top:5px}
body[data-scene="title"] .help-button{box-shadow:none;background:transparent;border:1px solid #a89a7c88;color:#8a7a5c;width:30px;height:30px;min-width:30px;font-size:19px;transition:border-color .18s ease,color .18s ease}
body[data-scene="title"] .help-button:hover{color:#4a443a;border-color:#8a7a5c}
@media(max-width:600px){body[data-scene="title"] #landing-menu:has(#landing-code-form:not([hidden])){grid-template-columns:82px minmax(0,1fr);column-gap:11px}#landing-menu .landing-links #get-a-code{font-size:12px;padding:8px 0;min-height:40px}#landing-menu .landing-links #get-a-code::after{font-size:10px;margin-left:4px}#landing-code{font-size:21px;letter-spacing:.08em}}
@media(prefers-reduced-motion:reduce){#landing-menu .landing-links #get-a-code,#landing-menu .landing-links #get-a-code::after,body[data-scene="title"] .help-button{transition:none}}

/* Reduce only the purchase button; preserve the established entry and help sizes. */
#landing-menu .landing-links #get-a-code{font-size:11px}
#landing-menu .landing-links #get-a-code::after{font-size:9px;margin-left:3px}
@media(max-width:600px){#landing-menu .landing-links #get-a-code{font-size:10px}}

.about-dialog{overflow:auto}.about-copy{max-width:520px;margin:0 auto;padding:0 4px 8px}.about-copy h2{font-size:18px}.about-copy p{font:13px/1.5 Georgia,serif;color:#76664c}.about-copy button{border:0;background:transparent;color:#8a7a5c;font:italic 11px Georgia,serif;padding:4px 0}

#title-help-card a{display:inline-block;margin-top:8px;color:#8a7a5c;font:italic 12px Georgia,serif;text-underline-offset:3px}

/* Public entry spans the first P through the final E of the rendered wordmark. */
body[data-scene="title"] #landing-menu:has(#landing-code-form:not([hidden])){left:var(--entry-left,var(--menu-left));width:var(--entry-width,var(--menu-width));grid-template-columns:100px minmax(0,1fr);column-gap:22px;padding:0 44px 0 0}
#landing-menu:has(#landing-code-form:not([hidden])) .landing-links{justify-content:flex-start;width:100%}
#landing-menu .landing-links #get-a-code{border:1px solid #a89a7c99;border-radius:3px;padding:7px 10px;width:100%;justify-content:center;gap:4px}
@media(max-width:600px){body[data-scene="title"] #landing-menu:has(#landing-code-form:not([hidden])){grid-template-columns:75px minmax(0,1fr);column-gap:10px;padding:0 40px 0 0}#landing-menu .landing-links #get-a-code{padding:8px 5px}#landing-code{font-size:16px;letter-spacing:.06em}}

#session-actions{position:fixed;left:max(20px,env(safe-area-inset-left));top:max(18px,env(safe-area-inset-top));z-index:30;display:flex;align-items:center;gap:10px;max-width:calc(100vw - 190px);font:12px Georgia,serif;color:#625031}#session-actions button{font:inherit;color:inherit;background:#f3eddce8;border:1px solid #a89a7c;border-radius:3px;padding:8px 12px;cursor:pointer}#session-actions button[hidden]{display:none}#session-status{max-width:230px}#session-actions button:focus-visible{outline:2px solid #765b2e;outline-offset:3px}@media(max-width:600px){#session-actions{left:12px;top:12px;gap:6px;flex-wrap:wrap;max-width:calc(100vw - 140px)}#session-status{flex-basis:100%;font-size:11px}}

/* Embedded Stripe remains in the measured grass slot and scrolls within it. */
#stripe-checkout{width:100%;height:calc(100% - 28px);overflow:auto;overscroll-behavior:contain;min-width:0;max-width:100%}
#stripe-checkout[hidden],#retail-frame[hidden]{display:none}
#stripe-checkout iframe{min-height:520px;height:auto;max-width:100%}
#stripe-checkout-status{max-width:100%;overflow-wrap:anywhere}

/* Reserve the help column even when the authenticated entry form is hidden. */
body[data-scene="title"] #landing-menu:not(:has(#landing-code-form:not([hidden]))){box-sizing:border-box;padding-inline:4px 42px}
body[data-scene="title"] #landing-menu .landing-links{min-width:0;max-width:100%}
body[data-scene="title"] #landing-menu .landing-links button{max-width:100%}
.core-dialog img,.scene-menu img{max-width:100%;height:auto}

/* A title submenu owns the central slot until it closes. */
body[data-scene="title"]:has(#scene-menu:not([hidden])) #landing-menu,
body[data-scene="title"]:has(#scene-menu:not([hidden])) #title-help { visibility:hidden; pointer-events:none; }

/* October 5: visible entry and menu, without an inner scrolling strip. */
body[data-scene="title"] #landing-menu,
body[data-scene="title"] #landing-menu:has(#landing-code-form:not([hidden])) {
  left:var(--menu-left); top:var(--menu-top); width:var(--menu-width); height:var(--menu-height);
  display:flex; flex-direction:column; justify-content:center; align-items:center;
  gap:12px; padding:0 42px 0 4px; box-sizing:border-box; overflow:visible;
}
body[data-scene="world"] #landing-menu,body[data-landing="entry"] #landing-menu { display:none !important; }
#landing-code-form { width:100%; max-width:420px; margin:0; flex:0 0 auto; }
.entry-label { display:block; margin-bottom:5px; text-align:left; font:12px Georgia,serif; color:#76664c; }
.code-entry-row { display:flex; align-items:center; gap:12px; }
#landing-code { flex:1; min-width:0; height:40px; font-size:21px; }
#landing-menu #landing-connect { flex:0 0 auto; display:block; min-height:40px; padding:8px 16px; border:1px solid #a89a7c; border-radius:3px; font:14px Georgia,serif; background:#f3eddc88; }
#landing-code-status { min-height:15px; margin:5px 0 0; font:11px/1.3 Georgia,serif; }
body[data-scene="title"] #landing-menu .landing-links,
#landing-menu:has(#landing-code-form:not([hidden])) .landing-links {
  flex:0 0 auto; display:flex; flex-wrap:wrap; width:auto; max-width:100%; padding:0;
  justify-content:center; align-self:center; align-items:center; gap:4px 20px;
}
#landing-menu .landing-links button { flex:0 0 auto; width:auto; min-height:32px; font:13px Georgia,serif; padding:6px 0; }
#landing-menu .landing-links #get-a-code { width:auto; min-height:32px; padding:6px 0; border:0; font:italic 12px Georgia,serif; }
#landing-menu .landing-links #get-a-code::after { content:none; }
#session-actions { left:max(20px,env(safe-area-inset-left)); right:max(20px,env(safe-area-inset-right)); top:max(18px,env(safe-area-inset-top)); max-width:none; min-height:34px; flex-wrap:nowrap; gap:12px; pointer-events:none; }
#session-actions button { pointer-events:auto; flex:0 0 auto; }
#session-status { min-width:0; max-width:min(420px,45vw); font-size:11px; }
#session-actions .nine-allowance { position:static; margin-left:auto; flex:0 0 auto; min-width:112px; padding:8px 0 8px 12px; background:transparent; border-radius:0; text-align:right; white-space:nowrap; font:12px Georgia,serif; font-variant-numeric:tabular-nums; }
#session-actions .nine-allowance[hidden] { display:none; }
@media(max-width:600px) {
  body[data-scene="title"] #landing-menu:has(#landing-code-form:not([hidden])) { padding:0 36px 0 0; gap:10px; }
  #landing-menu .landing-links { gap:2px 14px; }
  #landing-menu .landing-links button { font-size:12px; min-height:32px; }
  #landing-menu #landing-connect { padding:8px 10px; }
  #landing-code { font-size:18px; letter-spacing:.08em; }
  #session-actions { left:16px; right:16px; top:12px; gap:8px; }
  #session-status:not(:empty) { position:absolute; top:42px; left:0; max-width:calc(100vw - 32px); background:#f6f2e8ed; padding:4px 6px; }
  #session-actions .nine-allowance { font-size:11px; padding-left:4px; min-width:104px; }
}

/* The fitted GSE-1 runs within the original Prairie Engine shell. */
[data-menu="models"],#model-control { display:none!important; }
.job-notice { animation:none; pointer-events:none; }
#landing-code-form[hidden] { display:none; }

/* GSE frames already paint their narration. Keep the accessible transcript,
   and place live controls outside the complete, unaltered image. */
body[data-scene="world"] { --world-header: 60px; --world-composer: 72px; background: #10191e; }
body[data-scene="world"] .engine-stage { background: #10191e; }
body[data-scene="world"] .engine-frame {
  top: var(--world-header); bottom: var(--world-composer);
  height: calc(100% - var(--world-header) - var(--world-composer));
}
body[data-scene="world"] .program-controls { display: none; }
body[data-scene="world"] #simulation-ui,
body[data-scene="world"] #simulation-ui:has(#advanced-tools[open]) {
  inset: auto 0 0; width: 100%; max-width: none; height: var(--world-composer);
  transform: none; overflow: visible; display: block;
}
body[data-scene="world"] #simulation-ui[hidden] { display: none; }
body[data-scene="world"] #simulation-ui .simulation-panel {
  position: relative; display: flex; flex-direction: row; align-items: center;
  width: 100%; height: 100%; max-height: none; overflow: visible;
  gap: 12px; padding: 10px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  border: 0; border-top: 1px solid #52616a; border-radius: 0;
  background: #10191e; box-shadow: none; backdrop-filter: none;
}
body[data-scene="world"] .simulation-form {
  flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto;
  gap: 8px; padding: 0; margin: 0;
}
body[data-scene="world"] .simulation-input {
  height: 44px; min-height: 44px; padding: 8px 12px;
  font: 17px Georgia, serif; border: 1px solid #74818a;
  background: #1e2b33 !important; color: #fff5df; -webkit-text-fill-color: #fff5df;
}
body[data-scene="world"] .simulation-input::placeholder { color: #d1cbbb; }
body[data-scene="world"] #simulation-submit {
  min-height: 44px; margin: 0; padding: 8px 14px;
  color: #fff5df; background: #263740; border: 1px solid #74818a;
}
body[data-scene="world"] .speaker-label,
body[data-scene="world"] #simulation-narrative {
  position: absolute; width: 1px; height: 1px; min-height: 0; max-height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
body[data-scene="world"] #simulation-narrative::before { content: none; }
body[data-scene="world"] .advanced-tools { position: relative; flex: 0 0 72px; border: 0; padding: 0; }
body[data-scene="world"] .advanced-tools summary { color: #fff5df; min-height: 44px; gap: 8px; }
body[data-scene="world"] .advanced-popover {
  position: absolute; right: 0; bottom: calc(100% + 14px);
  width: min(310px, calc(100vw - 28px)); max-height: calc(100dvh - 160px);
  overflow: auto; padding: 12px; background: #f6f2e8;
  border: 1px solid #a89a7c; box-shadow: 0 6px 28px #0005;
}
body[data-scene="world"] .scene-menu:not([hidden]) {
  inset: auto 14px calc(var(--world-composer) + 14px) auto;
  width: min(460px, calc(100vw - 28px)); max-height: calc(100dvh - 145px);
  transform: none; overflow: auto;
}
body[data-scene="world"] .show-controls { bottom: 14px; }
@media (max-width: 500px) {
  body[data-scene="world"] #simulation-ui .simulation-panel { gap: 8px; padding-inline: 8px; }
  body[data-scene="world"] .advanced-tools { flex-basis: 60px; }
  body[data-scene="world"] #simulation-submit { padding-inline: 10px; }
}

body[data-scene="world"] #simulation-ui:has(#advanced-tools[open]) .simulation-panel { overflow: visible; max-height: none; }

/* Uncluttered gameplay: artwork plus one compact action row. */
body[data-scene="world"] { --world-header: 0px; --world-composer: 58px; }
body[data-scene="world"] #simulation-ui .simulation-panel { padding-block: 6px; border-color: #35424a; }
body[data-scene="world"] .simulation-input { border: 0; background: transparent !important; font: 16px/1.4 Georgia,serif; }
body[data-scene="world"] #simulation-submit { width: 40px; padding: 0; font: 24px/1 sans-serif; background: transparent; border: 0; }
body[data-scene="world"] .advanced-tools summary { font: 14px Georgia,serif; }
body[data-scene="world"] #session-actions {
  position: static; display: flex; flex-direction: column; align-items: stretch;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid #c9bea8;
  gap: 4px; pointer-events: auto; min-height: 0;
}
body[data-scene="world"] #session-actions button { text-align: left; box-shadow: none; border: 0; background: transparent; padding: 9px 12px; font: 15px Georgia,serif; }
body[data-scene="world"] #session-actions button[hidden] { display: none; }
body[data-scene="world"] #session-actions .nine-allowance { margin: 0; padding: 6px 12px; text-align: left; color: #72644d; font-size: 13px; }
body[data-scene="world"] #session-status { position: static; max-width: none; background: transparent; padding: 0 12px; color: #7e302b; }
body[data-scene="world"] .scene-transcript { border-top: 1px solid #d4c9b0; margin-top: 8px; }
body[data-scene="world"] .scene-transcript summary { color: #544b3c; min-height: 40px; font: 15px Georgia,serif; cursor: pointer; }
body[data-scene="world"] #scene-transcript-text { color: #302b23; font: 15px/1.5 Georgia,serif; white-space: pre-wrap; }
body[data-scene="world"] .job-notice {
  position: fixed; top: auto; left: 18px; right: 108px; bottom: 0;
  height: var(--world-composer); display: flex; align-items: center;
  padding: 0; margin: 0; background: transparent; border: 0; box-shadow: none;
  transform: none; color: #c4cecF; font: 14px Georgia,serif;
}
body[data-scene="world"] .job-notice[hidden] { display: none; }
body[data-scene="world"][data-turn-pending="true"] .simulation-form { visibility: hidden; }
#world-turn-alert:empty { display: none; }
#world-turn-alert { position: fixed; z-index: 600; bottom: 60px; left: 14px; right: 14px; margin: 0; padding: 8px 12px; color: #f4ddd5; background: #392d29; font: 14px Georgia,serif; }
body[data-scene="title"] #world-turn-alert { display: none; }

/* Recovery remains outside the inert application after an actual outage. */
body[data-scene="world"] #session-actions-home #session-actions { position: fixed; z-index: 700; inset: auto 14px 100px auto; width: min(320px, calc(100vw - 28px)); margin: 0; padding: 10px; background: #f6f2e8; border: 1px solid #a89a7c; }

/* Direct word entry and a paged Save / Load panel. */
#landing-seed-form { width:min(480px,100%); margin:0; }
#landing-seed-form[hidden] { display:none; }
#landing-seed-form label { display:block; margin-bottom:9px; color:#756348; font:15px Georgia,serif; }
.seed-entry-row { display:flex; gap:10px; align-items:stretch; }
#landing-seed { min-width:0; flex:1; height:52px; padding:10px 14px; border:1px solid #a89a7c; border-radius:6px; background:#fffaf080; color:#302b23; font:23px Georgia,serif; }
#landing-seed::placeholder { color:#a3967c; }
#landing-start { min-height:52px; padding:10px 18px; border:1px solid #8c754b; border-radius:6px; background:#ebe1c9; color:#433923; font:16px Georgia,serif; white-space:nowrap; }
#landing-menu:has(#landing-seed-form:not([hidden])) { gap:12px; padding:0!important; }
#landing-menu .landing-links .save-chip,.save-chip { display:inline-flex; flex:0 0 auto; width:42px; height:38px; align-items:center; justify-content:center; padding:7px; border:1px solid #a89a7c; border-radius:7px; background:#f6f2e8; color:#5b4d35; cursor:pointer; }
.save-chip svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.save-chip:hover { background:#e8dfcb; }
.save-chip:focus-visible { outline:2px solid #8c754b; outline-offset:3px; }
body[data-scene="world"] .save-chip { border-color:#52616a; color:#d1d8d8; background:transparent; }
body[data-scene] .scene-menu[data-menu="load"],body[data-scene] .scene-menu[data-menu="save"] { position:fixed; inset:auto; top:50%; left:50%; bottom:auto; width:min(520px,calc(100vw - 28px)); height:auto; max-height:none; transform:translate(-50%,-50%); padding:16px; border:1px solid #a89a7c; border-radius:10px; background:#f6f2e8; box-shadow:0 12px 40px #0004; overflow:visible; z-index:650; }
.library-tabs { display:flex; gap:6px; margin:8px 0 12px; }
.library-tabs[hidden] { display:none; }
.library-tabs button { flex:1; min-height:34px; border:1px solid #c9bea8; border-radius:5px; background:transparent; color:#625338; font:15px Georgia,serif; }
.library-tabs button[aria-expanded="true"] { background:#e8dfcb; border-color:#a89a7c; }
.library-tabs button:disabled { opacity:.4; cursor:default; }
#load-page .menu-note { margin:0 0 8px; font-size:12px; line-height:1.4; }
#save-library-status { margin:0 0 8px; font:13px Georgia,serif; color:#756348; }
#save-library { gap:6px; }
#save-library .saved-frame { display:block; width:100%; min-height:50px; margin:0; padding:8px 11px; border:1px solid #d4c9b0; border-radius:5px; background:#fffaf060; text-align:left; }
#save-library .saved-frame strong,#save-library .saved-frame small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#save-library .saved-frame strong { font:15px/1.3 Georgia,serif; color:#433923; }
#save-library .saved-frame small { margin-top:3px; font:12px/1.3 Georgia,serif; }
.library-back { justify-self:start; padding:3px 0 7px; background:transparent; border:0; color:#625338; }
.library-pager { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-top:5px; font:12px Georgia,serif; }
.library-pager button { padding:6px 8px; background:transparent; border:1px solid #c9bea8; border-radius:4px; color:#625338; }
.library-pager button:disabled { opacity:.35; }
#load-page #export-gse { margin-top:10px; min-height:28px; padding:5px 0; font-size:12px; }
@media(max-height:560px) { body[data-scene] .scene-menu[data-menu="load"],body[data-scene] .scene-menu[data-menu="save"] { padding:10px 14px; } .library-tabs { margin:6px 0 8px; } #save-library .saved-frame { min-height:44px; padding:6px 10px; } }
@media(max-width:500px) { #landing-seed-form label { font-size:14px; } #landing-seed { font-size:20px; padding-inline:10px; } #landing-start { padding-inline:12px; font-size:14px; } }

#landing-menu #landing-start { min-height:52px; padding:10px 18px; border:1px solid #8c754b; border-radius:6px; background:#ebe1c9; color:#433923; font:16px Georgia,serif; }
@media(max-width:500px) { #landing-menu #landing-start { padding-inline:12px; font-size:14px; } }

body[data-scene] .scene-menu:is([data-menu="load"],[data-menu="save"]) .menu-page { padding:0; }
body[data-scene] .scene-menu:is([data-menu="load"],[data-menu="save"]) .menu-caption { min-height:32px; padding:4px 8px; }
body[data-scene] .scene-menu:is([data-menu="load"],[data-menu="save"]) .menu-caption h2 { margin:0; font-size:18px; }
@media(max-height:450px) { #load-page .menu-note { display:none; } #save-library .saved-frame { min-height:40px; } .library-tabs { margin:4px 0 6px; } #load-page #export-gse { margin:6px 0 0; } }

/* Frame progression stays in the existing action row; the world keeps its full height. */
body[data-scene="world"] .frame-history { display:flex; align-items:center; gap:2px; flex:0 0 auto; }
body[data-scene="world"] .frame-history[hidden] { display:none; }
.frame-history button { display:inline-flex; align-items:center; justify-content:center; width:36px; height:42px; min-height:42px; padding:0; border:1px solid transparent; border-radius:5px; background:transparent; color:#c8d2d4; font:21px/1 sans-serif; cursor:pointer; }
.frame-history #frame-position { width:auto; min-width:40px; padding-inline:3px; font:12px/1 Georgia,serif; font-variant-numeric:tabular-nums; white-space:nowrap; }
.frame-history button:hover:not(:disabled) { background:#23333b; border-color:#536772; color:#fff5df; }
.frame-history button:disabled { color:#63737b; cursor:default; }
.frame-history #frame-position:disabled { color:#a9b7ba; }
.frame-history button:focus-visible { outline:2px solid #bd9f69; outline-offset:1px; }
.frame-history-status { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
body[data-scene="world"] .simulation-input { border:1px solid #647780; border-radius:5px; background:#192830 !important; font:17px/1.4 Georgia,serif; box-shadow:inset 0 1px 2px #0002; }
body[data-scene="world"] .simulation-input::placeholder { color:#e5dfcf; opacity:1; }
body[data-scene="world"] .simulation-input:focus { outline:2px solid #b49a6a; outline-offset:1px; border-color:#b49a6a; }
body[data-scene="world"] .simulation-input[readonly] { color:#a9b7ba; -webkit-text-fill-color:#a9b7ba; border-color:#3f525c; }
@media(max-width:600px) {
 body[data-scene="world"] #simulation-ui .simulation-panel { gap:5px; padding-inline:7px; }
 body[data-scene="world"] .simulation-form { gap:3px; }
 body[data-scene="world"] .simulation-input { padding-inline:8px; font-size:15px; }
 body[data-scene="world"] .frame-history { gap:0; }
 .frame-history button { width:30px; }
 .frame-history #frame-position { display:none; }
 body[data-scene="world"] .save-chip { width:34px; padding:5px; }
 body[data-scene="world"] #simulation-submit { width:30px; }
}

/* The first-world waiting room: a quiet loading bar and the playable machine. */
.world-loading[hidden] { display: none; }
.world-loading { position: absolute; inset: 0; z-index: 40; display: grid; grid-template-columns: 1fr 1fr; background: #f6f2e8; color: #232019; }
.world-loading-info { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: clamp(24px, 4vw, 64px); background: radial-gradient(90% 70% at 22% 12%, #8a7a5c0f, transparent 60%), repeating-linear-gradient(93deg, #23201904 0 1px, transparent 1px 7px), #f6f2e8; }
.world-loading-brand { text-align: center; width: 100%; font-family: "Hoefler Text", "Iowan Old Style", Baskerville, "Palatino", "Book Antiqua", Georgia, serif; }
.world-loading-brand img { display: block; width: clamp(74px, 8vw, 118px); height: auto; margin: 0 auto 24px; }
.world-loading-brand h1 { margin: 0; color: #232019; font-size: clamp(25px, 2.8vw, 44px); font-weight: 500; letter-spacing: .14em; line-height: 1.1; text-transform: uppercase; white-space: nowrap; }
#world-loading-phase { margin: 35px 0 0; font: normal 21px/1.3 "Hoefler Text", "Iowan Old Style", Baskerville, Georgia, serif; }
.world-loading-bar { width: min(340px, 100%); height: 20px; border: 1px solid #a89a7c; padding: 3px; background: #ece6d8; box-shadow: inset 0 1px 3px #2320191f; }
.world-loading-fill { position: relative; width: 8%; height: 100%; background: repeating-linear-gradient(90deg, #8a7a5c 0 9px, transparent 9px 12px); transition: width .6s steps(4, end); overflow: hidden; }
.world-loading-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, #fff8 50%, transparent 80%); transform: translateX(-100%); animation: world-loading-sheen 3s steps(12, end) infinite; }
@keyframes world-loading-sheen { to { transform: translateX(100%); } }
.world-loading-step-count { margin: 26px 0 8px; color: #766c59; font: 600 12px/1.4 sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.world-loading-stage { min-height: 1.3em; margin: 0 0 18px; color: #232019; font: 600 25px/1.3 "Hoefler Text", "Iowan Old Style", Baskerville, Georgia, serif; }
.world-loading-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(420px, 100%); list-style: none; margin: 24px 0 0; padding: 0; }
.world-loading-steps li { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #908778; font: 14px/1.3 sans-serif; text-align: center; }
.world-loading-steps li span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #c1b79f; border-radius: 50%; font: 600 14px/1 sans-serif; }
.world-loading-steps [data-state="active"] { color: #253e34; font-weight: 700; }
.world-loading-steps [data-state="active"] span { color: #f6f2e8; border-color: #253e34; background: #253e34; box-shadow: 0 0 0 4px #253e3418; }
.world-loading-steps [data-state="done"] { color: #536653; }
.world-loading-steps [data-state="done"] span { border-color: #536653; background: #53665316; }
.world-loading-arcade { position: relative; isolation: isolate; display: flex; justify-content: center; align-items: center; min-width: 0; padding: 35px 80px 35px 35px; overflow: hidden; border-left: 1px solid #263952; background: radial-gradient(ellipse at 80% 18%, #34366066, transparent 58%), radial-gradient(ellipse at 20% 80%, #16395588, transparent 62%), #101e33; }
.world-loading-arcade::before { content: ""; position: absolute; z-index: -1; inset: 0; background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Ccircle%20cx%3D%22494.9%22%20cy%3D%22672.3%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.63%22%2F%3E%3Ccircle%20cx%3D%22780.1%22%20cy%3D%22235.9%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.74%22%2F%3E%3Ccircle%20cx%3D%22855.8%22%20cy%3D%22756.8%22%20r%3D%220.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.48%22%2F%3E%3Ccircle%20cx%3D%2284.6%22%20cy%3D%22259.8%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.55%22%2F%3E%3Ccircle%20cx%3D%22220.5%22%20cy%3D%2290.0%22%20r%3D%221.3%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.47%22%2F%3E%3Ccircle%20cx%3D%22169.4%22%20cy%3D%22728.9%22%20r%3D%221.2%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.37%22%2F%3E%3Ccircle%20cx%3D%22101.6%22%20cy%3D%22436.7%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.5%22%2F%3E%3Ccircle%20cx%3D%22388.3%22%20cy%3D%22230.7%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.47%22%2F%3E%3Ccircle%20cx%3D%22510.1%22%20cy%3D%22496.0%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.48%22%2F%3E%3Ccircle%20cx%3D%22212.4%22%20cy%3D%22101.7%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.87%22%2F%3E%3Ccircle%20cx%3D%22496.2%22%20cy%3D%22777.3%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.37%22%2F%3E%3Ccircle%20cx%3D%22711.0%22%20cy%3D%22604.6%22%20r%3D%221.1%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.41%22%2F%3E%3Ccircle%20cx%3D%22696.8%22%20cy%3D%22332.5%22%20r%3D%220.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.51%22%2F%3E%3Ccircle%20cx%3D%22188.1%22%20cy%3D%22497.2%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.84%22%2F%3E%3Ccircle%20cx%3D%22133.3%22%20cy%3D%22115.6%22%20r%3D%220.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.41%22%2F%3E%3Ccircle%20cx%3D%22642.5%22%20cy%3D%22483.4%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.65%22%2F%3E%3Ccircle%20cx%3D%2274.9%22%20cy%3D%22902.4%22%20r%3D%221.6%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.83%22%2F%3E%3Ccircle%20cx%3D%22592.6%22%20cy%3D%22914.6%22%20r%3D%221.3%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.8%22%2F%3E%3Ccircle%20cx%3D%22940.6%22%20cy%3D%22608.4%22%20r%3D%220.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.84%22%2F%3E%3Ccircle%20cx%3D%22581.1%22%20cy%3D%2278.9%22%20r%3D%221.6%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.36%22%2F%3E%3Ccircle%20cx%3D%22403.7%22%20cy%3D%22458.8%22%20r%3D%221.1%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.61%22%2F%3E%3Ccircle%20cx%3D%2269.2%22%20cy%3D%22687.7%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.8%22%2F%3E%3Ccircle%20cx%3D%22230.8%22%20cy%3D%22782.0%22%20r%3D%221.2%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.68%22%2F%3E%3Ccircle%20cx%3D%22537.1%22%20cy%3D%22629.3%22%20r%3D%221.1%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.85%22%2F%3E%3Ccircle%20cx%3D%22292.2%22%20cy%3D%22416.4%22%20r%3D%221.0%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.4%22%2F%3E%3Ccircle%20cx%3D%22552.1%22%20cy%3D%22813.6%22%20r%3D%220.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.71%22%2F%3E%3Ccircle%20cx%3D%22783.7%22%20cy%3D%22286.9%22%20r%3D%221.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.59%22%2F%3E%3Ccircle%20cx%3D%22443.6%22%20cy%3D%22138.5%22%20r%3D%220.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.62%22%2F%3E%3Ccircle%20cx%3D%22455.6%22%20cy%3D%22560.0%22%20r%3D%221.2%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.74%22%2F%3E%3Ccircle%20cx%3D%22102.0%22%20cy%3D%22727.6%22%20r%3D%221.1%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.58%22%2F%3E%3Ccircle%20cx%3D%2243.0%22%20cy%3D%22431.8%22%20r%3D%221.0%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.64%22%2F%3E%3Ccircle%20cx%3D%22559.0%22%20cy%3D%22505.0%22%20r%3D%221.0%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.74%22%2F%3E%3Ccircle%20cx%3D%22562.2%22%20cy%3D%22530.8%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.81%22%2F%3E%3Ccircle%20cx%3D%22739.9%22%20cy%3D%22848.4%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.89%22%2F%3E%3Ccircle%20cx%3D%22432.0%22%20cy%3D%2230.1%22%20r%3D%221.0%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.47%22%2F%3E%3Ccircle%20cx%3D%22961.7%22%20cy%3D%22784.4%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.85%22%2F%3E%3Ccircle%20cx%3D%22815.0%22%20cy%3D%22557.3%22%20r%3D%221.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.44%22%2F%3E%3Ccircle%20cx%3D%22904.6%22%20cy%3D%22625.6%22%20r%3D%221.2%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.75%22%2F%3E%3Ccircle%20cx%3D%22962.3%22%20cy%3D%22231.0%22%20r%3D%221.3%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.49%22%2F%3E%3Ccircle%20cx%3D%22535.9%22%20cy%3D%22886.9%22%20r%3D%221.1%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.39%22%2F%3E%3Ccircle%20cx%3D%22264.5%22%20cy%3D%2235.8%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.44%22%2F%3E%3Ccircle%20cx%3D%22891.3%22%20cy%3D%22148.7%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.89%22%2F%3E%3Ccircle%20cx%3D%22957.4%22%20cy%3D%22841.3%22%20r%3D%221.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.5%22%2F%3E%3Ccircle%20cx%3D%22241.8%22%20cy%3D%22942.8%22%20r%3D%221.0%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.47%22%2F%3E%3Ccircle%20cx%3D%22380.8%22%20cy%3D%226.0%22%20r%3D%220.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.6%22%2F%3E%3Ccircle%20cx%3D%22157.4%22%20cy%3D%22764.9%22%20r%3D%221.1%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.86%22%2F%3E%3Ccircle%20cx%3D%22397.7%22%20cy%3D%225.4%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.48%22%2F%3E%3Ccircle%20cx%3D%2280.3%22%20cy%3D%22527.4%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.59%22%2F%3E%3Ccircle%20cx%3D%22848.8%22%20cy%3D%22184.8%22%20r%3D%220.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.67%22%2F%3E%3Ccircle%20cx%3D%22245.1%22%20cy%3D%2241.7%22%20r%3D%221.2%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.69%22%2F%3E%3Ccircle%20cx%3D%22249.4%22%20cy%3D%22528.1%22%20r%3D%221.6%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.42%22%2F%3E%3Ccircle%20cx%3D%22507.9%22%20cy%3D%22549.1%22%20r%3D%221.2%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.7%22%2F%3E%3Ccircle%20cx%3D%22375.4%22%20cy%3D%22736.3%22%20r%3D%221.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.88%22%2F%3E%3Ccircle%20cx%3D%22529.6%22%20cy%3D%22796.4%22%20r%3D%221.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.75%22%2F%3E%3Ccircle%20cx%3D%22430.9%22%20cy%3D%22785.4%22%20r%3D%220.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.52%22%2F%3E%3Ccircle%20cx%3D%22211.9%22%20cy%3D%22776.0%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.84%22%2F%3E%3Ccircle%20cx%3D%22231.7%22%20cy%3D%22667.4%22%20r%3D%221.6%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.51%22%2F%3E%3Ccircle%20cx%3D%22694.0%22%20cy%3D%2270.8%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.81%22%2F%3E%3Ccircle%20cx%3D%22334.0%22%20cy%3D%22110.9%22%20r%3D%221.3%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.56%22%2F%3E%3Ccircle%20cx%3D%22468.1%22%20cy%3D%22832.7%22%20r%3D%221.3%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.85%22%2F%3E%3Ccircle%20cx%3D%22823.2%22%20cy%3D%2294.3%22%20r%3D%221.3%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.51%22%2F%3E%3Ccircle%20cx%3D%22179.9%22%20cy%3D%22274.6%22%20r%3D%221.6%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.67%22%2F%3E%3Ccircle%20cx%3D%22131.2%22%20cy%3D%22449.2%22%20r%3D%220.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.4%22%2F%3E%3Ccircle%20cx%3D%22392.7%22%20cy%3D%22615.5%22%20r%3D%220.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.69%22%2F%3E%3Ccircle%20cx%3D%22507.0%22%20cy%3D%22493.2%22%20r%3D%221.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.88%22%2F%3E%3Ccircle%20cx%3D%22931.7%22%20cy%3D%22262.9%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.56%22%2F%3E%3Ccircle%20cx%3D%22709.4%22%20cy%3D%22345.8%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.36%22%2F%3E%3Ccircle%20cx%3D%22530.1%22%20cy%3D%22450.3%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.54%22%2F%3E%3Ccircle%20cx%3D%22294.5%22%20cy%3D%2270.5%22%20r%3D%221.6%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.65%22%2F%3E%3Ccircle%20cx%3D%22125.8%22%20cy%3D%22724.5%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.53%22%2F%3E%3Ccircle%20cx%3D%2218.3%22%20cy%3D%22100.0%22%20r%3D%221.0%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.72%22%2F%3E%3Ccircle%20cx%3D%22444.0%22%20cy%3D%22988.2%22%20r%3D%221.1%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.86%22%2F%3E%3Ccircle%20cx%3D%22246.9%22%20cy%3D%22336.1%22%20r%3D%221.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.72%22%2F%3E%3Ccircle%20cx%3D%22345.3%22%20cy%3D%22400.1%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.83%22%2F%3E%3Ccircle%20cx%3D%22299.5%22%20cy%3D%22681.8%22%20r%3D%221.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.65%22%2F%3E%3Ccircle%20cx%3D%22646.0%22%20cy%3D%22544.4%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.73%22%2F%3E%3Ccircle%20cx%3D%22190.0%22%20cy%3D%22955.0%22%20r%3D%220.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.88%22%2F%3E%3Ccircle%20cx%3D%22459.0%22%20cy%3D%22452.1%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.81%22%2F%3E%3Ccircle%20cx%3D%22472.4%22%20cy%3D%22149.5%22%20r%3D%221.1%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.5%22%2F%3E%3Ccircle%20cx%3D%22141.8%22%20cy%3D%22501.0%22%20r%3D%221.1%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.75%22%2F%3E%3Ccircle%20cx%3D%22843.3%22%20cy%3D%22129.9%22%20r%3D%221.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.5%22%2F%3E%3Ccircle%20cx%3D%22774.7%22%20cy%3D%2251.9%22%20r%3D%220.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.56%22%2F%3E%3Ccircle%20cx%3D%22324.1%22%20cy%3D%2237.9%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.86%22%2F%3E%3Ccircle%20cx%3D%22518.6%22%20cy%3D%22626.4%22%20r%3D%221.0%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.46%22%2F%3E%3Ccircle%20cx%3D%22571.8%22%20cy%3D%22208.6%22%20r%3D%220.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.88%22%2F%3E%3Ccircle%20cx%3D%22588.5%22%20cy%3D%22381.2%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.82%22%2F%3E%3Ccircle%20cx%3D%22164.5%22%20cy%3D%22337.2%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.56%22%2F%3E%3Ccircle%20cx%3D%22472.3%22%20cy%3D%22804.5%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.82%22%2F%3E%3Ccircle%20cx%3D%22196.6%22%20cy%3D%22759.4%22%20r%3D%220.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.41%22%2F%3E%3Ccircle%20cx%3D%22596.3%22%20cy%3D%22958.8%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.39%22%2F%3E%3Ccircle%20cx%3D%22265.5%22%20cy%3D%22341.0%22%20r%3D%221.1%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.8%22%2F%3E%3Ccircle%20cx%3D%22800.7%22%20cy%3D%22658.6%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.59%22%2F%3E%3Ccircle%20cx%3D%22232.1%22%20cy%3D%22499.2%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.5%22%2F%3E%3Ccircle%20cx%3D%22221.6%22%20cy%3D%2268.2%22%20r%3D%221.2%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.62%22%2F%3E%3Ccircle%20cx%3D%22590.7%22%20cy%3D%22549.5%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.54%22%2F%3E%3Ccircle%20cx%3D%22930.2%22%20cy%3D%22811.7%22%20r%3D%221.2%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.76%22%2F%3E%3Ccircle%20cx%3D%2274.7%22%20cy%3D%2213.1%22%20r%3D%221.3%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.36%22%2F%3E%3Ccircle%20cx%3D%22154.6%22%20cy%3D%2265.8%22%20r%3D%221.3%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.64%22%2F%3E%3Ccircle%20cx%3D%22629.5%22%20cy%3D%22777.1%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.63%22%2F%3E%3Ccircle%20cx%3D%22449.1%22%20cy%3D%22536.4%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.82%22%2F%3E%3Ccircle%20cx%3D%22280.8%22%20cy%3D%22862.8%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.67%22%2F%3E%3Ccircle%20cx%3D%22819.9%22%20cy%3D%2258.1%22%20r%3D%221.2%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.86%22%2F%3E%3Ccircle%20cx%3D%22436.8%22%20cy%3D%22356.9%22%20r%3D%221.6%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.69%22%2F%3E%3Ccircle%20cx%3D%22885.1%22%20cy%3D%22616.9%22%20r%3D%221.3%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.61%22%2F%3E%3Ccircle%20cx%3D%22553.6%22%20cy%3D%22832.7%22%20r%3D%221.2%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.58%22%2F%3E%3Ccircle%20cx%3D%22151.0%22%20cy%3D%2288.7%22%20r%3D%220.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.48%22%2F%3E%3Ccircle%20cx%3D%22152.4%22%20cy%3D%22757.9%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.82%22%2F%3E%3Ccircle%20cx%3D%22425.5%22%20cy%3D%22875.7%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.57%22%2F%3E%3Ccircle%20cx%3D%22706.9%22%20cy%3D%22820.8%22%20r%3D%221.3%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.79%22%2F%3E%3Ccircle%20cx%3D%22153.6%22%20cy%3D%22401.5%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.63%22%2F%3E%3Ccircle%20cx%3D%22430.6%22%20cy%3D%22177.1%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.68%22%2F%3E%3Ccircle%20cx%3D%22301.6%22%20cy%3D%22144.3%22%20r%3D%220.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.68%22%2F%3E%3Ccircle%20cx%3D%22792.9%22%20cy%3D%2215.5%22%20r%3D%221.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.44%22%2F%3E%3Ccircle%20cx%3D%2233.6%22%20cy%3D%22358.8%22%20r%3D%221.6%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.45%22%2F%3E%3Ccircle%20cx%3D%22149.6%22%20cy%3D%22242.0%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.64%22%2F%3E%3Ccircle%20cx%3D%22671.4%22%20cy%3D%22161.2%22%20r%3D%221.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.73%22%2F%3E%3Ccircle%20cx%3D%22382.3%22%20cy%3D%227.8%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.44%22%2F%3E%3Ccircle%20cx%3D%22461.3%22%20cy%3D%22413.2%22%20r%3D%221.2%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.46%22%2F%3E%3Ccircle%20cx%3D%22973.9%22%20cy%3D%22415.2%22%20r%3D%220.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.79%22%2F%3E%3Ccircle%20cx%3D%22620.6%22%20cy%3D%22617.5%22%20r%3D%221.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.73%22%2F%3E%3Ccircle%20cx%3D%22970.7%22%20cy%3D%22588.1%22%20r%3D%221.0%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.77%22%2F%3E%3Ccircle%20cx%3D%22922.1%22%20cy%3D%22172.7%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.56%22%2F%3E%3Ccircle%20cx%3D%22705.3%22%20cy%3D%22101.3%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.51%22%2F%3E%3Ccircle%20cx%3D%22826.9%22%20cy%3D%22517.6%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.42%22%2F%3E%3Ccircle%20cx%3D%22700.4%22%20cy%3D%22729.7%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.43%22%2F%3E%3Ccircle%20cx%3D%22700.4%22%20cy%3D%22261.4%22%20r%3D%221.6%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.86%22%2F%3E%3Ccircle%20cx%3D%22340.3%22%20cy%3D%22147.7%22%20r%3D%221.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.59%22%2F%3E%3Ccircle%20cx%3D%22535.7%22%20cy%3D%22889.5%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.87%22%2F%3E%3Ccircle%20cx%3D%22471.9%22%20cy%3D%22365.2%22%20r%3D%221.6%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.68%22%2F%3E%3Ccircle%20cx%3D%22456.2%22%20cy%3D%22123.9%22%20r%3D%221.3%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.58%22%2F%3E%3Ccircle%20cx%3D%22779.0%22%20cy%3D%22110.1%22%20r%3D%221.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.42%22%2F%3E%3Ccircle%20cx%3D%22857.6%22%20cy%3D%22766.1%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.68%22%2F%3E%3Ccircle%20cx%3D%22669.3%22%20cy%3D%22988.6%22%20r%3D%220.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.55%22%2F%3E%3Ccircle%20cx%3D%2249.6%22%20cy%3D%2215.1%22%20r%3D%221.6%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.63%22%2F%3E%3Ccircle%20cx%3D%22804.4%22%20cy%3D%22582.9%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.38%22%2F%3E%3Ccircle%20cx%3D%22514.7%22%20cy%3D%22215.3%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.65%22%2F%3E%3Ccircle%20cx%3D%22145.0%22%20cy%3D%22608.6%22%20r%3D%221.6%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.89%22%2F%3E%3Ccircle%20cx%3D%22282.2%22%20cy%3D%22110.2%22%20r%3D%221.7%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.48%22%2F%3E%3Ccircle%20cx%3D%22726.9%22%20cy%3D%22540.2%22%20r%3D%221.8%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.68%22%2F%3E%3Ccircle%20cx%3D%22624.1%22%20cy%3D%22958.7%22%20r%3D%220.9%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.36%22%2F%3E%3Ccircle%20cx%3D%22835.7%22%20cy%3D%22274.1%22%20r%3D%221.1%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.75%22%2F%3E%3Ccircle%20cx%3D%22509.6%22%20cy%3D%22478.6%22%20r%3D%221.1%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.47%22%2F%3E%3Ccircle%20cx%3D%22511.4%22%20cy%3D%22555.3%22%20r%3D%221.4%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.6%22%2F%3E%3Ccircle%20cx%3D%22712.2%22%20cy%3D%22554.9%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.43%22%2F%3E%3Ccircle%20cx%3D%22618.8%22%20cy%3D%22510.9%22%20r%3D%221.5%22%20fill%3D%22%23dbe9ff%22%20opacity%3D%220.54%22%2F%3E%3Cpath%20d%3D%22M86%20155h8M90%20151v8%22%20stroke%3D%22%23edf6ff%22%20stroke-width%3D%221%22%20opacity%3D%22.6%22%2F%3E%3Cpath%20d%3D%22M816%2074h8M820%2070v8%22%20stroke%3D%22%23edf6ff%22%20stroke-width%3D%221%22%20opacity%3D%22.6%22%2F%3E%3Cpath%20d%3D%22M927%20631h8M931%20627v8%22%20stroke%3D%22%23edf6ff%22%20stroke-width%3D%221%22%20opacity%3D%22.6%22%2F%3E%3Cpath%20d%3D%22M175%20790h8M179%20786v8%22%20stroke%3D%22%23edf6ff%22%20stroke-width%3D%221%22%20opacity%3D%22.6%22%2F%3E%3Cpath%20d%3D%22M668%20895h8M672%20891v8%22%20stroke%3D%22%23edf6ff%22%20stroke-width%3D%221%22%20opacity%3D%22.6%22%2F%3E%3C%2Fsvg%3E"); background-size: 720px 720px; pointer-events: none; }
.world-loading-arcade::after { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at 53% 82%, #2a567a44, transparent 48%); pointer-events: none; }
.arcade-machine { position: relative; isolation: isolate; width: min(420px, 100%); filter: drop-shadow(0 24px 16px #05061999); }
.arcade-side { position: absolute; z-index: -1; top: 0; bottom: 0; left: calc(100% - 3px); width: 66px; transform: skewY(17deg); transform-origin: top left; border: 3px solid #191632; border-right: 5px solid #64f8ff; border-radius: 3px; background: linear-gradient(90deg, #392561, #613493 80%, #271d4b); box-shadow: 4px 0 8px #64f8ff44; }
.arcade-side svg { display: block; width: 100%; height: 100%; }
.arcade-crown { position: relative; display: flex; justify-content: center; align-items: center; gap: 20px; height: 70px; margin: 0 -8px; border: 7px solid #141b32; border-top: 9px solid #1b2441; border-radius: 6px 6px 0 0; background: linear-gradient(120deg, #004b69, #21205e 45%, #922477); box-shadow: inset 0 0 0 2px #64f8ff, inset 0 0 24px #00dfee88, 0 0 20px #00dfee44; }
.arcade-crown span { color: #fff7b7; font: 900 clamp(17px, 1.7vw, 26px)/1 monospace; letter-spacing: .04em; text-transform: uppercase; text-shadow: 2px 2px 0 #fa35b9, -1px -1px 0 #21ecf4; }
.arcade-crown i { width: 10px; height: 10px; background: #64f8ff; transform: rotate(45deg); box-shadow: 0 0 12px #64f8ff; }
.arcade-display-housing { padding: 22px 25px 27px; border-inline: 6px solid #243453; background: linear-gradient(105deg, #18233d, #101526); box-shadow: inset 5px 0 0 #ff4acb, inset -5px 0 0 #64f8ff; }
.arcade-screen { position: relative; aspect-ratio: 5 / 4; border: 12px solid #080e1b; border-radius: 16px; background: #020709; box-shadow: 0 0 0 3px #39445c, 0 3px 10px #000a; overflow: hidden; }
.arcade-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #020709; }
.arcade-deck { position: relative; height: 78px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 0 30px; margin: 0 -20px; transform: perspective(500px) rotateX(23deg); transform-origin: center top; border: 5px solid #10172c; border-top: 4px solid #64f8ff; border-bottom: 12px solid #16182b; border-radius: 3px; background: repeating-linear-gradient(135deg, transparent 0 26px, #c681ff22 26px 30px), linear-gradient(100deg, #215468, #49366d 70%, #652b62); box-shadow: 0 5px 0 #fa35b9, 0 7px 18px #fa35b944; }
.arcade-stick { position: relative; width: 40px; height: 16px; border-radius: 50%; background: #050c15; margin-right: auto; box-shadow: 0 3px 0 #000; }
.arcade-stick::before { content: ""; position: absolute; left: 16px; bottom: 8px; width: 8px; height: 32px; background: linear-gradient(90deg, #63727d, #f4f7f2, #576172); }
.arcade-stick::after { content: ""; position: absolute; left: 4px; bottom: 32px; width: 33px; height: 33px; border-radius: 50%; background: radial-gradient(circle at 32% 22%, #ffaccb, #ff386c 45%, #aa1247 82%); box-shadow: 0 4px 4px #0009; }
.arcade-button { width: 30px; height: 21px; border-radius: 50%; background: #eabd39; border: 3px solid #fff09b; box-shadow: 0 5px 0 #685119, 0 6px 4px #0008; }
.arcade-button:nth-last-child(2) { background: #ef418f; border-color: #ffa9d1; box-shadow: 0 5px 0 #821c58, 0 6px 4px #0008; }
.arcade-button:last-child { background: #19bace; border-color: #91f8ff; box-shadow: 0 5px 0 #12566a, 0 6px 4px #0008; }
.arcade-base { position: relative; height: 170px; display: flex; align-items: center; justify-content: center; margin: 6px 12px 0; border: 6px solid #121a2c; border-bottom: 18px solid #090e1a; background: linear-gradient(120deg, transparent 30%, #3bf0ef 30% 33%, #6137a2 33% 48%, #ff4acb 48% 52%, transparent 52%), linear-gradient(100deg, #1c2945, #11182b); box-shadow: -7px 0 0 #18223a, 7px 0 0 #18223a; }
.arcade-coin-door { display: flex; gap: 17px; padding: 19px 21px; border: 3px solid #090d17; border-radius: 4px; background: linear-gradient(#263149, #0d1424); box-shadow: inset 0 0 8px #0009, 0 1px 0 #61667e; }
.arcade-coin-door i { width: 10px; height: 27px; border: 2px solid #8191a1; border-top: 5px solid #ffd776; background: #05080f; box-shadow: 0 -2px 7px #ffd77655; }
@media (max-height: 740px) and (min-width: 761px) {
  .arcade-machine { width: min(330px, 100%); }
  .arcade-base { height: 100px; }
  .arcade-crown { height: 48px; }
  .arcade-deck { height: 60px; }
}
@media (max-width: 760px) {
  .world-loading { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; }
  .world-loading-info { padding: 30px 22px; }
  .world-loading-brand img { width: 60px; margin-bottom: 15px; }
  .world-loading-brand h1 { font-size: 26px; }
  #world-loading-phase { font-size: 18px; margin: 25px 0 0; }
  .world-loading-stage { font-size: 22px; }
  .world-loading-step-count { margin-top: 18px; }
  .world-loading-steps { margin-top: 18px; }
  .world-loading-arcade { min-height: 550px; padding: 30px 65px 35px 30px; border-left: 0; }
  .arcade-machine { width: min(290px, 100%); }
  .arcade-side { width: 45px; }
  .arcade-display-housing { padding: 16px 15px 20px; }
  .arcade-screen { border-width: 8px; }
  .arcade-deck { margin-inline: -10px; height: 55px; gap: 10px; padding-inline: 20px; }
  .arcade-base { height: 100px; }
  .arcade-crown { height: 48px; gap: 10px; }
  .arcade-crown span { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .world-loading-fill { transition: none; }
  .world-loading-fill::after { animation: none; }
}

body[data-world-loading="true"] :is(#landing-menu, #session-actions, #job-notice, .program-controls, .title-help, .simulation-ui, #show-controls) { display: none !important; }

/* Callahan's prose overlay: light italic text over a translucent charcoal wash. */
@font-face {
  font-family: "Prairie Narrative";
  src: url("/nine/assets/engine/assets/lato-light-italic.ttf") format("truetype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
.scene-narrative {
  position: absolute;
  z-index: 8;
  top: 22px;
  right: 22px;
  width: min(28%, 390px);
  max-height: 32%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #fff5 transparent;
  padding: 12px 15px;
  border: 0;
  border-radius: 0;
  background: rgba(45, 42, 39, 0.60);
  color: #faf7f0;
  font: italic 300 clamp(15px, 1.1vw, 17px)/1.28 "Prairie Narrative", "Helvetica Neue", sans-serif;
  text-align: left;
  text-wrap: pretty;
  overflow-wrap: break-word;
  user-select: text;
}
.scene-narrative p { margin: 0; white-space: pre-wrap; }
.scene-narrative p + p { margin-top: .5em; }
@media (max-width: 600px) {
  .scene-narrative { width: 60%; max-height: 32%; padding: 10px 12px; font-size: 15px; line-height: 1.28; }
}

/* Compact one-word entry; the placeholder is its visible prompt. */
#landing-seed-form { width: min(340px, 100%); }
.seed-entry-row { gap: 8px; align-items: center; }
#landing-seed { height: 34px; padding: 5px 10px; font-size: 17px; border-radius: 4px; }
#landing-seed::placeholder { color: #9b9487; opacity: 1; }
#landing-menu #landing-start { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 4px; }
@media (max-width: 500px) {
  #landing-seed { font-size: 16px; padding-inline: 8px; }
  #landing-menu #landing-start { padding-inline: 10px; font-size: 13px; }
}

/* First-visitor landing: automatic code entry and a clear purchase action. */
body[data-scene="title"] #landing-menu:has(#landing-code-form:not([hidden])) {
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 14px;
  padding: 0 44px 0 0;
}
#landing-code-form { position: relative; flex: 1 1 240px; max-width: 260px; }
#landing-code {
  height: 48px;
  padding: 8px 12px;
  border: 2px solid #9d9076;
  border-radius: 4px;
  background: #fffaf04d;
  color: #403a30;
  font: 22px/1.2 Menlo, Consolas, "Liberation Mono", monospace;
  font-variant: normal;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: .06em;
  text-transform: none;
}
#landing-code::placeholder { color: #9b927f; opacity: 1; }
#landing-code:focus-visible { outline: 2px solid #796747; outline-offset: 3px; }
#landing-code-status { position: absolute; top: 100%; width: 100%; margin-top: 7px; }
#landing-menu .landing-links #get-a-code {
  height: 48px;
  min-height: 48px;
  padding: 10px 22px;
  border: 1px solid #8c7954;
  border-radius: 4px;
  background: #e9dfc7;
  box-shadow: inset 0 1px 0 #fff9;
  color: #413622;
  font: 18px/1.2 Georgia, serif;
  white-space: nowrap;
}
#landing-menu .landing-links #get-a-code:hover {
  background: #e0d3b5;
  color: #292215;
}
#title-help-button { text-decoration: none; cursor: pointer; }
.title-help .help-card { left: auto; right: 0; transform: none; }
@media (max-width: 600px) {
  body[data-scene="title"] #landing-menu:has(#landing-code-form:not([hidden])) { gap: 10px; padding-right: 40px; }
  #landing-code-form { min-width: 0; }
  #landing-code { font-size: 18px; letter-spacing: .025em; padding-inline: 6px; }
  #landing-menu .landing-links #get-a-code { font-size: 16px; padding-inline: 14px; }
}

/* Open-space loading preview: no cabinet, bezel, game HUD or fake percentage. */
.world-loading-arcade { display:block; padding:0; border:0; background:#020709; }
.world-loading-arcade::before,.world-loading-arcade::after { content:none; }
#world-loading-game { display:block; position:absolute; inset:0; width:100%; height:100%; border:0; background:#020709; }
.world-loading-bar { position:relative; overflow:hidden; }
.world-loading-fill { position:absolute; left:0; top:0; height:100%; width:28%!important; background:#8b7d60; transition:none; animation:world-activity 12s linear infinite alternate; }
.world-loading-fill::after { content:none; }
@keyframes world-activity { from { transform:translateX(0); } to { transform:translateX(257%); } }
@media(max-width:760px) { .world-loading-arcade { min-height:500px; padding:0; } }
@media(prefers-reduced-motion:reduce) { .world-loading-fill { animation:none; left:36%; opacity:.65; } }

@media(max-width:760px) {
 .world-loading { grid-template-rows:minmax(220px,40%) minmax(0,1fr); overflow:hidden; }
 .world-loading-info { padding:14px 26px; }
 .world-loading-brand img { width:36px; margin-bottom:8px; }
 .world-loading-brand h1 { font-size:22px; }
 #world-loading-phase { margin:14px 0 0; font-size:15px; }
 .world-loading-step-count { margin:10px 0 4px; font-size:9px; }
 .world-loading-stage { font-size:18px; margin-bottom:8px; }
 .world-loading-steps { margin-top:10px; font-size:10px; }
 .world-loading-steps li { font-size:10px; gap:4px; }
 .world-loading-steps li span { width:22px; height:22px; font-size:11px; }
 .world-loading-arcade { min-height:0; }
}

/* Engine palette: cool silver on dark gray, preserving typography and geometry. */
.engine-atmosphere { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.engine-masthead { position:fixed; inset:26px 32px auto; z-index:1100; display:flex; align-items:center; justify-content:space-between; pointer-events:none; }
.engine-masthead a { pointer-events:auto; }
.engine-stamp { width:clamp(190px,18vw,265px); display:block; }
.engine-stamp img { width:100%; height:auto; display:block; filter:brightness(0) invert(.96); }
.engine-socials { display:flex; align-items:center; gap:10px; }
.engine-socials a { display:grid; place-items:center; width:34px; height:34px; color:#f2f5f8; opacity:.82; border-radius:4px; }
.engine-socials a:hover { opacity:1; background:#fff1; }
.engine-socials img { filter:brightness(0) invert(1); }
.engine-socials svg { width:22px; height:22px; }
.engine-socials .engine-cart { margin-left:10px; border-left:1px solid #c7d1dc3d; border-radius:0; width:46px; padding-left:12px; }
body[data-scene="world"]:not([data-world-loading="true"]) :is(.engine-masthead,.engine-facts) { display:none; }
.world-loading,.world-loading-info { color:#f4f6f8; background:#181c20; }
.world-loading-info { position:relative; isolation:isolate; }
.world-loading-info > :not(canvas) { position:relative; z-index:1; }
.world-loading-brand h1 { color:#f4f6f8; text-shadow:none; }
.world-loading-brand img { filter:invert(.88) sepia(1) saturate(1.8) brightness(1.25) drop-shadow(0 0 9px #f4cb7780) drop-shadow(0 0 28px #d9a34566); }
.world-loading-stage { color:#f4f6f8; }
.world-loading-step-count,.world-loading-steps li { color:#c8d0d8; }
.world-loading-steps li span { border-color:#b3bdc788; }
.world-loading-steps [data-state="active"] { color:#e4eaf0; }
.world-loading-steps [data-state="active"] span { color:#30373d; background:#dce2e8; border-color:#dce2e8; box-shadow:0 0 0 4px #dce2e818; }
.world-loading-steps [data-state="done"] { color:#d5dfe8; }
.world-loading-steps [data-state="done"] span { border-color:#b8c5d0; background:#c3d1df22; }
.world-loading-bar { border-color:#adb7c1; background:#252b3180; box-shadow:inset 0 1px 3px #171c213f; }
.world-loading-fill { background:#d3d9df; }
.engine-facts { position:fixed; z-index:80; bottom:32px; left:50%; transform:translateX(-50%); width:min(520px,calc(100% - 64px)); color:#d5dce3; text-align:center; pointer-events:none; }
.engine-facts p { margin:0; min-height:2.8em; font:15px/1.5 "Hoefler Text","Iowan Old Style",Baskerville,Georgia,serif; transition:opacity .45s ease; }
.engine-facts p.changing { opacity:0; }
body[data-world-loading="true"] .engine-facts { left:25%; width:min(450px,calc(50% - 64px)); }
@media(max-width:760px) {
 .engine-masthead { inset:12px 16px auto; gap:10px; }
 .engine-stamp { width:155px; }
 .engine-socials { gap:2px; }
 .engine-socials a { width:25px; height:32px; }
 .engine-socials img { width:16px; height:16px; }
 .engine-socials .engine-cart { width:31px; padding-left:7px; margin-left:3px; }
 .engine-socials svg { width:19px; height:19px; }
 .engine-facts { bottom:22px; width:calc(100% - 44px); }
 .engine-facts p { font-size:13px; }
 body[data-world-loading="true"] .world-loading { grid-template-rows:minmax(375px,54%) minmax(0,1fr); }
 body[data-world-loading="true"] .world-loading-info { padding-top:46px; padding-bottom:74px; }
 body[data-world-loading="true"] .engine-facts { top:calc(max(375px,54dvh) - 78px); bottom:auto; left:50%; width:calc(100% - 44px); }
}
@media(prefers-reduced-motion:reduce) { .engine-facts p { transition:none; } }


/* Silver arcade refinement: all Engine chrome belongs to its own half. */
.world-loading,.world-loading-info { background:#181c20; }
.engine-stamp { width:150px; }
body[data-world-loading="true"] .engine-masthead { right:calc(50% + 28px); left:24px; top:22px; }
.engine-socials { gap:5px; }
.engine-socials a { width:28px; height:32px; }
.engine-socials img { width:17px; height:17px; }
.engine-socials .engine-cart { width:36px; margin-left:5px; padding-left:8px; }
.world-loading-fill { width:28%!important; background:#d3d9df; animation:world-activity-forward 8.5s cubic-bezier(.42,0,.58,1) infinite; }
@keyframes world-activity-forward { from { transform:translateX(-105%); } to { transform:translateX(365%); } }
.world-loading-bar { border-color:#adb3bb; background:#33383d70; }
.world-loading-steps [data-state="active"] { color:#f3f5f7; }
.world-loading-steps [data-state="active"] span { background:#dce2e8; border-color:#dce2e8; color:#353c43; box-shadow:0 0 0 4px #dce2e818; }
.world-loading-step-count,.world-loading-steps li,.engine-facts { color:#d5d9de; }
.starfall-promo { position:absolute; z-index:3; top:26px; left:50%; transform:translateX(-50%); width:min(350px,62%); display:flex; flex-direction:column; align-items:center; text-decoration:none; color:#a0b2bd; }
.starfall-promo img { display:block; width:100%; height:auto; }
.starfall-promo span { margin-top:4px; font:10px/1.4 ui-monospace,Menlo,monospace; letter-spacing:.12em; text-transform:uppercase; }
.starfall-promo:hover { filter:brightness(1.13); color:#d6e6f0; }
.prairie-square-link { position:absolute; z-index:3; right:22px; bottom:22px; width:54px; height:54px; opacity:.8; transition:opacity .2s; }
.prairie-square-link:hover { opacity:1; }
.prairie-square-link img { display:block; width:100%; height:100%; }
.starfall-controls { position:absolute; z-index:2; left:24px; bottom:25px; margin:0; max-width:calc(100% - 115px); color:#90a0aa; font:10px/1.5 ui-monospace,Menlo,monospace; pointer-events:none; }
@media(max-width:760px) {
 body[data-world-loading="true"] .engine-masthead { left:16px; right:16px; top:12px; }
 .engine-stamp { width:118px; }
 .engine-socials { gap:2px; }.engine-socials a { width:24px; }.engine-socials .engine-cart { width:30px; }
 .starfall-promo { top:12px; width:min(230px,60%); }
 .starfall-promo span { font-size:8px; }
 .prairie-square-link { width:38px; height:38px; right:12px; bottom:12px; }
 .starfall-controls { left:12px; bottom:13px; max-width:calc(100% - 75px); font-size:8px; }
}
@media(prefers-reduced-motion:reduce) { .world-loading-fill { animation:none; transform:none; left:36%; } }

.world-loading-brand img { filter:drop-shadow(0 0 5px #dce9ff14); }



/* This presentation belongs exclusively to the waiting screen. */
body:not([data-world-loading="true"]) :is(.engine-masthead,.engine-facts) { display:none; }
body[data-world-loading="true"] :is(#landing-menu,#session-actions,.title-help,#title-help-button) { display:none!important; }

/* Temporary comparison: original paper aesthetic, exclusively in the loading pane. */
body[data-loading-theme="paper"] .world-loading { background:#f6f2e8; color:#232019; }
body[data-loading-theme="paper"] .world-loading-info { background:radial-gradient(90% 70% at 22% 12%,#8a7a5c0f,transparent 60%),repeating-linear-gradient(93deg,#23201904 0 1px,transparent 1px 7px),#f6f2e8; color:#232019; }
body[data-loading-theme="paper"] .world-loading-info .engine-atmosphere { display:none; }
body[data-loading-theme="paper"] .world-loading-brand img { filter:none; }
body[data-loading-theme="paper"] :is(.world-loading-brand h1,.world-loading-stage) { color:#232019; }
body[data-loading-theme="paper"] .world-loading-step-count { color:#766c59; }
body[data-loading-theme="paper"] .world-loading-steps li { color:#908778; }
body[data-loading-theme="paper"] .world-loading-steps li span { border-color:#c1b79f; }
body[data-loading-theme="paper"] .world-loading-steps [data-state="active"] { color:#253e34; }
body[data-loading-theme="paper"] .world-loading-steps [data-state="active"] span { color:#f6f2e8; border-color:#253e34; background:#253e34; box-shadow:0 0 0 4px #253e3418; }
body[data-loading-theme="paper"] .world-loading-steps [data-state="done"] { color:#536653; }
body[data-loading-theme="paper"] .world-loading-steps [data-state="done"] span { border-color:#536653; background:#53665316; }
body[data-loading-theme="paper"] .world-loading-bar { border-color:#a89a7c; background:#ece6d8; box-shadow:inset 0 1px 3px #2320191f; }
body[data-loading-theme="paper"] .world-loading-fill { background:#8b7d60; }
body[data-loading-theme="paper"][data-world-loading="true"] .engine-facts { color:#766c59; }
body[data-loading-theme="paper"][data-world-loading="true"] :is(.engine-stamp img,.engine-socials img) { filter:brightness(0); }
body[data-loading-theme="paper"][data-world-loading="true"] .engine-socials a { color:#232019; }
body[data-loading-theme="paper"][data-world-loading="true"] .engine-socials a:hover { background:#2320190a; }
body[data-loading-theme="paper"][data-world-loading="true"] .engine-cart { border-color:#2320193d; }

/* Keep the stage row evenly spaced as the runtime adds its View phase. */
.world-loading-steps { grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:1fr; }

/* Loading telemetry: one activity bar, plain words and confirmed milestone lights. */
#world-loading-step-count { display:none; }
.world-loading-stage { margin:26px 0 8px; font-size:21px; text-align:center; }
.world-loading-detail { margin:0 0 18px; min-height:2.6em; max-width:370px; text-align:center; font:15px/1.4 Georgia,serif; color:inherit; opacity:.8; }
.world-loading-steps { margin:16px 0 0; gap:14px; }
.world-loading-steps li { flex-direction:row; justify-content:center; gap:7px; font-size:12px; white-space:nowrap; }
.world-loading-steps li span { flex:none; width:6px; height:6px; border:0; background:currentColor; opacity:.3; }
.world-loading-steps [data-state="active"] span { opacity:1; box-shadow:none!important; animation:loading-status-pulse 1.8s ease-in-out infinite; }
.world-loading-steps [data-state="done"] span { opacity:1; background:currentColor!important; }
.world-loading-timing { margin:18px 0 0; font:12px/1.5 ui-monospace,Menlo,monospace; font-variant-numeric:tabular-nums; opacity:.8; }
.world-loading-connection { margin:3px 0 0; font:11px/1.5 sans-serif; opacity:.65; }
.world-loading[data-connection="interrupted"] .world-loading-fill,.world-loading[data-connection="interrupted"] .world-loading-steps span { animation-play-state:paused; opacity:.4; }
.world-loading[data-connection="interrupted"] .world-loading-connection { opacity:1; }
.world-loading[data-phase="ready"] .world-loading-fill { animation:none; left:0; transform:none; width:100%!important; }
@keyframes loading-status-pulse { 0%,100% { opacity:.35; } 50% { opacity:1; } }
@media(max-width:760px) {
 .world-loading-stage { font-size:16px; margin:14px 0 5px; }
 .world-loading-detail { font-size:12px; margin-bottom:10px; min-height:2.5em; }
 .world-loading-steps { margin-top:10px; gap:8px; }
 .world-loading-steps li { font-size:10px; gap:5px; }
 .world-loading-steps li span { width:5px; height:5px; }
 .world-loading-timing { font-size:10px; margin-top:10px; }
 .world-loading-connection { font-size:10px; }
}
@media(prefers-reduced-motion:reduce) { .world-loading-steps [data-state="active"] span { animation:none; opacity:1; } }

@media(max-width:760px) { body[data-world-loading="true"] .engine-facts { top:calc(max(375px,54dvh) - 54px); } }

/* Help is a solid popover above the entry row, clear of the Save control below. */
body[data-scene="title"] .title-help { z-index:1200; }
.title-help .help-card { top:auto; bottom:calc(100% + 10px); right:0; left:auto; transform:none; background:#f6f2e8; max-height:calc(100dvh - 100px); overflow-y:auto; }
.title-help.is-open::before { content:""; position:absolute; right:0; bottom:100%; width:100%; height:10px; }
.title-help .help-card p + p { margin-top:10px; font-size:13px; line-height:1.45; color:#6e624d; }
/* A substantial central play square, suspended in the same black starfield. */
.world-loading-arcade { container-type:size; background:#000 url('/nine/assets/engine/assets/starfall-space.svg') center / cover no-repeat; }
#world-loading-game { inset:auto; left:50%; top:calc(50% + 30px); transform:translate(-50%,-50%); width:min(82cqw,calc(100cqh - 210px)); height:auto; aspect-ratio:1; background:#000; border:0; border-radius:0; box-shadow:none; mask-image:linear-gradient(to right,transparent,#000 22px,#000 calc(100% - 22px),transparent),linear-gradient(to bottom,transparent,#000 22px,#000 calc(100% - 22px),transparent); mask-composite:intersect; }
.starfall-promo { top:25px; width:min(310px,56%); }
.starfall-promo img { image-rendering:pixelated; }
@media(max-width:760px) {
 .starfall-promo { top:9px; width:min(160px,44%); }
 .starfall-promo span { font-size:7px; margin-top:2px; }
 #world-loading-game { top:calc(50% + 24px); width:min(84cqw,calc(100cqh - 96px)); }
}

/* Reserve the help icon's own space beside the narrow word-entry row. */
@media(max-width:600px) {
 #landing-seed-form { width:calc(100% - 46px); margin-right:46px; }
 #landing-seed { font-size:16px; }
}

/* Free play floats in the black waiting area, without a cabinet or control deck. */
.world-loading-arcade { background:#000; }
.starfall-wait-copy { position:absolute; z-index:3; top:24px; left:24px; right:86px; color:#e9e9e9; text-align:center; font:14px/1.6 ui-monospace,Menlo,monospace; }
.starfall-wait-copy p { margin:0 0 5px; }
.starfall-promo { top:112px; width:min(220px,40%); }
.prairie-square-link { top:20px; right:20px; bottom:auto; width:44px; height:44px; }
#world-loading-game { top:210px; bottom:18px; left:18px; width:calc(100% - 36px); height:calc(100% - 228px); transform:none; aspect-ratio:auto; border:0; background:#000; box-shadow:none; mask-image:none; }
@media(max-height:750px),(max-width:760px) {
 .starfall-wait-copy { top:12px; left:12px; right:64px; font-size:11px; line-height:1.45; }
 .prairie-square-link { top:12px; right:12px; width:36px; height:36px; }
 .starfall-promo { top:86px; width:140px; }
 #world-loading-game { top:150px; bottom:8px; left:8px; width:calc(100% - 16px); height:calc(100% - 158px); }
}

/* Keep the waiting header painted above the animated game surface. */
.starfall-wait-copy,.prairie-square-link { transform:translateZ(0); }
.starfall-promo { transform:translateX(-50%) translateZ(0); }

.starfall-wait-copy,.starfall-promo,.prairie-square-link { background:#000; z-index:10; will-change:transform; }

/* Prairie Labs surrounds the title screen; the world keeps its full viewport. */
body[data-scene="title"] .engine-masthead { display:flex; inset:22px 28px auto; z-index:900; }
body[data-scene="title"] .engine-stamp { width:clamp(160px,17vw,230px); }
body[data-scene="title"] .engine-stamp img,body[data-scene="title"] .engine-socials img { filter:brightness(0); }
.engine-header-right { display:flex; align-items:center; gap:14px; pointer-events:auto; }
body[data-scene="title"] .engine-socials a { color:#232019; }
body[data-scene="title"] .engine-socials a:hover { background:#2320190a; }
#header-allowance-slot .nine-allowance { font:12px Georgia,serif; color:#625031; white-space:nowrap; }
body[data-scene="title"] #session-actions { top:78px; left:28px; right:28px; }
.engine-footer { display:none; }
body[data-scene="title"]:not([data-world-loading="true"]) .engine-footer { display:flex; position:fixed; left:28px; right:28px; bottom:24px; z-index:800; justify-content:space-between; align-items:center; gap:12px; font:10px/1.5 Georgia,serif; color:#625031; }
.engine-footer nav { display:flex; flex-wrap:wrap; gap:14px; }
.engine-footer a { color:inherit; text-decoration:none; }
.engine-footer a:hover { text-decoration:underline; }
.engine-footer a:focus-visible { outline:2px solid #765b2e; outline-offset:4px; }
.title-help .help-card { width:min(390px,calc(100vw - 32px)); padding:20px; }
.title-help .help-card h2 { margin:0 0 10px; font:17px Georgia,serif; }
.title-help .help-card p,.title-help .help-card p + p { font:13px/1.55 Georgia,serif; color:#4a443a; }
.title-help .help-card a { display:inline; font:inherit; color:#625031; text-decoration:underline; }
@media(max-width:760px) {
 body[data-scene="title"] .engine-masthead { inset:14px 16px auto; align-items:flex-start; }
 body[data-scene="title"] .engine-stamp { width:140px; }
 .engine-header-right { flex-direction:column; align-items:flex-end; gap:2px; }
 body[data-scene="title"] .engine-socials a { width:26px; height:30px; }
 body[data-scene="title"] #session-actions { top:80px; left:16px; right:16px; }
 body[data-scene="title"] .engine-footer { left:16px; right:16px; bottom:14px; flex-direction:column; text-align:center; gap:5px; }
 .engine-footer nav { justify-content:center; gap:10px; }
}

#header-allowance-slot .nine-allowance { position:static; inset:auto; display:inline-block; padding:0; margin:0; background:transparent; min-width:0; }
#header-allowance-slot .nine-allowance[hidden] { display:none; }
body[data-scene="title"] #session-actions { top:102px; }
@media(max-width:760px) { body[data-scene="title"] #session-actions { top:72px; } }

/* Compact title header and one-row world entry. */
body[data-scene="title"] .engine-masthead { top:10px; align-items:flex-start; }
body[data-scene="title"] .engine-stamp { width:110px; }
body[data-scene="title"]:has(#session-signout:not([hidden])) .engine-header-right { margin-right:88px; }
body[data-scene="title"] #session-signout { position:fixed; top:10px; right:28px; }
body[data-scene="title"] #session-actions { top:54px; justify-content:flex-end; }
#landing-seed-form { width:min(390px,100%); }
#landing-menu #landing-load { width:36px; height:34px; min-height:34px; padding:7px; border-radius:4px; }
#landing-menu .landing-links:has(>button):not(:has(>button:not([hidden]))) { display:none; }
@media(max-width:760px) {
 body[data-scene="title"] .engine-stamp { width:95px; }
 body[data-scene="title"] #session-signout { top:10px; right:16px; padding:7px 9px; }
 body[data-scene="title"]:has(#session-signout:not([hidden])) .engine-header-right { margin-right:74px; }
 body[data-scene="title"] #session-actions { top:72px; }
}
@media(max-width:600px) {
 #landing-seed-form { width:calc(100% - 42px); margin-right:42px; }
 .seed-entry-row { gap:5px; }
 #landing-menu #landing-start { padding-inline:7px; font-size:12px; }
 #landing-menu #landing-load { width:32px; padding:6px; }
}

@media(min-width:601px) { #landing-seed-form { margin-right:44px; } }

/* Keep branding and account controls safely inside the decorative double frame. */
body[data-scene="title"] .engine-masthead{top:32px;left:36px;right:36px}
body[data-scene="title"] #session-signout{top:30px;right:36px}
body[data-scene="title"] #session-actions{top:72px;left:36px;right:36px}
@media(max-width:760px){body[data-scene="title"] .engine-masthead{top:30px;left:28px;right:28px}body[data-scene="title"] #session-signout{top:28px;right:28px}body[data-scene="title"] #session-actions{top:76px;left:28px;right:28px}}

/* The cart remains beside help for both guests and signed-in users. */
.landing-cart{position:absolute;left:38px;top:0;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;color:#302b22;z-index:1200}.landing-cart svg{width:23px;height:23px}.landing-cart:focus-visible{outline:2px solid currentColor;outline-offset:3px}

/* Oklahoma Blue from the approved brand palette; a quiet battery, exact on hover/focus. */
#header-allowance-slot { display:flex;align-items:center; }
#header-allowance-slot #engine-allowance { position:relative;display:inline-flex;align-items:center;justify-content:center;width:88px;flex:0 0 88px;height:30px;padding:0 5px 0 0;box-sizing:border-box;color:#141210;text-shadow:none;cursor:help;outline-offset:5px; }
#header-allowance-slot #engine-allowance[hidden] { display:none; }
#header-allowance-slot .engine-allowance-track { display:block;width:100%;height:18px;padding:3px;box-sizing:border-box;border:1px solid #0072CE80;border-radius:5px;background:#f7f1e1;box-shadow:0 1px 4px #14121012;overflow:hidden; }
#header-allowance-slot .engine-allowance-fill { display:block;height:100%;border-radius:2px;background:#0072CE;transition:width .4s ease; }
#engine-allowance::after { content:'';position:absolute;right:1px;top:11px;width:3px;height:8px;border-radius:0 2px 2px 0;background:#0072CE99; }
#engine-allowance .engine-allowance-tooltip { position:absolute;top:calc(100% + 7px);left:50%;transform:translateX(-50%);white-space:nowrap;padding:6px 9px;border-radius:5px;background:#141210;color:#F7F1E1;font:11px/1.4 PrairieManrope,system-ui,sans-serif;opacity:0;visibility:hidden;pointer-events:none;box-shadow:0 3px 12px #0002;z-index:1300; }
#engine-allowance:hover .engine-allowance-tooltip,#engine-allowance:focus-visible .engine-allowance-tooltip { opacity:1;visibility:visible; }
#engine-allowance[data-known="false"]::before { content:'—';color:#625031; }
.engine-header-right { flex-direction:row;align-items:center; }
@media(prefers-reduced-motion:reduce){#header-allowance-slot .engine-allowance-fill{transition:none}}

/* Keep remaining use available in-world, beside the same social links. */
body[data-scene="world"]:not([data-world-loading="true"]) .engine-masthead { display:flex;justify-content:flex-end;inset:16px 28px auto; }
body[data-scene="world"] .engine-masthead .engine-stamp { display:none; }
body[data-scene="world"] .engine-header-right { padding:3px 9px;border-radius:7px;background:#14121066;backdrop-filter:blur(8px); }
