body {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}

#narrative {
  min-height: 60vh;
}

#rich-dialog-output > :not(.glk-line),
#narrative > :not(.glk-line),
.rich-scene-focus-copy > :not(.glk-line),
.rich-player-response-card-copy > :not(.glk-line) {
  margin: 0.8rem 0;
}

#rich-dialog-output p,
#rich-dialog-output ul,
#rich-dialog-output ol,
#rich-dialog-output blockquote,
#rich-scene-focus-copy p,
#rich-scene-focus-copy ul,
#rich-scene-focus-copy ol,
#rich-scene-focus-copy blockquote,
#rich-player-response-card-copy p,
#rich-player-response-card-copy ul,
#rich-player-response-card-copy ol,
#rich-player-response-card-copy blockquote,
#narrative p,
#narrative ul,
#narrative ol,
#narrative blockquote {
  margin: 0.65rem 0;
}

#rich-dialog-output ul,
#rich-dialog-output ol,
#rich-scene-focus-copy ul,
#rich-scene-focus-copy ol,
#rich-player-response-card-copy ul,
#rich-player-response-card-copy ol,
#narrative ul,
#narrative ol {
  padding-left: 1.4rem;
}

#rich-dialog-output code,
#rich-scene-focus-copy code,
#rich-player-response-card-copy code,
#narrative code {
  border-radius: 0.35rem;
  background: hsl(var(--b2));
  padding: 0.1rem 0.35rem;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
}

.room-illustration {
  display: block;
  width: min(100%, 400px);
  height: auto;
  background: hsl(var(--b2));
}

.rich-app-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.rich-app-shell:fullscreen,
.rich-app-shell:-webkit-full-screen,
#age-static-root:fullscreen,
#age-static-root:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  background: #000;
}

.rich-app-shell:fullscreen .rich-app-stage,
.rich-app-shell:-webkit-full-screen .rich-app-stage,
#age-static-root:fullscreen .rich-app-stage,
#age-static-root:-webkit-full-screen .rich-app-stage {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
}

.rich-app-stage {
  width: min(100%, 1440px);
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  overflow: hidden;
}

.rich-flash-message {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 95;
  padding: 0;
}

.rich-scene-shell {
  width: 100%;
}

.rich-scene-canvas {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: #000;
}

[data-rich-game-area],
[data-rich-game-area] button,
[data-rich-game-area] .age-command,
[data-rich-game-area] .rich-status-link,
[data-rich-game-area] .rich-dialog-tab,
[data-rich-game-area] .rich-dialog-dismiss,
[data-rich-game-area] label:not(.rich-command-input-shell) {
  cursor: var(--age-game-cursor, auto);
}

[data-rich-game-area] .rich-command-input,
[data-rich-game-area] input[type="text"],
[data-rich-game-area] textarea {
  cursor: text;
}

.rich-scene-status {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: none;
  padding: 0.45rem 0.8rem;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  font-size: 0.82rem;
  line-height: 1.2;
}

.rich-scene-status-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.rich-scene-status-copy .status-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.rich-scene-status-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.9rem;
  flex: 0 0 auto;
  pointer-events: auto;
}

.rich-status-link {
  flex: 0 0 auto;
  pointer-events: auto;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  cursor: pointer;
  opacity: 0.92;
}

.rich-status-link:hover {
  opacity: 1;
}

