.v2-body {
  min-height: 100vh;
  overflow-x: hidden;
  background: #061018;
}

.v2-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(3, 9, 15, 0.02), rgba(3, 9, 15, 0.18)),
    url("assets/orakel-background-v2.png") center bottom / cover no-repeat;
  filter: saturate(1.12) contrast(1.08) brightness(1.08);
}

.v2-body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 73% 58%, rgba(255, 246, 224, 0.16), transparent 24%),
    radial-gradient(circle at 49% 84%, rgba(132, 26, 36, 0.18), transparent 34%),
    linear-gradient(90deg, rgba(4, 9, 15, 0.32), rgba(4, 9, 15, 0.02) 48%, rgba(4, 9, 15, 0.12));
  pointer-events: none;
}

.v2-shell {
  position: relative;
  width: min(1320px, calc(100vw - 64px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: end;
  padding: clamp(28px, 4vw, 64px) 0 clamp(26px, 4vw, 58px);
}

.v2-oracle {
  min-height: calc(100vh - clamp(44px, 8vw, 116px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  align-items: end;
  gap: clamp(14px, 2.4vw, 28px);
}

.v2-brand {
  align-self: start;
  max-width: min(660px, 88vw);
}

.v2-brand .kicker {
  font-size: clamp(0.82rem, 1.2vw, 1rem);
  color: #e1bd64;
}

.v2-brand h1 {
  margin-top: 6px;
  color: #fff7e8;
  font-size: clamp(4.8rem, 10vw, 10.4rem);
  line-height: 0.84;
  text-shadow: 0 16px 48px rgba(0, 0, 0, 0.46);
}

.v2-owl {
  position: absolute;
  right: clamp(8px, 4vw, 64px);
  bottom: clamp(58px, 6vw, 90px);
  width: min(42vw, 520px);
  max-height: 72vh;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0.42;
  filter:
    saturate(0.82)
    contrast(0.92)
    drop-shadow(0 24px 34px rgba(0, 0, 0, 0.42));
  transition:
    opacity 1400ms ease,
    filter 1400ms ease,
    transform 1400ms ease;
  pointer-events: none;
}

.v2-body.is-oracle-speaking .v2-owl {
  opacity: 0.96;
  filter:
    saturate(1.04)
    contrast(1.02)
    drop-shadow(0 0 24px rgba(255, 248, 226, 0.34))
    drop-shadow(0 32px 46px rgba(0, 0, 0, 0.5));
  animation: oracle-breathe 2600ms ease-in-out infinite;
}

@keyframes oracle-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-6px) scale(1.012);
  }
}

.v2-action-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
}

.v2-action-title {
  margin: 0;
  color: #fff7e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 3vw, 2.8rem);
  font-weight: 500;
  line-height: 1;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.56);
}

.v2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: stretch;
}

.v2-choice-button {
  position: relative;
  min-width: 186px;
  min-height: 166px;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 16px;
  padding: 26px 22px 24px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(220, 194, 126, 0.28);
  background:
    radial-gradient(circle at 22% 18%, rgba(218, 190, 116, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), transparent 30%),
    linear-gradient(180deg, rgba(12, 29, 32, 0.88), rgba(3, 9, 13, 0.94));
  color: #fff9ed;
  font-size: 1.03rem;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(16px);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.v2-choice-button::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.v2-choice-button:hover,
.v2-choice-button:focus-visible {
  border-color: rgba(220, 194, 126, 0.52);
  background:
    radial-gradient(circle at 22% 18%, rgba(218, 190, 116, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(17, 43, 45, 0.92), rgba(5, 13, 17, 0.95));
  box-shadow:
    0 22px 58px rgba(0, 0, 0, 0.42),
    0 0 32px rgba(218, 190, 116, 0.18);
}

.v2-choice-button:active {
  transform: translateY(2px);
}

.v2-choice-button.is-starting,
.v2-choice-button.is-processing {
  border-color: rgba(244, 199, 86, 0.72);
  background:
    radial-gradient(circle at 50% 36%, rgba(244, 199, 86, 0.22), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(38, 29, 14, 0.92), rgba(7, 9, 11, 0.94));
  box-shadow:
    0 20px 52px rgba(0, 0, 0, 0.36),
    0 0 0 4px rgba(244, 199, 86, 0.1),
    0 0 34px rgba(244, 199, 86, 0.42);
}

.v2-choice-button.is-starting::before,
.v2-choice-button.is-processing::before {
  border-color: rgba(255, 237, 178, 0.28);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 24px rgba(244, 199, 86, 0.12);
}

.v2-choice-button.is-starting .v2-button-icon,
.v2-choice-button.is-processing .v2-button-icon {
  color: #fff3c6;
  filter: drop-shadow(0 0 14px rgba(244, 199, 86, 0.54));
}

.v2-choice-button.is-starting .v2-button-label,
.v2-choice-button.is-processing .v2-button-label {
  color: #fff3c6;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.72),
    0 0 20px rgba(244, 199, 86, 0.52);
}

.v2-choice-button.is-recording {
  border-color: rgba(255, 95, 88, 0.86);
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 72, 64, 0.34), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(43, 9, 12, 0.94), rgba(8, 6, 10, 0.96));
  box-shadow:
    0 20px 52px rgba(0, 0, 0, 0.36),
    0 0 0 4px rgba(255, 61, 55, 0.16),
    0 0 46px rgba(255, 61, 55, 0.62);
  animation: recording-button-pulse 920ms ease-in-out infinite;
}

