* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(0, 170, 255, 0.08), transparent 35%),
    linear-gradient(180deg, #020609 0%, #040b10 100%);
  color: #d9f7ff;
  font-family: "Segoe UI", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 190, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 190, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
}

.jarvis-shell {
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 38px 18px 24px;
}

.status {
  position: absolute;
  top: 45px;
  font-size: 12px;
  letter-spacing: 6px;
  color: #66ddff;
  text-shadow: 0 0 12px #00bfff;
}

.status::before {
  content: "●";
  margin-right: 10px;
  color: #39ff88;
  text-shadow: 0 0 12px #39ff88;
}

.orb {
  width: 330px;
  height: 330px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 35px;

  border: 1px solid rgba(72, 215, 255, 0.5);

  box-shadow:
    0 0 20px rgba(0, 191, 255, 0.25),
    inset 0 0 35px rgba(0, 191, 255, 0.08);

  animation: floatOrb 4s ease-in-out infinite;
}

.orb::before {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  border:
    2px solid transparent;
  border-top-color: #00d5ff;
  border-bottom-color: rgba(0, 213, 255, 0.25);
  box-shadow: 0 0 20px rgba(0, 213, 255, 0.2);

  animation: spin 7s linear infinite;
}

.orb::after {
  content: "";
  position: absolute;
  width: 215px;
  height: 215px;
  border-radius: 50%;
  border: 1px dashed rgba(100, 230, 255, 0.5);

  animation: reverseSpin 10s linear infinite;
}

.orb-core {
  width: 105px;
  height: 105px;
  border-radius: 50%;

  background:
    radial-gradient(circle, #eaffff 0%, #42dfff 35%, #0086b8 65%, transparent 72%);

  box-shadow:
    0 0 20px #65eaff,
    0 0 45px rgba(0, 208, 255, 0.8),
    0 0 90px rgba(0, 145, 255, 0.4);

  animation: pulse 2s ease-in-out infinite;
}

h1 {
  margin: 0;
  font-size: 48px;
  font-weight: 300;
  letter-spacing: 18px;
  color: #e9fbff;

  text-shadow:
    0 0 10px rgba(0, 195, 255, 0.6),
    0 0 30px rgba(0, 195, 255, 0.25);
}

#jarvis-response {
  width: min(650px, calc(100% - 36px));
  max-width: 650px;
  max-height: min(260px, 28svh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  font-size: 16px;
  color: rgba(217, 247, 255, 0.7);
  line-height: 1.7;
  margin: 20px 20px 32px;
  padding: 4px 14px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(69, 223, 255, 0.7) rgba(0, 30, 45, 0.45);
}

#jarvis-response::-webkit-scrollbar {
  width: 6px;
}

#jarvis-response::-webkit-scrollbar-thumb {
  background: rgba(69, 223, 255, 0.7);
  border-radius: 10px;
}

#jarvis-response::-webkit-scrollbar-track {
  background: rgba(0, 30, 45, 0.45);
}

.controls {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

#mic-button,
#type-button,
#stop-button {
  min-width: 220px;
  padding: 15px 26px;

  border: 1px solid #45dfff;
  border-radius: 6px;

  background: rgba(0, 180, 255, 0.06);
  color: #aeeeff;

  font-size: 14px;
  letter-spacing: 2px;

  cursor: pointer;

  box-shadow:
    0 0 12px rgba(0, 208, 255, 0.25),
    inset 0 0 12px rgba(0, 208, 255, 0.06);

  transition: 0.25s ease;
}

#mic-button:hover,
#type-button:hover,
#stop-button:hover {
  background: rgba(0, 190, 255, 0.16);
  box-shadow:
    0 0 22px rgba(0, 208, 255, 0.5),
    inset 0 0 18px rgba(0, 208, 255, 0.12);

  transform: translateY(-2px);
}