.rich-status-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.rich-status-volume {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.rich-status-volume-slider {
  width: 6.5rem;
  accent-color: currentColor;
  cursor: pointer;
  opacity: 0.88;
}

.rich-status-volume-slider:hover {
  opacity: 1;
}

.rich-status-volume-slider:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.rich-scene-status--subtle {
  border-bottom: 1px dashed rgba(255, 248, 235, 0.32);
  background: transparent;
  color: rgba(255, 248, 235, 0.72);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.rich-scene-status--light-bar {
  border-bottom: 1px solid rgba(90, 68, 42, 0.22);
  background: rgba(255, 247, 235, 0.78);
  color: #2a1c10;
}

.rich-scene-status--dark-bar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(14, 14, 20, 0.72);
  color: #f8f2ea;
}

.rich-scene-status--paper-bar {
  border-bottom: 1px dashed rgba(87, 65, 43, 0.28);
  background: rgba(244, 236, 220, 0.84);
  color: #2a1c10;
}

.rich-scene-status--outline-light {
  border-bottom: 1px dashed rgba(255, 248, 235, 0.8);
  background: rgba(255, 248, 235, 0.08);
  color: #fffaf3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.rich-scene-image {
  display: block;
  width: 100%;
  height: auto;
}

.rich-scene-overlay,
.rich-scene-command-group {
  position: absolute;
}

.rich-scene-overlay {
  max-width: calc(18vw * var(--age-overlay-scale, 1));
  min-width: calc(72px * var(--age-overlay-scale, 1));
  width: min(calc(14vw * var(--age-overlay-scale, 1)), calc(120px * var(--age-overlay-scale, 1)));
  height: auto;
  pointer-events: none;
}

.rich-scene-command-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: max-content;
  max-width: min(42vw, 320px);
}

.rich-scene-focus-layer {
  position: absolute;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 180ms ease;
}

.rich-scene-focus-layer--anchored {
  width: max-content;
  max-width: min(36vw, 26rem);
}

.rich-scene-focus-layer--scene {
  left: 50%;
  bottom: 1rem;
  z-index: 88;
  width: min(80%, 36rem);
  transform: translateX(-50%);
}

.rich-scene-focus-layer--scene.rich-scene-focus-layer--with-response-card {
  bottom: calc(1rem + clamp(7.5rem, 22vh, 11rem));
}

.rich-scene-focus-card {
  position: relative;
  border: 1px solid rgba(255, 248, 235, 0.22);
  border-radius: 1.1rem;
  background: rgba(17, 14, 12, 0.88);
  color: rgba(255, 248, 235, 0.96);
  padding: 0.95rem 1rem;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(12px);
  transition: transform 180ms ease, opacity 180ms ease;
}

.rich-scene-focus-card--scene {
  background: rgba(20, 17, 15, 0.82);
}

.rich-scene-focus-countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  border-radius: 999px;
  background: rgba(255, 248, 235, 0.12);
  color: rgba(255, 248, 235, 0.76);
  padding: 0.12rem 0.45rem;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.rich-focus-surface--dismissed {
  opacity: 0;
  pointer-events: none;
}

.rich-focus-surface--dismissed .rich-scene-focus-card {
  transform: translateY(0.6rem) scale(0.98);
}

.rich-player-response-card {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 90;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.95rem;
  align-items: stretch;
  width: min(92%, 42rem);
  transform: translateX(-50%);
  border: 1px solid rgba(255, 248, 235, 0.22);
  border-radius: 1.2rem;
  background: rgba(15, 12, 11, 0.9);
  color: rgba(255, 248, 235, 0.97);
  padding: 0.95rem;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(14px);
}

.rich-player-response-card-portrait {
  width: 6.1rem;
  min-width: 6.1rem;
  border-radius: 0.9rem;
  overflow: hidden;
  background: rgba(255, 248, 235, 0.08);
}

.rich-player-response-card-portrait-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rich-player-response-card-copy {
  min-width: 0;
}

.rich-player-response-card--no-portrait {
  grid-template-columns: minmax(0, 1fr);
}

.rich-player-response-card .age-command-block {
  width: 100%;
  justify-content: flex-start;
}