.v2-choice-button.is-recording::before {
  border-color: rgba(255, 205, 196, 0.34);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 28px rgba(255, 61, 55, 0.18);
}

.v2-choice-button.is-recording::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff3d37;
  box-shadow:
    0 0 0 6px rgba(255, 61, 55, 0.18),
    0 0 24px rgba(255, 61, 55, 0.82);
  animation: recording-dot-pulse 720ms ease-in-out infinite;
}

.v2-button-icon {
  position: relative;
  z-index: 1;
  width: 62px;
  height: 62px;
  display: block;
  color: rgba(255, 247, 232, 0.9);
}

.v2-button-icon::before,
.v2-button-icon::after {
  content: "";
  position: absolute;
  left: 50%;
}

.v2-button-icon-voice::before {
  top: 5px;
  width: 24px;
  height: 34px;
  border: 2px solid currentColor;
  border-radius: 14px;
  transform: translateX(-50%);
  background: rgba(225, 189, 100, 0.14);
}

.v2-button-icon-voice::after {
  top: 28px;
  width: 42px;
  height: 26px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 24px 24px;
  transform: translateX(-50%);
  box-shadow:
    0 13px 0 -11px currentColor,
    0 24px 0 -11px currentColor;
}

.v2-choice-button.is-recording .v2-button-icon {
  color: #fff8ed;
  filter: drop-shadow(0 0 16px rgba(255, 120, 100, 0.72));
}

.v2-choice-button.is-recording .v2-button-icon-voice::before {
  background: rgba(255, 61, 55, 0.34);
}

.v2-choice-button.is-recording .v2-button-label {
  color: #fff8ed;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.72),
    0 0 22px rgba(255, 95, 88, 0.72);
}

.v2-button-icon-write::before {
  top: 10px;
  width: 48px;
  height: 38px;
  border: 2px solid currentColor;
  border-radius: 7px;
  transform: translateX(-50%) rotate(-4deg);
  background: rgba(225, 189, 100, 0.12);
}

.v2-button-icon-write::after {
  top: 24px;
  width: 31px;
  height: 2px;
  background: currentColor;
  transform: translateX(-50%) rotate(-4deg);
  box-shadow:
    0 9px 0 rgba(255, 247, 232, 0.74),
    0 18px 0 rgba(255, 247, 232, 0.54);
}

.v2-button-label {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  max-width: 150px;
  line-height: 1.05;
  font-size: 1.03rem;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72);
}

.v2-voice-controls {
  justify-self: start;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.v2-body #orb-button,
.v2-body .v2-voice-controls,
.v2-body .v2-chat-talk-button {
  display: none !important;
}

.v2-voice-toggle {
  justify-self: start;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 245, 230, 0.24);
  border-radius: 999px;
  background: rgba(6, 12, 18, 0.58);
  color: rgba(255, 249, 237, 0.86);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.v2-voice-toggle:hover,
.v2-voice-toggle:focus-visible {
  border-color: rgba(255, 245, 230, 0.42);
  background: rgba(255, 250, 240, 0.12);
}

.v2-voice-toggle.is-muted {
  border-color: rgba(244, 199, 86, 0.54);
  background: rgba(55, 42, 14, 0.72);
  color: #fff3c6;
}

.v2-oracle .status {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: -4px 0 0 2px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 250, 240, 0.32);
  border-radius: 50%;
  background: #77818a;
  color: transparent;
  font-size: 0;
  box-shadow:
    0 0 0 6px rgba(255, 250, 240, 0.08),
    0 0 22px rgba(255, 250, 240, 0.22);
}