#stop-button {
  border-color: #ff6b7a;
  background: rgba(255, 64, 96, 0.06);
  color: #ffc3cb;
  box-shadow:
    0 0 12px rgba(255, 64, 96, 0.22),
    inset 0 0 12px rgba(255, 64, 96, 0.05);
}

#stop-button:hover {
  background: rgba(255, 64, 96, 0.14);
  box-shadow:
    0 0 22px rgba(255, 64, 96, 0.4),
    inset 0 0 18px rgba(255, 64, 96, 0.1);
}

.text-form {
  width: min(650px, calc(100% - 36px));
  margin-top: 18px;
}

.text-form[hidden] {
  display: none;
}

.text-form label {
  display: block;
  margin-bottom: 8px;
  color: rgba(217, 247, 255, 0.75);
  font-size: 13px;
  letter-spacing: 1px;
}

.text-entry {
  display: flex;
  gap: 10px;
}

#text-input {
  flex: 1;
  min-height: 58px;
  resize: vertical;
  border: 1px solid rgba(69, 223, 255, 0.65);
  border-radius: 6px;
  padding: 12px 14px;
  background: rgba(0, 20, 30, 0.88);
  color: #d9f7ff;
  font: inherit;
  outline: none;
  box-shadow: inset 0 0 12px rgba(0, 208, 255, 0.08);
}

#text-input:focus {
  border-color: #45dfff;
  box-shadow: 0 0 14px rgba(0, 208, 255, 0.22);
}

#send-button {
  min-width: 100px;
  border: 1px solid #45dfff;
  border-radius: 6px;
  padding: 0 18px;
  background: rgba(0, 180, 255, 0.12);
  color: #aeeeff;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
}

#send-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.jarvis-shell::before,
.jarvis-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  top: 50%;
  width: 180px;
  height: 280px;
  border-top: 1px solid rgba(0, 200, 255, 0.25);
  border-bottom: 1px solid rgba(0, 200, 255, 0.25);
  opacity: 0.7;
}

.jarvis-shell::before {
  left: 45px;
  border-left: 1px solid rgba(0, 200, 255, 0.25);
}

.jarvis-shell::after {
  right: 45px;
  border-right: 1px solid rgba(0, 200, 255, 0.25);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes reverseSpin {
  from {
    transform: rotate(360deg);
  }

  to {
    transform: rotate(0deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.08);
    filter: brightness(1.3);
  }
}

@keyframes floatOrb {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 600px) {
  body {
    height: 100svh;
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .jarvis-shell {
    height: 100svh;
    justify-content: flex-start;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .status {
    position: static;
    margin-bottom: 24px;
  }

  .orb {
    width: min(58vw, 240px);
    height: min(58vw, 240px);
    margin-bottom: 18px;
    flex: 0 0 auto;
  }

  .orb::before {
    width: 82%;
    height: 82%;
  }

  .orb::after {
    width: 65%;
    height: 65%;
  }

  h1 {
    font-size: 38px;
    letter-spacing: 12px;
    padding-left: 12px;
  }

  #jarvis-response {
    width: min(100%, 420px);
    max-height: 24svh;
    margin: 14px 0 16px;
    padding: 2px 10px 8px;
  }

  .controls {
    width: 100%;
    flex-direction: column;
    flex: 0 0 auto;
  }

  #mic-button,
  #type-button,
  #stop-button {
    width: min(100%, 320px);
    min-width: 0;
  }

  .text-form {
    width: min(100%, 320px);
  }

  .text-entry {
    flex-direction: column;
  }

  #send-button {
    min-height: 48px;
  }

  .jarvis-shell::before,
  .jarvis-shell::after {
    display: none;
  }
}

@media (max-height: 760px) {
  .status {
    top: 18px;
  }

  .orb {
    width: 190px;
    height: 190px;
    margin-bottom: 14px;
  }

  h1 {
    font-size: 34px;
  }

  #jarvis-response {
    max-height: 20svh;
    margin-top: 12px;
    margin-bottom: 14px;
  }
}