.age-command-prompt {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

.age-command-prompt-shell {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.age-command-prompt-input,
.age-command-prompt-submit {
  font: inherit;
}

.age-command-prompt-input {
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  border: 1px solid hsl(var(--bc) / 0.26);
  border-radius: 1rem;
  background: linear-gradient(180deg, hsl(var(--b2)), hsl(var(--b3)));
  color: hsl(var(--bc));
  padding: 0.7rem 1rem;
}

.age-command-prompt-input::placeholder {
  color: hsl(var(--bc) / 0.55);
}

.age-command-prompt-submit {
  flex: 0 0 auto;
  min-height: 3rem;
  border: 1px solid hsl(var(--bc) / 0.26);
  border-radius: 999px;
  background: linear-gradient(180deg, hsl(var(--b2)), hsl(var(--b3)));
  color: hsl(var(--bc));
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.age-command-prompt-submit:hover {
  border-color: hsl(var(--bc) / 0.42);
  background: linear-gradient(180deg, hsl(var(--b3)), hsl(var(--b2)));
  transform: translateY(-1px);
}

.age-command-prompt-input:focus-visible,
.age-command-prompt-submit:focus-visible {
  outline: 2px solid hsl(var(--p));
  outline-offset: 2px;
}

.age-command-prompt-input:disabled,
.age-command-prompt-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rich-player-response-card .age-command-prompt-input,
.rich-player-response-card .age-command-prompt-submit,
.rich-scene-focus-copy .age-command-prompt-input,
.rich-scene-focus-copy .age-command-prompt-submit,
#rich-dialog-output .age-command-prompt-input,
#rich-dialog-output .age-command-prompt-submit {
  border-color: rgba(255, 248, 235, 0.26);
  background: rgba(255, 248, 235, 0.04);
  color: rgba(255, 248, 235, 0.95);
}

.rich-player-response-card .age-command-prompt-input::placeholder,
.rich-scene-focus-copy .age-command-prompt-input::placeholder,
#rich-dialog-output .age-command-prompt-input::placeholder {
  color: rgba(255, 248, 235, 0.52);
}

.rich-player-response-card .age-command-prompt-submit:hover,
.rich-scene-focus-copy .age-command-prompt-submit:hover,
#rich-dialog-output .age-command-prompt-submit:hover {
  border-color: rgba(255, 248, 235, 0.42);
  background: rgba(255, 248, 235, 0.1);
  box-shadow: 0 10px 24px hsl(var(--bc) / 0.12);
}