.v2-oracle .status[data-state="ready"] {
  background: #4fdf7e;
  box-shadow:
    0 0 0 6px rgba(79, 223, 126, 0.14),
    0 0 28px rgba(79, 223, 126, 0.56);
}

.v2-oracle .status[data-state="recording"] {
  background: #ff3d37;
  box-shadow:
    0 0 0 7px rgba(255, 61, 55, 0.16),
    0 0 34px rgba(255, 61, 55, 0.72);
  animation: status-pulse 900ms ease-in-out infinite;
}

.v2-oracle .status[data-state="thinking"],
.v2-oracle .status[data-state="speaking"] {
  background: #f4c756;
  box-shadow:
    0 0 0 7px rgba(244, 199, 86, 0.14),
    0 0 32px rgba(244, 199, 86, 0.64);
}

.v2-oracle .status[data-state="error"] {
  background: #ff3d37;
  box-shadow:
    0 0 0 7px rgba(255, 61, 55, 0.14),
    0 0 32px rgba(255, 61, 55, 0.66);
}

@keyframes status-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.18);
  }
}

@keyframes recording-button-pulse {
  0%,
  100% {
    box-shadow:
      0 20px 52px rgba(0, 0, 0, 0.36),
      0 0 0 4px rgba(255, 61, 55, 0.14),
      0 0 40px rgba(255, 61, 55, 0.54);
  }

  50% {
    box-shadow:
      0 20px 52px rgba(0, 0, 0, 0.36),
      0 0 0 8px rgba(255, 61, 55, 0.2),
      0 0 58px rgba(255, 61, 55, 0.78);
  }
}

@keyframes recording-dot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.24);
    opacity: 0.72;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v2-choice-button.is-starting,
  .v2-choice-button.is-recording,
  .v2-choice-button.is-recording::after,
  .v2-oracle .status[data-state="recording"] {
    animation: none;
  }
}

.v2-chat {
  position: fixed;
  z-index: 4;
  left: clamp(24px, 9vw, 180px);
  bottom: clamp(42px, 8vh, 112px);
  width: min(720px, 44vw);
  height: min(620px, calc(100vh - 150px));
  min-height: 440px;
  padding: 20px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(5, 10, 16, 0.78), rgba(5, 10, 16, 0.9));
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(22px);
}

.v2-chat[hidden] {
  display: none;
}

.v2-chat-tools {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.v2-chat-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 250, 240, 0.22);
  border-radius: 50%;
  background: rgba(3, 8, 13, 0.64);
  color: #fff7e8;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.v2-chat-close:hover,
.v2-chat-close:focus-visible {
  border-color: rgba(220, 194, 126, 0.5);
  background: rgba(122, 99, 48, 0.82);
}

.chat-list {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden auto;
  padding-right: 4px;
}

.chat-message {
  width: min(88%, 680px);
  display: grid;
}

