:root {
  --game-gold: #e8c86f;
  --game-gold-soft: rgba(232, 200, 111, 0.42);
  --game-cyan: #76e9f2;
  --game-red: #d92d52;
  --game-ink: rgba(3, 2, 7, 0.9);
  --game-panel: rgba(5, 3, 9, 0.96);
  --game-header-height: 4.8rem;
  --game-command-width: 14.5rem;
  --game-stage-left: clamp(1.5rem, 4vw, 4.5rem);
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #020104;
}

body {
  isolation: isolate;
}

.cathedral-canvas {
  opacity: 1;
  filter: saturate(1.08) contrast(1.04);
}

.ritual-canvas {
  opacity: 0.36;
}

.app-bar {
  position: fixed;
  z-index: 60;
  inset: 0 0 auto;
  width: 100%;
  height: var(--game-header-height);
  min-height: 0;
  display: grid;
  grid-template-columns: 17rem minmax(22rem, 1fr) 16rem;
  align-items: stretch;
  gap: 1rem;
  padding: 0 1.15rem;
  border: 0;
  background:
    linear-gradient(180deg, rgba(2, 1, 5, 0.98), rgba(3, 2, 7, 0.82) 68%, transparent),
    linear-gradient(90deg, rgba(217, 45, 82, 0.12), transparent 24% 76%, rgba(118, 233, 242, 0.08));
  box-shadow: none;
  pointer-events: none;
}

.app-bar::after {
  content: "";
  position: absolute;
  right: 1.15rem;
  bottom: 0;
  left: 1.15rem;
  height: 1px;
  background: linear-gradient(90deg, var(--game-red), var(--game-gold) 18%, transparent 42% 58%, var(--game-gold) 82%, var(--game-cyan));
  opacity: 0.66;
}

.app-bar > * {
  pointer-events: auto;
}

.brand-lockup {
  grid-area: auto;
  grid-column: 1;
  grid-row: 1;
  height: 100%;
  padding: 0.5rem 0;
  border: 0;
  background: transparent;
}

.brand-lockup::after {
  right: 0;
  bottom: 0.8rem;
}

.brand-copy h1 {
  font-size: 1.28rem;
}

.brand-copy .eyebrow {
  font-size: 0.5rem;
}

.header-model {
  grid-area: auto;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  width: min(100%, 54rem);
  height: 3.55rem;
  justify-self: center;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  padding: 0.45rem 0.9rem 0.45rem 1.15rem;
  border: 1px solid rgba(232, 200, 111, 0.36);
  border-left: 3px solid var(--game-red);
  background:
    linear-gradient(90deg, rgba(217, 45, 82, 0.11), transparent 28%),
    rgba(4, 2, 8, 0.84);
  box-shadow: 0 0 2rem rgba(0, 0, 0, 0.72), inset 0 0 1.5rem rgba(232, 200, 111, 0.025);
  clip-path: polygon(0.7rem 0, 100% 0, 100% calc(100% - 0.7rem), calc(100% - 0.7rem) 100%, 0 100%, 0 0.7rem);
}

.header-model:hover,
.header-model:focus-visible {
  border-color: var(--game-gold);
  background:
    linear-gradient(90deg, rgba(217, 45, 82, 0.2), rgba(118, 233, 242, 0.06)),
    rgba(6, 3, 10, 0.94);
  transform: translateY(-1px);
}

.model-launcher-kicker {
  font-size: 0.48rem;
}

.header-model > strong {
  font-size: 1rem;
}

.moon-widget {
  min-width: 7rem;
}

.connection-status {
  grid-area: auto;
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  width: 100%;
  min-height: 2.65rem;
  justify-content: flex-end;
  border: 0;
  border-right: 2px solid var(--game-cyan);
  background: linear-gradient(90deg, transparent, rgba(4, 3, 8, 0.82));
  clip-path: none;
}

.workspace {
  position: fixed;
  z-index: auto;
  inset: 0;
  width: 100%;
  height: 100svh;
  display: block;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
}

.chat-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.chat-panel::after {
  display: none;
}

.chat-toolbar {
  display: none;
}

.summoning-chamber {
  display: none;
}