.rich-scene-focus-detail {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.rich-scene-focus-detail-image {
  display: block;
  width: min(100%, 16rem);
  max-height: 12rem;
  object-fit: contain;
  border-radius: 0.8rem;
  background: rgba(255, 248, 235, 0.06);
}

.rich-floating-control {
  position: absolute;
  z-index: 84;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.35rem;
  height: 3.35rem;
  border: 1px solid rgba(255, 248, 235, 0.26);
  border-radius: 999px;
  background: rgba(12, 11, 14, 0.78);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease, opacity 120ms ease;
}

.rich-floating-control:hover {
  border-color: rgba(255, 248, 235, 0.46);
  background: rgba(18, 16, 20, 0.9);
  transform: translateY(-1px);
}

.rich-floating-control:focus-visible {
  outline: 2px solid rgba(255, 248, 235, 0.76);
  outline-offset: 3px;
}

.rich-floating-control:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rich-floating-control--active {
  border-color: rgba(255, 248, 235, 0.72);
  background: rgba(34, 28, 23, 0.92);
}

.rich-floating-control--bottom-left {
  left: 1rem;
  bottom: 1rem;
}

.rich-floating-control--bottom-right {
  right: 1rem;
  bottom: 1rem;
}

.rich-floating-control-icon {
  width: 1.55rem;
  height: 1.55rem;
  object-fit: contain;
}

.rich-inventory-panel {
  position: absolute;
  inset: 0;
  z-index: 76;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.rich-inventory-panel-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.rich-inventory-panel-card {
  position: relative;
  z-index: 1;
  width: min(92%, 32rem);
  border: 1px solid rgba(255, 248, 235, 0.24);
  border-radius: 1.2rem;
  background: rgba(14, 12, 11, 0.92);
  color: rgba(255, 248, 235, 0.97);
  padding: 1rem;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(14px);
}

.rich-inventory-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.rich-inventory-panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.rich-inventory-panel-dismiss {
  border: 0;
  background: transparent;
  color: rgba(255, 248, 235, 0.76);
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  cursor: pointer;
}

.rich-inventory-panel-dismiss:hover {
  color: rgba(255, 248, 235, 0.96);
}

.rich-inventory-panel-dismiss:focus-visible {
  outline: 2px solid rgba(255, 248, 235, 0.76);
  outline-offset: 2px;
}

.rich-inventory-item-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rich-inventory-item-button {
  width: 100%;
  margin: 0;
  justify-content: flex-start;
  gap: 0.8rem;
  border-radius: 1rem;
  padding: 0.55rem 0.8rem;
  text-align: left;
  white-space: normal;
}

.rich-inventory-item-icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.rich-inventory-empty {
  margin: 0;
  color: rgba(255, 248, 235, 0.74);
}

.rich-attach-center {
  transform: translate(
    calc(-50% + var(--age-command-dx, var(--age-sprite-dx, 0px))),
    calc(-50% + var(--age-command-dy, var(--age-sprite-dy, 0px)))
  );
}

.rich-attach-bottom-center {
  transform: translate(
    calc(-50% + var(--age-command-dx, var(--age-sprite-dx, 0px))),
    calc(-100% + var(--age-command-dy, var(--age-sprite-dy, 0px)))
  );
}

.rich-scene-placeholder {
  min-height: 22rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rich-interaction-panel {
  position: relative;
  border-color: rgba(255, 248, 235, 0.14);
  background: rgba(15, 14, 18, 0.26);
  color: rgba(255, 248, 235, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem;
}

.rich-scene-dialog-module {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 85;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
  color: rgba(255, 248, 235, 0.95);
  transition: background 140ms ease, backdrop-filter 140ms ease, gap 190ms ease;
}

.rich-dialog-tab {
  position: absolute;
  top: 0;
  left: 1rem;
  z-index: 2;
  transform: translateY(calc(-100% + 0.18rem));
  border: 1px dashed rgba(255, 248, 235, 0.28);
  border-bottom: 0;
  border-radius: 0.85rem 0.85rem 0 0;
  background: rgba(12, 11, 14, 0.7);
  color: rgba(255, 248, 235, 0.8);
  padding: 0.3rem 0.85rem 0.4rem;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.62;
  backdrop-filter: blur(8px);
  transition:
    opacity 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 190ms ease;
}

.rich-dialog-tab:hover {
  opacity: 0.9;
  border-color: rgba(255, 248, 235, 0.42);
}

.rich-dialog-tab:focus-visible {
  outline: 2px solid rgba(255, 248, 235, 0.72);
  outline-offset: 2px;
}

.rich-dialog-module--collapsed .rich-dialog-tab {
  opacity: 1;
  background: transparent;
  border-color: rgba(255, 248, 235, 0.46);
  color: rgba(255, 248, 235, 0.94);
  transform: translateY(calc(-100% + 0.42rem));
}

.rich-scene-dialog-module.rich-dialog-surface--active {
  background:
    linear-gradient(180deg, rgba(12, 11, 14, 0), rgba(12, 11, 14, 0.42) 22%, rgba(12, 11, 14, 0.72));
  backdrop-filter: blur(8px);
}

.rich-scene-dialog-module #rich-dialog-output,
.rich-interaction-panel #rich-dialog-output {
  min-height: 0;
  max-height: min(30vh, 18rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-right: 0.2rem;
}

.rich-dialog-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 22rem;
  min-height: 0;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 190ms ease,
    opacity 170ms ease,
    transform 190ms ease,
    margin-bottom 190ms ease;
}

.rich-dialog-body.rich-dialog-body--collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
  margin-bottom: -0.35rem;
}

.rich-dialog-module--collapsed {
  gap: 0;
}

.rich-dialog-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.45rem;
}

.rich-dialog-dismiss {
  border: 0;
  background: transparent;
  color: rgba(255, 248, 235, 0.7);
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  cursor: pointer;
}

.rich-dialog-dismiss:hover {
  color: rgba(255, 248, 235, 0.92);
}

.rich-dialog-dismiss:focus-visible {
  outline: 2px solid rgba(255, 248, 235, 0.7);
  outline-offset: 2px;
}

.age-modal::backdrop {
  background: rgba(7, 6, 10, 0.62);
}

.age-modal-box {
  border: 1px solid rgba(73, 54, 34, 0.18);
  background: rgba(247, 239, 223, 0.98);
  color: #24180e;
  text-shadow: none;
  box-shadow: 0 22px 60px rgba(20, 12, 5, 0.28);
}

.age-modal-box * {
  text-shadow: none;
}

.age-modal-copy {
  color: rgba(36, 24, 14, 0.82);
}

.age-modal-box .modal-action .btn-outline {
  border-color: rgba(73, 54, 34, 0.28);
  color: #24180e;
  background: rgba(255, 255, 255, 0.28);
}

.age-modal-box .modal-action .btn-outline:hover {
  background: rgba(255, 255, 255, 0.48);
}

.age-modal-box .modal-action .btn-error {
  color: #fff8f4;
}

.rich-scene-dialog-module #command-panel,
.rich-interaction-panel #command-panel {
  border-top: 1px dashed rgba(255, 248, 235, 0.18);
  padding-top: 0.9rem;
  transition: border-color 190ms ease, padding-top 190ms ease;
}

