:root {
  --amber: #ffad16;
  --amber-hot: #ffd45a;
  --amber-white: #fff2b4;
  --amber-dim: rgba(255, 167, 20, 0.25);
  --bg: #010202;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(72, 39, 0, 0.22), transparent 34%),
    radial-gradient(circle at 50% 50%, #07100f 0%, #020504 44%, #010202 100%);
  color: white;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255, 183, 50, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 183, 50, 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.app,
#starfield,
#hologram {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#starfield {
  opacity: 0.75;
}

#hologram {
  filter: saturate(1.18);
}

.hud-frame {
  position: absolute;
  inset: 20px;
  pointer-events: none;
  opacity: 0.38;
}

.corner {
  position: absolute;
  width: 78px;
  height: 78px;
}

.corner::before,
.corner::after {
  content: "";
  position: absolute;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  box-shadow: 0 0 10px rgba(255, 173, 22, 0.45);
}

.corner::before {
  width: 78px;
  height: 1px;
}

.corner::after {
  width: 1px;
  height: 78px;
  background: linear-gradient(transparent, var(--amber), transparent);
}

.corner-tl {
  top: 0;
  left: 0;
}

.corner-tr {
  top: 0;
  right: 0;
  transform: scaleX(-1);
}

.corner-bl {
  bottom: 0;
  left: 0;
  transform: scaleY(-1);
}

.corner-br {
  right: 0;
  bottom: 0;
  transform: scale(-1);
}

.scan-line {
  position: absolute;
  left: 7%;
  right: 7%;
  height: 1px;
  top: 0;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 204, 90, 0.6), transparent);
  box-shadow: 0 0 14px rgba(255, 173, 22, 0.45);
  animation: scan 6.5s linear infinite;
}

.status-dot {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  transform: translateX(-50%);
  opacity: 0.35;
  box-shadow: 0 0 12px var(--amber);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

body[data-state="listening"] .status-dot {
  opacity: 1;
  transform: translateX(-50%) scale(1.5);
  animation: statusPulse 0.8s ease-in-out infinite;
}

body[data-state="thinking"] .status-dot {
  opacity: 1;
  background: #ff7a00;
  animation: statusPulse 0.42s ease-in-out infinite;
}

body[data-state="speaking"] .status-dot {
  opacity: 1;
  background: var(--amber-white);
  animation: statusPulse 0.3s ease-in-out infinite;
}

.overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at center, rgba(37, 22, 0, 0.56), rgba(0, 0, 0, 0.9));
  backdrop-filter: blur(14px);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.activation-panel {
  width: min(420px, 92vw);
  text-align: center;
  padding: 34px 28px;
  border: 1px solid rgba(255, 175, 35, 0.18);
  border-radius: 28px;
  background: rgba(7, 8, 7, 0.76);
  box-shadow:
    0 0 80px rgba(255, 126, 0, 0.09),
    inset 0 0 40px rgba(255, 175, 35, 0.025);
}

.brand {
  margin: 18px 0 24px;
  letter-spacing: 0.54em;
  font-size: 13px;
  color: rgba(255, 221, 151, 0.72);
}

.activation-panel p {
  margin: 16px 0 0;
  color: rgba(255, 236, 197, 0.5);
  font-size: 13px;
  line-height: 1.55;
}

.activate-btn {
  border: 1px solid rgba(255, 196, 72, 0.5);
  border-radius: 999px;
  padding: 14px 24px;
  color: #1b0c00;
  background: linear-gradient(135deg, #fff0a4, #ffad16 55%, #ff7b00);
  box-shadow:
    0 0 30px rgba(255, 157, 0, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.55);
  cursor: pointer;
  font-weight: 750;
  font-size: 14px;
}

.activate-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 42px rgba(255, 157, 0, 0.42),
    inset 0 1px 0 rgba(255,255,255,0.62);
}

.activate-btn:focus-visible {
  outline: 3px solid rgba(255, 201, 88, 0.8);
  outline-offset: 4px;
}

.mini-reactor {
  position: relative;
  width: 82px;
  height: 82px;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow:
    0 0 28px rgba(255, 157, 0, 0.2),
    inset 0 0 22px rgba(255, 208, 88, 0.12);
}

.mini-reactor::before,
.mini-reactor::after,
.mini-reactor span {
  content: "";
  position: absolute;
  border-radius: 50%;
  inset: 10px;
  border: 1px solid rgba(255, 180, 37, 0.65);
}

.mini-reactor::after {
  inset: 24px;
  border-color: #ffe182;
  box-shadow: 0 0 15px rgba(255, 178, 24, 0.72);
}

.mini-reactor span:nth-child(1) {
  inset: 2px;
  border-style: dashed;
  animation: spin 7s linear infinite;
}

.mini-reactor span:nth-child(2) {
  inset: 17px;
  border-style: dotted;
  animation: spinReverse 3.4s linear infinite;
}

.mini-reactor span:nth-child(3) {
  inset: 33px;
  border: 0;
  background: #fff1a8;
  box-shadow:
    0 0 14px #fff1a8,
    0 0 28px #ff9d00;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  to { transform: rotate(-360deg); }
}

@keyframes scan {
  0% { top: 0; opacity: 0; }
  8% { opacity: 0.4; }
  92% { opacity: 0.2; }
  100% { top: 100%; opacity: 0; }
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 8px currentColor; }
  50% { box-shadow: 0 0 25px currentColor; }
}

@media (max-width: 700px) {
  .hud-frame {
    inset: 12px;
  }

  .corner {
    width: 52px;
    height: 52px;
  }

  .corner::before {
    width: 52px;
  }

  .corner::after {
    height: 52px;
  }
}