.game-status-hud {
  position: fixed;
  z-index: 28;
  top: 5.7rem;
  left: 1.5rem;
  width: 19.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  color: #fff4cf;
  pointer-events: none;
  transition: opacity 260ms ease, transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.game-status-hud > div {
  position: relative;
  min-width: 0;
  padding: 0.55rem 0.7rem 0.6rem;
  border: 1px solid rgba(232, 200, 111, 0.23);
  border-left: 2px solid var(--game-gold);
  background: linear-gradient(105deg, rgba(6, 4, 10, 0.9), rgba(6, 4, 10, 0.56));
  box-shadow: inset 0 0 1.3rem rgba(0, 0, 0, 0.52), 0 0 1.5rem rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(8px);
  clip-path: polygon(0 0, calc(100% - 0.5rem) 0, 100% 0.5rem, 100% 100%, 0 100%);
}

.game-status-hud span,
.game-status-hud small,
.game-status-hud b {
  display: block;
  overflow: hidden;
  font-family: var(--lab-mono);
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-status-hud span {
  color: rgba(232, 200, 111, 0.58);
  font-size: 0.46rem;
}

.game-status-hud strong {
  display: block;
  overflow: hidden;
  color: #fff3c2;
  font-family: "Yu Mincho", Georgia, serif;
  font-size: 1.18rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-shadow: 0 0 1rem rgba(232, 200, 111, 0.25);
  white-space: nowrap;
}

.game-status-hud small {
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.36);
  font-size: 0.41rem;
}

.game-status-hud .location-plaque,
.game-status-hud .contract-price-plaque {
  grid-column: 1 / -1;
}

.game-status-hud .location-plaque {
  min-height: 4rem;
  padding-left: 1rem;
  border-left-color: var(--game-red);
  background:
    linear-gradient(100deg, rgba(60, 5, 22, 0.48), transparent 68%),
    rgba(4, 2, 8, 0.82);
}

.economy-plaque strong,
.ritual-price-plaque strong {
  margin-top: 0.15rem;
  font-family: var(--lab-mono);
  font-size: 1.05rem;
}

.economy-plaque {
  border-left-color: var(--game-cyan) !important;
}

.economy-plaque strong {
  color: #d9fcff;
}

.ritual-price-plaque {
  border-left-color: var(--game-gold) !important;
}

.contract-price-plaque {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.7rem;
}

.contract-price-plaque > span {
  grid-column: 1 / -1;
}

.contract-price-plaque b {
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.48rem;
}

.contract-price-plaque b > strong {
  display: inline;
  margin-left: 0.25rem;
  color: #ffe783;
  font-family: var(--lab-mono);
  font-size: 0.72rem;
}

.game-command-menu {
  position: fixed;
  z-index: 32;
  top: 50%;
  right: 1.45rem;
  width: var(--game-command-width);
  display: grid;
  gap: 0.28rem;
  color: white;
  transform: translateY(-42%);
  transition: opacity 240ms ease, transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.game-command-menu header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 0.65rem 0.35rem;
  border-bottom: 1px solid rgba(232, 200, 111, 0.34);
  color: rgba(232, 200, 111, 0.66);
  font-family: var(--lab-mono);
}

.game-command-menu header span {
  font-size: 0.52rem;
}

.game-command-menu header b {
  color: rgba(255, 244, 207, 0.54);
  font-family: "Yu Mincho", Georgia, serif;
  font-size: 0.68rem;
  font-weight: 500;
}

.game-command-menu button {
  position: relative;
  width: 100%;
  height: 3.55rem;
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.7rem 0.42rem 0.6rem;
  overflow: hidden;
  border: 1px solid rgba(232, 200, 111, 0.2);
  border-right: 3px solid rgba(232, 200, 111, 0.54);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(217, 45, 82, 0.08), transparent 32%),
    rgba(4, 3, 8, 0.8);
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  box-shadow: inset 0 0 1.2rem rgba(0, 0, 0, 0.52), 0 0 1rem rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
  clip-path: polygon(0.55rem 0, 100% 0, 100% 100%, 0 100%, 0 0.55rem);
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease, filter 140ms ease;
}

.game-command-menu button::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0.18rem;
  background: var(--game-red);
  opacity: 0.2;
  transition: opacity 140ms ease, box-shadow 140ms ease;
}