.rich-dialog-module--collapsed #command-panel {
  border-top-color: transparent;
  padding-top: 0;
}

.rich-scene-dialog-module #rich-dialog-output .glk-normal,
.rich-scene-dialog-module #rich-dialog-output .glk-emphasized,
.rich-scene-dialog-module #rich-dialog-output .glk-subheader,
.rich-scene-dialog-module #rich-dialog-output .glk-preformatted,
.rich-scene-dialog-module #rich-dialog-output .glk-input,
.rich-interaction-panel #rich-dialog-output .glk-normal,
.rich-interaction-panel #rich-dialog-output .glk-emphasized,
.rich-interaction-panel #rich-dialog-output .glk-subheader,
.rich-interaction-panel #rich-dialog-output .glk-preformatted,
.rich-interaction-panel #rich-dialog-output .glk-input {
  color: rgba(255, 248, 235, 0.95);
}

.rich-scene-dialog-module #rich-dialog-output .glk-header,
.rich-interaction-panel #rich-dialog-output .glk-header {
  color: rgba(255, 248, 235, 0.98);
}

.rich-scene-dialog-module #rich-dialog-output .glk-note,
.rich-scene-dialog-module #rich-dialog-output .glk-blockquote,
.rich-interaction-panel #rich-dialog-output .glk-note,
.rich-interaction-panel #rich-dialog-output .glk-blockquote {
  color: rgba(255, 248, 235, 0.78);
}

.rich-scene-dialog-module #rich-dialog-output code,
.rich-interaction-panel #rich-dialog-output code {
  background: rgba(255, 248, 235, 0.12);
  color: rgba(255, 248, 235, 0.96);
}

.rich-command-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

.rich-command-form {
  display: flex;
  flex: 1 1 34rem;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  width: min(100%, 34rem);
  max-width: 34rem;
}

.rich-command-input-shell {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  border: 1px dotted rgba(255, 248, 235, 0.4);
  border-radius: 999px;
  background: transparent;
  padding: 0.65rem 0.9rem;
  cursor: text;
}

.rich-command-prompt {
  flex: 0 0 auto;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  color: rgba(255, 248, 235, 0.72);
}

.rich-command-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: rgba(255, 248, 235, 0.95);
  font: inherit;
}

.rich-command-input::placeholder {
  color: rgba(255, 248, 235, 0.52);
}