.chat-message p {
  margin: 0;
  border: 1px solid rgba(255, 250, 240, 0.18);
  border-radius: 8px;
  padding: 14px 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chat-message.oracle {
  align-self: flex-start;
}

.chat-message.oracle p {
  background: rgba(255, 250, 240, 0.08);
  color: #fff8ea;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
}

.chat-message.user {
  align-self: flex-end;
}

.chat-message.user p {
  background: rgba(25, 73, 72, 0.42);
  border-color: rgba(220, 194, 126, 0.34);
  color: #fff7ea;
}

.v2-question-form {
  gap: 10px;
}

.v2-question-form textarea {
  min-height: 154px;
  background: rgba(2, 7, 12, 0.72);
  border-color: rgba(255, 250, 240, 0.22);
}

.v2-question-form .control-row {
  justify-content: flex-end;
  gap: 12px;
}

.v2-question-form .primary-button {
  border: 1px solid rgba(255, 239, 184, 0.58);
  background: linear-gradient(180deg, #d8bd74, #a8843f 56%, #70562a);
  color: #071018;
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.28),
    0 0 30px rgba(218, 190, 116, 0.22);
}

.v2-question-form .primary-button:hover,
.v2-question-form .primary-button:focus-visible {
  background: linear-gradient(180deg, #ead08a, #bb9650 56%, #806230);
  box-shadow:
    0 20px 42px rgba(0, 0, 0, 0.32),
    0 0 36px rgba(234, 208, 138, 0.3);
}

.v2-chat-talk-button {
  display: none;
}

.v2-hidden-settings {
  display: none;
}

@media (max-width: 1100px) {
  .v2-shell {
    width: min(100vw - 20px, 620px);
    min-height: auto;
    display: block;
    align-items: stretch;
  }

  .v2-oracle {
    min-height: auto;
    display: grid;
    grid-template-rows: auto auto auto auto;
    gap: 16px;
  }

  .v2-brand h1 {
    font-size: clamp(3.4rem, 16vw, 6.2rem);
  }

  .v2-owl {
    position: relative;
    right: auto;
    bottom: auto;
    justify-self: center;
    order: 2;
    width: min(86vw, 420px);
    max-height: 48vh;
    margin: 4px auto 0;
    transform: none;
  }

  .v2-action-panel {
    order: 3;
    width: 100%;
    margin-top: auto;
  }

  .v2-actions {
    width: 100%;
  }

  .v2-oracle .status {
    order: 4;
  }

  .v2-choice-button {
    flex: 1 1 190px;
  }

  .v2-chat {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    height: min(68vh, 680px);
    min-height: min(430px, calc(100vh - 28px));
    margin: 0;
  }

  .v2-question-form .control-row {
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
  }

  .v2-chat-talk-button {
    min-height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 18px;
    border: 1px solid rgba(255, 245, 230, 0.24);
    border-radius: 8px;
    background: rgba(6, 12, 18, 0.7);
    color: #fff7e8;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
  }

  .v2-chat-talk-icon {
    position: relative;
    width: 24px;
    height: 30px;
    flex: 0 0 24px;
    color: currentColor;
  }

  .v2-chat-talk-icon::before,
  .v2-chat-talk-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .v2-chat-talk-icon::before {
    top: 0;
    width: 11px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 10px;
    background: rgba(225, 189, 100, 0.14);
  }

  .v2-chat-talk-icon::after {
    top: 15px;
    width: 22px;
    height: 13px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 16px 16px;
    box-shadow:
      0 8px 0 -6px currentColor,
      0 15px 0 -6px currentColor;
  }

  .v2-chat-talk-button.is-starting,
  .v2-chat-talk-button.is-processing {
    border-color: rgba(244, 199, 86, 0.72);
    background: rgba(55, 42, 14, 0.72);
    color: #fff3c6;
    box-shadow:
      0 16px 34px rgba(0, 0, 0, 0.3),
      0 0 0 4px rgba(244, 199, 86, 0.1),
      0 0 26px rgba(244, 199, 86, 0.38);
  }

  .v2-chat-talk-button.is-recording {
    border-color: rgba(255, 95, 88, 0.86);
    background: rgba(91, 17, 20, 0.78);
    color: #fff8ed;
    box-shadow:
      0 16px 34px rgba(0, 0, 0, 0.3),
      0 0 0 4px rgba(255, 61, 55, 0.16),
      0 0 34px rgba(255, 61, 55, 0.54);
    animation: recording-button-pulse 920ms ease-in-out infinite;
  }
}

@media (max-width: 560px) {
  .v2-shell {
    padding: 18px 0;
  }

  .v2-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .v2-choice-button {
    width: 100%;
    min-height: 126px;
    gap: 10px;
    padding: 20px 18px 18px;
    flex: none;
  }

  .v2-button-icon {
    width: 54px;
    height: 54px;
  }

  .v2-voice-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .v2-voice-toggle {
    width: 100%;
  }

  .v2-chat {
    height: min(70vh, 620px);
    min-height: min(390px, calc(100vh - 28px));
    padding: 12px;
  }

  .v2-question-form textarea {
    min-height: 118px;
  }
}