.game-command-menu button > svg {
  width: 1.3rem;
  height: 1.3rem;
  justify-self: center;
  color: var(--game-gold);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 0.4rem rgba(232, 200, 111, 0.25));
}

.game-command-menu button span {
  min-width: 0;
  display: grid;
  gap: 0.06rem;
}

.game-command-menu button strong,
.game-command-menu button small {
  overflow: hidden;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-command-menu button strong {
  font-family: "Yu Mincho", Georgia, serif;
  font-size: 0.8rem;
  font-weight: 600;
}

.game-command-menu button small {
  color: rgba(118, 233, 242, 0.42);
  font-family: var(--lab-mono);
  font-size: 0.43rem;
}

.game-command-menu button em {
  width: 1.25rem;
  height: 1.25rem;
  display: none;
  place-items: center;
  border: 1px solid #ff496b;
  color: #fff;
  background: rgba(217, 45, 82, 0.64);
  font-family: var(--lab-mono);
  font-size: 0.58rem;
  font-style: normal;
  animation: command-alert 1.1s steps(2, jump-none) infinite;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.game-command-menu button[data-required="true"] em {
  display: grid;
}

.game-command-menu button:hover,
.game-command-menu button:focus-visible,
.game-command-menu button.is-active {
  z-index: 1;
  border-color: rgba(118, 233, 242, 0.68);
  border-right-color: var(--game-cyan);
  background:
    linear-gradient(90deg, rgba(217, 45, 82, 0.22), rgba(118, 233, 242, 0.1)),
    rgba(7, 4, 12, 0.94);
  color: white;
  filter: drop-shadow(0 0 0.75rem rgba(118, 233, 242, 0.18));
  transform: translateX(-0.65rem);
}

.game-command-menu button:hover::before,
.game-command-menu button:focus-visible::before,
.game-command-menu button.is-active::before {
  opacity: 1;
  box-shadow: 0 0 0.85rem var(--game-red);
}

.game-command-menu button.is-activated {
  animation: command-confirm 420ms ease-out;
}

.run-banner {
  position: fixed;
  z-index: 35;
  top: 5.75rem;
  left: 50%;
  width: min(27rem, calc(100% - 44rem));
  min-height: 2.7rem;
  margin: 0;
  padding: 0.52rem 0.78rem;
  border: 1px solid rgba(232, 200, 111, 0.2);
  border-left: 3px solid rgba(232, 200, 111, 0.5);
  background: rgba(4, 3, 8, 0.72);
  box-shadow: 0 0 1.6rem rgba(0, 0, 0, 0.52), inset 0 0 1rem rgba(232, 200, 111, 0.025);
  backdrop-filter: blur(9px);
  pointer-events: auto;
  transform: translateX(-50%);
  clip-path: polygon(0.45rem 0, 100% 0, 100% calc(100% - 0.45rem), calc(100% - 0.45rem) 100%, 0 100%, 0 0.45rem);
}

.run-copy strong {
  font-size: 0.65rem;
}

.run-copy span,
.run-banner time {
  font-size: 0.5rem;
}

.messages {
  position: fixed;
  z-index: 30;
  right: calc(var(--game-command-width) + 3.4rem);
  bottom: 10rem;
  left: var(--game-stage-left);
  width: auto;
  height: min(12.5rem, 22vh);
  min-height: 8.5rem;
  display: flex;
  gap: 0.7rem;
  padding: 2.35rem 1.45rem 1rem;
  overflow-y: auto;
  border: 1px solid rgba(232, 200, 111, 0.34);
  border-left: 3px solid var(--game-red);
  background:
    linear-gradient(100deg, rgba(54, 5, 20, 0.14), transparent 28%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 4px),
    rgba(3, 2, 7, 0.86);
  box-shadow: 0 0 2.5rem rgba(0, 0, 0, 0.72), inset 0 0 2rem rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(11px);
  pointer-events: auto;
  scrollbar-color: rgba(232, 200, 111, 0.45) transparent;
  clip-path: polygon(0.75rem 0, 100% 0, 100% calc(100% - 0.75rem), calc(100% - 0.75rem) 100%, 0 100%, 0 0.75rem);
}

.messages::before {
  content: "ORACLE LOG // MITRA CHANNEL";
  position: absolute;
  top: 0.7rem;
  left: 1.45rem;
  color: rgba(232, 200, 111, 0.58);
  font-family: var(--lab-mono);
  font-size: 0.48rem;
}

.messages::after {
  content: "";
  position: absolute;
  top: 1.45rem;
  right: 1.45rem;
  left: 1.45rem;
  height: 1px;
  background: linear-gradient(90deg, var(--game-red), rgba(232, 200, 111, 0.38), transparent 82%);
}

.message {
  flex: 0 0 auto;
  max-width: min(78%, 48rem);
  padding: 0.62rem 0.8rem;
  border-radius: 0;
  backdrop-filter: none;
}

.message.assistant,
.message.user,
.message.status,
.message.error {
  clip-path: polygon(0.42rem 0, 100% 0, 100% calc(100% - 0.42rem), calc(100% - 0.42rem) 100%, 0 100%, 0 0.42rem);
}

.message-body {
  font-size: 0.88rem;
  line-height: 1.55;
}

.message.status {
  align-self: center;
  padding-block: 0.3rem;
}

.empty-state {
  margin: auto;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: center;
}

.empty-state strong {
  color: rgba(255, 244, 207, 0.68);
  font-family: "Yu Mincho", Georgia, serif;
  font-size: 0.75rem;
  font-weight: 500;
}

.empty-mark {
  width: 2.3rem;
  height: 2.3rem;
}

.composer {
  position: fixed;
  z-index: 34;
  right: calc(var(--game-command-width) + 3.4rem);
  bottom: 1.2rem;
  left: var(--game-stage-left);
  width: auto;
  height: 7.85rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8.8rem;
  gap: 0.7rem;
  padding: 1.25rem 0.8rem 0.72rem;
  border: 1px solid rgba(118, 233, 242, 0.34);
  border-top: 2px solid rgba(118, 233, 242, 0.66);
  background:
    linear-gradient(90deg, rgba(118, 233, 242, 0.035), transparent 38%),
    rgba(3, 2, 7, 0.94);
  box-shadow: 0 0 2.5rem rgba(0, 0, 0, 0.7), inset 0 0 1.5rem rgba(118, 233, 242, 0.025);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  clip-path: polygon(0 0, calc(100% - 0.7rem) 0, 100% 0.7rem, 100% 100%, 0.7rem 100%, 0 calc(100% - 0.7rem));
}

.composer::before {
  content: "ORIGIN QUERY // ORACLE INPUT";
  top: 0.35rem;
  right: auto;
  left: 0.85rem;
  color: rgba(118, 233, 242, 0.46);
  font-size: 0.43rem;
}

.composer textarea {
  grid-column: 1;
  width: 100%;
  height: 100% !important;
  min-height: 0;
  max-height: none;
  padding: 0.65rem 0.8rem;
  border: 0;
  border-left: 2px solid var(--game-cyan);
  background: rgba(0, 0, 2, 0.5);
  color: white;
  font-size: 0.9rem;
  resize: none;
  clip-path: none;
}

.composer textarea:focus {
  border-color: var(--game-cyan);
  background: rgba(3, 8, 11, 0.76);
  box-shadow: inset 0 0 1rem rgba(118, 233, 242, 0.04);
}

.composer-footer {
  grid-column: 2;
  min-width: 0;
  height: 100%;
  margin: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.45rem;
}

.composer-context {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.composer-context span:last-child {
  max-width: 100%;
}

.keyboard-hint {
  justify-self: start;
  padding: 0;
  border: 0;
}

.send-button {
  width: 100%;
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-right: 3px solid #ff6a42;
  background:
    linear-gradient(135deg, #b71439, #6c0926 72%),
    var(--game-red);
  font-family: "Yu Mincho", Georgia, serif;
  font-size: 0.78rem;
  white-space: nowrap;
  clip-path: polygon(0.55rem 0, 100% 0, 100% calc(100% - 0.55rem), calc(100% - 0.55rem) 100%, 0 100%, 0 0.55rem);
}

.send-button:hover,
.send-button:focus-visible {
  border-color: #fff0cf;
  background: linear-gradient(135deg, #eb315a, #8f0c32 72%);
  color: white;
  box-shadow: 0 0 1.5rem rgba(217, 45, 82, 0.34);
  transform: translateY(-1px);
}

.send-arrow {
  width: 1.6rem;
  height: 1.6rem;
}

.frame-readout {
  display: none;
}

.fusion-slots {
  position: fixed;
  z-index: 22;
  bottom: calc(min(12.5rem, 22vh) + 11.4rem);
  width: min(44rem, calc(100% - 42rem));
  opacity: 0.12;
}

body[data-cathedral-state="sending"] .fusion-slots,
body[data-cathedral-state="waiting"] .fusion-slots,
body[data-cathedral-state="thinking"] .fusion-slots,
body[data-cathedral-state="streaming"] .fusion-slots {
  opacity: 0.92;
}

.manor-master-label {
  position: fixed;
  top: 30%;
}

.vrm-contract-status {
  position: fixed;
  top: 58.5%;
}

.game-panel-scrim {
  position: fixed;
  z-index: 69;
  inset: 0;
  display: block;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 2, 0.54);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(2px);
  transition: opacity 240ms ease, visibility 0s linear 240ms;
}

body:not([data-game-panel="none"]) .game-panel-scrim {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.settings-panel,
.inspect-panel {
  position: fixed;
  z-index: 80;
  top: 0;
  bottom: 0;
  width: min(27rem, calc(100vw - 2rem));
  height: 100svh;
  min-height: 0;
  padding-top: 0;
  overflow-y: auto;
  border: 0;
  background:
    linear-gradient(180deg, rgba(217, 45, 82, 0.12), transparent 18%),
    repeating-linear-gradient(135deg, rgba(232, 200, 111, 0.016) 0 1px, transparent 1px 8px),
    rgba(4, 2, 8, 0.98);
  box-shadow: 0 0 5rem rgba(0, 0, 0, 0.9), inset 0 0 3rem rgba(232, 200, 111, 0.02);
  visibility: hidden;
  pointer-events: auto;
  transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 520ms;
}

.settings-panel {
  left: 0;
  border-right: 1px solid rgba(232, 200, 111, 0.5);
  transform: translateX(calc(-100% - 2rem));
}

.inspect-panel {
  right: 0;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  border-left: 1px solid rgba(118, 233, 242, 0.46);
  transform: translateX(calc(100% + 2rem));
}

.settings-panel::after,
.inspect-panel::before {
  display: none;
}

body[data-game-panel="settings"] .settings-panel,
body[data-game-panel="records"] .inspect-panel {
  visibility: visible;
  transform: translateX(0);
  transition-delay: 0s;
}

body:not([data-game-panel="none"]) .game-command-menu,
body:not([data-game-panel="none"]) .game-status-hud {
  opacity: 0.18;
  pointer-events: none;
}

body[data-game-panel="settings"] .game-command-menu {
  transform: translate(1rem, -42%);
}

body[data-game-panel="settings"] .game-status-hud {
  transform: translateX(1rem);
}

body[data-game-panel="records"] .game-command-menu {
  transform: translate(-1rem, -42%);
}

body[data-game-panel="records"] .game-status-hud {
  transform: translateX(-1rem);
}

.panel-title {
  position: sticky;
  z-index: 4;
  top: 0;
  min-height: 5.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.9rem 1.15rem;
  border-top: 3px solid var(--game-red);
  border-bottom: 1px solid rgba(232, 200, 111, 0.32);
  background:
    linear-gradient(90deg, rgba(217, 45, 82, 0.14), transparent 48%),
    rgba(4, 2, 8, 0.98);
  backdrop-filter: blur(12px);
}

.inspect-title {
  border-top-color: var(--game-cyan);
}

.panel-title h2 {
  color: #fff2c5;
  font-family: "Yu Mincho", Georgia, serif;
  font-size: 1.32rem;
}

.game-panel-close {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232, 200, 111, 0.3);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.24);
  color: rgba(255, 255, 255, 0.7);
  clip-path: polygon(0.45rem 0, 100% 0, 100% calc(100% - 0.45rem), calc(100% - 0.45rem) 100%, 0 100%, 0 0.45rem);
}

.game-panel-close:hover,
.game-panel-close:focus-visible {
  border-color: var(--game-red);
  color: white;
  background: rgba(217, 45, 82, 0.18);
}

.game-panel-close svg {
  width: 1rem;
  height: 1rem;
}

.settings-section {
  margin: 0;
  padding: 1rem 1.15rem 1.15rem;
  border-bottom: 1px solid rgba(232, 200, 111, 0.18);
  background: rgba(0, 0, 0, 0.08);
}

.settings-section::before,
.settings-section::after {
  display: none;
}

.credit-widget {
  margin-right: -1.15rem;
  margin-left: -1.15rem;
  padding-inline: 1.15rem;
}

.settings-panel .system-drawer {
  margin: 0;
  border-top: 0;
  border-bottom: 1px solid rgba(232, 200, 111, 0.24);
  background: rgba(0, 0, 0, 0.18);
}

.settings-panel .system-drawer summary {
  min-height: 3.2rem;
  padding-inline: 1.15rem;
}

.settings-panel .system-drawer textarea {
  width: calc(100% - 2.3rem);
  min-height: 8rem;
  margin: 0 1.15rem 1rem;
}

.motion-credit {
  margin: 0;
  padding: 0.72rem 1.15rem 1rem;
  border-bottom: 1px solid rgba(232, 200, 111, 0.18);
  color: rgba(230, 220, 194, 0.62);
  font-size: 0.68rem;
  line-height: 1.55;
}

.inspect-panel .metrics-grid,
.inspect-panel .finish-row,
.inspect-panel .inspect-tabs,
.inspect-panel .inspector {
  margin: 0;
}

.inspect-panel .inspector {
  min-height: 18rem;
}

body[data-game-overlay="compendium"] .game-command-menu,
body[data-game-overlay="compendium"] .game-status-hud {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
}

.model-picker {
  padding: 0.8rem;
  background: rgba(0, 0, 2, 0.72);
  backdrop-filter: blur(7px);
}

.model-picker[open] .model-picker-frame {
  animation: compendium-enter 480ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.model-picker-frame {
  border-width: 1px;
  border-top: 3px solid var(--game-red);
  box-shadow: 0 0 7rem rgba(0, 0, 0, 0.96), 0 0 2rem rgba(217, 45, 82, 0.18);
}

@keyframes command-alert {
  0%, 100% { opacity: 0.48; }
  50% { opacity: 1; filter: brightness(1.5); }
}

@keyframes command-confirm {
  0% { filter: brightness(1); }
  38% { filter: brightness(2.2); transform: translateX(-0.8rem) scale(1.02); }
  100% { filter: brightness(1); }
}

@keyframes compendium-enter {
  from { opacity: 0; transform: perspective(60rem) rotateX(3deg) scale(0.95); }
  to { opacity: 1; transform: perspective(60rem) rotateX(0) scale(1); }
}

@media (max-width: 1100px) {
  :root {
    --game-command-width: 11.5rem;
    --game-stage-left: 1.2rem;
  }

  .app-bar {
    grid-template-columns: 13.5rem minmax(18rem, 1fr) 11rem;
    gap: 0.55rem;
  }

  .brand-signal,
  .model-launcher-kicker,
  .moon-widget small {
    display: none;
  }

  .game-status-hud {
    width: 16rem;
  }

  .location-plaque small,
  .connection-status span:last-child {
    display: none;
  }

  .messages,
  .composer {
    right: calc(var(--game-command-width) + 2.2rem);
  }

  .fusion-slots {
    width: min(38rem, calc(100% - 31rem));
  }
}

@media (max-width: 760px) {
  :root {
    --game-header-height: 8rem;
    --game-stage-left: 0.55rem;
  }

  .app-bar {
    height: var(--game-header-height);
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 3.4rem 4rem;
    gap: 0;
    padding: 0 0.55rem;
  }

  .app-bar::after {
    right: 0.55rem;
    left: 0.55rem;
  }

  .brand-lockup {
    grid-column: 1;
    grid-row: 1;
    padding: 0.3rem 0;
  }

  .brand-copy h1 {
    font-size: 1rem;
  }

  .brand-copy .eyebrow {
    font-size: 0.38rem;
  }

  .brand-mark {
    width: 2rem;
    height: 2rem;
  }

  .connection-status {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 5.4rem;
    padding-inline: 0.55rem;
  }

  .header-model {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 3.35rem;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding-inline: 0.8rem;
  }

  .header-model > strong {
    font-size: 0.88rem;
  }

  .model-launcher-kicker,
  .moon-widget,
  .model-launcher-meta {
    display: none;
  }

  .game-command-menu {
    top: 8.35rem;
    right: 0.55rem;
    left: 0.55rem;
    width: auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.2rem;
    transform: none;
  }

  .game-command-menu header {
    display: none;
  }

  .game-command-menu button {
    height: 3.5rem;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    justify-items: center;
    gap: 0.15rem;
    padding: 0.35rem 0.15rem;
    border-right-width: 1px;
    text-align: center;
  }

  .game-command-menu button > svg {
    width: 1rem;
    height: 1rem;
  }

  .game-command-menu button span {
    justify-items: center;
  }

  .game-command-menu button strong {
    max-width: 100%;
    font-size: 0.55rem;
  }

  .game-command-menu button small,
  .game-command-menu button em {
    display: none !important;
  }

  .game-command-menu button:hover,
  .game-command-menu button:focus-visible,
  .game-command-menu button.is-active {
    transform: translateY(0.1rem);
  }

  .game-status-hud {
    top: 12.2rem;
    right: 0.55rem;
    left: 0.55rem;
    width: auto;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.2rem;
  }

  .game-status-hud .location-plaque {
    display: none;
  }

  .game-status-hud .contract-price-plaque {
    grid-column: auto;
    grid-template-columns: 1fr;
    gap: 0.12rem;
  }

  .game-status-hud .contract-price-plaque > span,
  .contract-price-plaque b:nth-of-type(2) {
    display: none;
  }

  .game-status-hud > div {
    min-height: 3.25rem;
    padding: 0.42rem 0.5rem;
  }

  .game-status-hud span {
    font-size: 0.38rem;
  }

  .game-status-hud strong,
  .economy-plaque strong,
  .ritual-price-plaque strong {
    font-size: 0.78rem;
  }

  .game-status-hud small {
    font-size: 0.36rem;
  }

  .run-banner {
    top: 15.85rem;
    width: calc(100% - 1.1rem);
    min-height: 2.45rem;
  }

  .manor-master-label {
    top: 39%;
    opacity: 0.38;
  }

  .vrm-contract-status {
    top: 53%;
    opacity: 0.6;
  }

  .fusion-slots {
    display: none;
  }

  .messages {
    right: 0.55rem;
    bottom: 8.65rem;
    left: 0.55rem;
    height: 9.3rem;
    min-height: 0;
    padding: 2rem 0.75rem 0.7rem;
  }

  .messages::before {
    top: 0.55rem;
    left: 0.75rem;
  }

  .messages::after {
    top: 1.3rem;
    right: 0.75rem;
    left: 0.75rem;
  }

  .message {
    max-width: 88%;
    padding: 0.5rem 0.62rem;
  }

  .message-body {
    font-size: 0.78rem;
  }

  .composer {
    right: 0.55rem;
    bottom: 0.55rem;
    left: 0.55rem;
    height: 7.6rem;
    grid-template-columns: minmax(0, 1fr) 7.25rem;
    padding: 1.15rem 0.5rem 0.5rem;
  }

  .composer textarea {
    padding: 0.55rem 0.62rem;
    font-size: 0.82rem;
  }

  .composer-context span:last-child,
  .keyboard-hint {
    display: none;
  }

  .send-button {
    font-size: 0.62rem;
  }

  .settings-panel,
  .inspect-panel {
    width: 100vw;
    max-width: none;
  }

  body:not([data-game-panel="none"]) .game-command-menu,
  body:not([data-game-panel="none"]) .game-status-hud {
    transform: none;
  }

  .model-picker {
    padding: 0;
  }
}

@media (max-height: 720px) and (min-width: 761px) {
  .game-status-hud {
    top: 5.25rem;
    transform: scale(0.9);
    transform-origin: top left;
  }

  .game-command-menu {
    transform: translateY(-43%) scale(0.92);
    transform-origin: right center;
  }

  .messages {
    bottom: 8.5rem;
    height: 8.5rem;
  }

  .composer {
    bottom: 0.75rem;
    height: 7rem;
  }

  .fusion-slots {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-command-menu button,
  .game-command-menu,
  .game-status-hud,
  .settings-panel,
  .inspect-panel,
  .game-panel-scrim,
  .model-picker-frame {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