.rich-command-input:disabled,
.rich-send-button:disabled,
.rich-status-link:disabled,
.rich-restart-link:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rich-send-button {
  flex: 0 0 auto;
  border: 1px dotted rgba(255, 248, 235, 0.4);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 248, 235, 0.95);
  padding: 0.55rem 1rem;
  font: inherit;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.rich-send-button:hover {
  border-color: rgba(255, 248, 235, 0.58);
  background: rgba(255, 248, 235, 0.06);
  transform: translateY(-1px);
}

.rich-send-button:focus-visible,
.rich-restart-link:focus-visible,
.rich-command-input:focus-visible {
  outline: 2px solid rgba(255, 248, 235, 0.7);
  outline-offset: 2px;
}

.rich-restart-link {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: rgba(255, 248, 235, 0.78);
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  cursor: pointer;
}

.rich-restart-link:hover {
  color: rgba(255, 248, 235, 0.96);
}

#flash-message:empty {
  display: none;
}

.glk-line {
  white-space: pre-wrap;
  line-height: 1.6;
}

.glk-line .age-command {
  vertical-align: baseline;
}

.glk-blank {
  line-height: 0.75;
}

.glk-normal {
  color: hsl(var(--bc));
}

.glk-emphasized {
  font-style: italic;
}

.glk-header {
  display: inline-block;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.glk-subheader {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.glk-alert {
  color: hsl(var(--er));
  font-weight: 700;
}

.glk-note,
.glk-blockquote {
  color: hsl(var(--bc) / 0.8);
}

.glk-input,
#status-bar {
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
}

.glk-preformatted {
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  white-space: pre-wrap;
}

.status-line {
  white-space: pre-wrap;
}

.save-panel-card {
  background: linear-gradient(180deg, hsl(var(--b1)), hsl(var(--b2)));
}

.save-slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid hsl(var(--bc) / 0.1);
  padding-top: 0.85rem;
}

.save-slot-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.save-slot-meta {
  min-width: 0;
}

.save-slot-label {
  font-weight: 600;
}

.save-slot-detail {
  font-size: 0.85rem;
  opacity: 0.68;
}

.save-slot-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.age-command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.1rem 0.3rem 0.1rem 0;
  border: 1px solid hsl(var(--bc) / 0.2);
  border-radius: 999px;
  background: linear-gradient(180deg, hsl(var(--b1)), hsl(var(--b2)));
  color: hsl(var(--bc));
  padding: 0.2rem 0.8rem;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
  white-space: normal;
}

.age-command:hover {
  border-color: hsl(var(--bc) / 0.35);
  background: hsl(var(--b2));
  transform: translateY(-1px);
}

.age-command:focus-visible {
  outline: 2px solid hsl(var(--p));
  outline-offset: 2px;
}

.age-command-block {
  display: inline-flex;
  margin-top: 0.2rem;
  margin-bottom: 0.3rem;
}

.rich-player-response-card .age-command-block,
.rich-scene-focus-copy .age-command-block,
#rich-dialog-output .age-command-block,
#narrative-output .age-command-block {
  display: flex;
  width: 100%;
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

.rich-player-response-card .age-command-block .age-command,
.rich-scene-focus-copy .age-command-block .age-command,
#rich-dialog-output .age-command-block .age-command,
#narrative-output .age-command-block .age-command {
  width: 100%;
  min-height: 3rem;
  justify-content: flex-start;
  border-color: hsl(var(--bc) / 0.26);
  border-radius: 1rem;
  padding: 0.7rem 1rem;
  text-align: left;
}

.rich-player-response-card .age-command-block .age-command {
  background: rgba(255, 248, 235, 0.04);
}

.rich-player-response-card .age-command-block .age-command:hover {
  border-color: hsl(var(--bc) / 0.38);
  background: rgba(255, 248, 235, 0.1);
  box-shadow: 0 10px 24px hsl(var(--bc) / 0.1);
}

