:root {
  --ultron-amber: #ffaa30;
  --ultron-hot: #ffcc66;
  --ultron-dim: #884400;
}

html[data-preview-unlocked="true"] body,
body {
  background: #000;
}

body::before {
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 145, 35, 0.08), transparent 34%),
    radial-gradient(circle at 50% 60%, rgba(255, 90, 10, 0.03), transparent 48%),
    #000;
}

body::after {
  background:
    linear-gradient(180deg, transparent 0 62%, rgba(0, 0, 0, 0.82) 100%),
    radial-gradient(circle at 50% 42%, rgba(255, 170, 48, 0.05), transparent 42%);
}

.app-shell {
  width: min(100%, 860px);
}

.brand-mark,
.status-dot {
  color: var(--ultron-hot);
}

.brand-mark {
  text-shadow: 0 0 9px rgba(255, 170, 48, 0.9), 0 0 28px rgba(255, 120, 20, 0.4);
}

.brand-copy h1 {
  font-family: "Courier New", ui-monospace, monospace;
  letter-spacing: 0.34em;
}

.brand-copy p,
.status,
.dock-label,
.more-eyebrow,
.message-author {
  font-family: "Courier New", ui-monospace, monospace;
}

.status {
  border-color: rgba(255, 170, 48, 0.28);
  background: rgba(12, 6, 0, 0.48);
  box-shadow: inset 0 0 16px rgba(255, 140, 20, 0.06);
}

.status-dot {
  background: var(--ultron-amber);
  box-shadow: 0 0 14px rgba(255, 170, 48, 0.88);
}

.core-stage::before {
  inset: 0;
  border-radius: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 140, 20, 0.08), transparent 46%);
  filter: blur(18px);
}

.presence-stack {
  width: min(100%, 760px);
  gap: 0;
}

.core-frame {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 170, 48, 0.16);
  border-radius: 18px;
  background: #000;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(255, 120, 20, 0.07),
    inset 0 0 46px rgba(255, 140, 20, 0.035);
}

.ultron-shell {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(60, 24, 0, 0.16), transparent 38%),
    linear-gradient(180deg, #020100, #000 58%, #030100);
  font-family: "Courier New", ui-monospace, monospace;
  isolation: isolate;
}

.ultron-canvas-host {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: grab;
  touch-action: none;
}

.ultron-canvas-host:active {
  cursor: grabbing;
}

.ultron-canvas-host canvas {
  display: block;
  width: 100%;
  height: 100%;
  filter:
    drop-shadow(0 0 5px rgba(255, 170, 48, 0.26))
    drop-shadow(0 0 18px rgba(255, 110, 10, 0.16));
}

.ultron-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ultron-vignette {
  z-index: 5;
  background: radial-gradient(ellipse at center, transparent 38%, rgba(0, 0, 0, 0.8) 100%);
}

.ultron-grain {
  z-index: 6;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px;
  mix-blend-mode: screen;
}

.ultron-scanlines {
  z-index: 7;
  opacity: 0.28;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 2px,
    rgba(0, 0, 0, 0.18) 4px
  );
}

.ultron-hud {
  position: absolute;
  z-index: 9;
  color: var(--ultron-amber);
  font-family: "Courier New", ui-monospace, monospace;
  text-shadow: 0 0 8px rgba(255, 170, 48, 0.72);
  user-select: none;
  pointer-events: none;
}

.ultron-hud-title,
.ultron-hud-state {
  display: none !important;
}

.ultron-hud-title {
  top: 18px;
  left: 18px;
  font-size: 11px;
  letter-spacing: 0.3em;
  opacity: 0.72;
}

.ultron-hud-title::after {
  content: "";
  display: block;
  width: 122px;
  height: 1px;
  margin-top: 6px;
  background: linear-gradient(90deg, rgba(255, 170, 48, 0.8), transparent);
}

.ultron-hud-state {
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 170, 48, 0.28);
  border-radius: 3px;
  background: rgba(20, 10, 0, 0.4);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.ultron-state-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ultron-hot);
  box-shadow: 0 0 10px rgba(255, 170, 48, 0.95);
}

.ultron-hud-hint {
  bottom: 17px;
  left: 18px;
  font-size: 9px;
  letter-spacing: 0.12em;
  opacity: 0.44;
}

.ultron-hud-meta {
  right: 18px;
  bottom: 17px;
  font-size: 9px;
  letter-spacing: 0.18em;
  opacity: 0.42;
}

.core-frame[data-state="offline"] .ultron-shell,
[data-aster-core][data-state="offline"] .ultron-shell {
  filter: grayscale(0.8) brightness(0.55);
}

[data-aster-core][data-state="thinking"] .ultron-hud-state,
[data-aster-core][data-state="tool"] .ultron-hud-state,
[data-aster-core][data-state="speaking"] .ultron-hud-state {
  border-color: rgba(255, 204, 102, 0.58);
  color: var(--ultron-hot);
  box-shadow: inset 0 0 15px rgba(255, 140, 20, 0.09);
}

.conversation {
  border-top-color: rgba(255, 170, 48, 0.12);
}

.message-system {
  border-color: rgba(255, 170, 48, 0.1);
}

.message-author {
  color: var(--ultron-amber);
}

.send-button,
.mic-button,
.console-nav-button {
  border-color: rgba(255, 170, 48, 0.22);
}

.send-button:hover,
.mic-button:hover,
.console-nav-button:hover {
  border-color: rgba(255, 204, 102, 0.48);
}

@media (max-width: 600px) {
  .ultron-hud-title {
    top: 14px;
    left: 14px;
    font-size: 9px;
  }

  .ultron-hud-state {
    top: 14px;
    right: 14px;
  }

  .ultron-hud-hint {
    display: none;
  }

  .ultron-hud-meta {
    right: 14px;
    bottom: 13px;
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ultron-grain,
  .ultron-scanlines {
    opacity: 0.02;
  }
}