.rich-scene-focus-copy .age-command-block .age-command:hover,
#rich-dialog-output .age-command-block .age-command:hover,
#narrative-output .age-command-block .age-command:hover {
  border-color: hsl(var(--bc) / 0.42);
  background: linear-gradient(180deg, hsl(var(--b2)), hsl(var(--b3)));
}

.rich-scene-focus-copy .age-command-block .age-command,
#rich-dialog-output .age-command-block .age-command,
#narrative-output .age-command-block .age-command {
  background: linear-gradient(180deg, hsl(var(--b2)), hsl(var(--b3)));
}

.rich-scene-focus-copy .age-command-block .age-command:hover,
#rich-dialog-output .age-command-block .age-command:hover,
#narrative-output .age-command-block .age-command:hover {
  background: linear-gradient(180deg, hsl(var(--b3)), hsl(var(--b2)));
  box-shadow: 0 10px 24px hsl(var(--bc) / 0.12);
}

.age-hotword {
  border: 0;
  border-radius: 0;
  background: none;
  color: hsl(var(--a));
  padding: 0;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.age-hotword:hover {
  background: none;
  color: hsl(var(--ac));
}

.age-command-risky {
  border-color: hsl(var(--er) / 0.4);
  color: hsl(var(--er));
}

.age-command.age-scene-command {
  width: 100%;
  margin: 0;
  justify-content: flex-start;
  text-align: left;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px hsl(var(--bc) / 0.14);
}

.age-command.age-scene-command:hover {
  transform: translateY(-1px);
}

.age-command.age-scene-command--default {
  border-style: dotted;
  border-color: rgba(255, 248, 235, 0.62);
  background: rgba(255, 248, 235, 0.08);
  color: #fffaf3;
  box-shadow: 0 10px 24px rgba(12, 10, 7, 0.24);
}

.age-command.age-scene-command--default:hover {
  border-color: rgba(255, 248, 235, 0.82);
  background: rgba(255, 248, 235, 0.14);
  color: #fffaf3;
}

.age-command.age-scene-command--light-chip {
  border-color: rgba(70, 54, 38, 0.22);
  background: rgba(255, 247, 235, 0.94);
  color: #24180e;
}

.age-command.age-scene-command--light-chip:hover {
  border-color: rgba(70, 54, 38, 0.32);
  background: rgba(255, 247, 235, 0.98);
  color: #24180e;
}

.age-command.age-scene-command--paper {
  border-color: rgba(87, 65, 43, 0.24);
  background: rgba(245, 236, 219, 0.97);
  color: #24180e;
  box-shadow: 0 12px 24px rgba(56, 36, 17, 0.14);
}

.age-command.age-scene-command--paper:hover {
  border-color: rgba(87, 65, 43, 0.34);
  background: rgba(250, 242, 228, 0.99);
  color: #24180e;
}

.age-command.age-scene-command--dark-chip {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(20, 20, 28, 0.88);
  color: #f8f2ea;
}

.age-command.age-scene-command--dark-chip:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(28, 28, 38, 0.94);
  color: #fff8ef;
}

.age-command.age-scene-command--outline-light {
  border-color: rgba(255, 248, 235, 0.82);
  background: rgba(255, 248, 235, 0.18);
  color: #fffaf3;
  box-shadow: 0 10px 24px rgba(12, 10, 7, 0.24);
}

.age-command.age-scene-command--outline-light:hover {
  border-color: rgba(255, 248, 235, 0.92);
  background: rgba(255, 248, 235, 0.24);
  color: #fffaf3;
}

@media (max-width: 900px) {
  .rich-scene-focus-layer--anchored {
    max-width: min(48vw, 24rem);
  }

  .rich-player-response-card {
    width: min(94%, 36rem);
  }

  .rich-inventory-panel {
    padding: 1rem;
  }

  .rich-inventory-panel-card {
    width: min(94%, 28rem);
  }
}

@media (max-width: 640px) {
  .rich-app-stage {
    width: 100%;
  }

  .rich-flash-message {
    right: 0.8rem;
    bottom: 0.8rem;
    left: 0.8rem;
  }

  .rich-scene-overlay {
    width: min(calc(22vw * var(--age-overlay-scale, 1)), calc(92px * var(--age-overlay-scale, 1)));
    min-width: calc(56px * var(--age-overlay-scale, 1));
  }

  .rich-scene-command-group {
    max-width: min(58vw, 220px);
  }

  .rich-scene-focus-layer--scene {
    width: min(92%, 28rem);
    bottom: 0.75rem;
  }

  .rich-scene-focus-layer--scene.rich-scene-focus-layer--with-response-card {
    bottom: calc(0.75rem + clamp(9rem, 30vh, 14rem));
  }

  .rich-scene-focus-layer--anchored {
    max-width: min(78vw, 20rem);
  }

  .rich-scene-focus-card {
    padding: 0.85rem 0.9rem;
  }

  .rich-floating-control {
    width: 3rem;
    height: 3rem;
  }

  .rich-floating-control--bottom-left {
    left: 0.75rem;
    bottom: 0.75rem;
  }

  .rich-floating-control--bottom-right {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .rich-floating-control-icon {
    width: 1.35rem;
    height: 1.35rem;
  }

  .rich-player-response-card {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    width: min(96%, 28rem);
    bottom: 0.75rem;
    padding: 0.85rem;
  }

  .rich-player-response-card-portrait {
    width: 100%;
    min-width: 0;
    max-height: 8rem;
  }

  .age-command-prompt {
    flex-direction: column;
    align-items: stretch;
  }

  .age-command-prompt-submit {
    width: 100%;
  }

  .age-scene-command {
    padding-inline: 0.7rem;
    font-size: 0.92rem;
  }

  .rich-command-row {
    justify-content: flex-start;
  }

  .rich-command-form {
    flex-wrap: nowrap;
    gap: 0.55rem;
    width: 100%;
    max-width: 30rem;
  }

  .rich-command-input-shell {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.55rem 0.75rem;
  }

  .rich-send-button {
    padding: 0.5rem 0.85rem;
  }

  .rich-scene-dialog-module {
    padding: 0.8rem;
  }

  .rich-status-volume-slider {
    width: 4.75rem;
  }

  .rich-inventory-panel {
    align-items: flex-end;
    padding: 0.5rem;
  }

  .rich-inventory-panel-card {
    width: min(96%, 26rem);
  }
}

@media (max-width: 460px) {
  .rich-scene-focus-countdown {
    top: 0.55rem;
    right: 0.55rem;
  }
}

.grain-overlay::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  animation: grain 0.4s steps(1) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-5%, -10%); }
  20%  { transform: translate(10%, 5%); }
  30%  { transform: translate(-3%, 8%); }
  40%  { transform: translate(7%, -4%); }
  50%  { transform: translate(-8%, 2%); }
  60%  { transform: translate(4%, -7%); }
  70%  { transform: translate(-6%, 9%); }
  80%  { transform: translate(9%, -3%); }
  90%  { transform: translate(-2%, 6%); }
  100% { transform: translate(5%, -8%); }
}

/* Static bundle loading screen (browser_index.html), shown until the game replaces it. */
.age-boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.5rem 1rem;
  background: #000;
  color: #e8e2d4;
  text-align: center;
}

.age-boot-title {
  max-width: 32rem;
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.age-boot-status,
.age-boot-detail {
  margin: 0;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}

.age-boot-status::after {
  content: "";
  display: inline-block;
  width: 1.5em;
  text-align: left;
  animation: age-boot-dots 1.2s steps(4, end) infinite;
}

.age-boot--failed .age-boot-status::after {
  content: none;
  animation: none;
}

.age-boot-detail {
  max-width: 32rem;
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.45;
  overflow-wrap: anywhere;
}

@keyframes age-boot-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

@media (prefers-reduced-motion: reduce) {
  .age-boot-status::after {
    content: "...";
    animation: none;
  }
}
