@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

:root {
  color-scheme: dark;
  --bg-color: #0b0d17;
  --text-color: #f8f9ff;
  --accent-color: #6c63ff;
  --accent-glow: rgba(108, 99, 255, 0.35);
  --transition-duration: 600ms;
  --bg-image: none;
  --bg-blur: 12px;
  --bg-opacity: 0.6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, var(--accent-glow), transparent 55%),
    radial-gradient(circle at bottom right, rgba(255, 72, 158, 0.25), transparent 60%),
    var(--bg-color);
  color: var(--text-color);
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  text-align: center;
  padding: 2rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: none;
  animation: fadeIn var(--transition-duration) ease-out;
  position: relative;
}

body.push-to-talk-active {
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: contain;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.pin-locked {
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  filter: blur(var(--bg-blur));
  opacity: var(--bg-opacity);
  pointer-events: none;
  transition: filter 0.3s ease, opacity 0.3s ease, background-image 0.3s ease;
  z-index: -2;
}

.pin-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, rgba(5, 7, 15, 0.85), rgba(11, 13, 23, 0.6));
  backdrop-filter: blur(12px);
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 30;
}

body:not(.pin-locked) .pin-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pin-overlay__panel {
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2.5rem 2.25rem 2.25rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 15, 28, 0.85);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.pin-overlay__panel.is-busy {
  pointer-events: none;
}

.pin-overlay__panel.is-busy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 20, 0.55);
  backdrop-filter: blur(2px);
  animation: pinBusy 1.2s linear infinite;
  mask: linear-gradient(90deg, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.55), rgba(0, 0, 0, 0.1));
  -webkit-mask: linear-gradient(90deg, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.55), rgba(0, 0, 0, 0.1));
}

.pin-overlay__panel::after {
  content: '';
  position: absolute;
  inset: -25%;
  background: radial-gradient(circle at top, rgba(108, 99, 255, 0.25), transparent 60%);
  opacity: 0.8;
  pointer-events: none;
  z-index: -1;
}

.pin-overlay__header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.pin-overlay__header p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  line-height: 1.5;
}

.pin-overlay__display {
  min-height: 3.25rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  letter-spacing: 0.45rem;
  padding: 0.9rem 1rem;
  position: relative;
  overflow: hidden;
}

.pin-overlay__display span {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
}

.pin-overlay__display span[data-placeholder-active='true'] {
  letter-spacing: normal;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.65);
}

.pin-overlay__feedback {
  min-height: 1.25rem;
  color: #ff7a7a;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.pin-overlay__feedback--info {
  color: rgba(255, 255, 255, 0.8);
}

.pin-overlay__feedback--success {
  color: #86ffc8;
}

.pin-overlay__keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.pin-overlay__keypad button {
  border: none;
  border-radius: 18px;
  padding: 0.85rem;
  font-size: 1.35rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.pin-overlay__keypad button:focus-visible {
  outline: 2px solid rgba(108, 99, 255, 0.65);
  outline-offset: 3px;
}

.pin-overlay__keypad button:active {
  transform: scale(0.96);
}

.pin-overlay__keypad button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.pin-overlay__keypad button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.pin-overlay__action {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pin-overlay__action--primary {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.9), rgba(255, 120, 196, 0.8));
  box-shadow: 0 20px 40px rgba(108, 99, 255, 0.45);
}

.pin-overlay__panel--error {
  animation: pinShake 0.45s ease;
}

@keyframes pinShake {
  10%,
  90% {
    transform: translateX(-2px);
  }

  20%,
  80% {
    transform: translateX(3px);
  }

  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }

  40%,
  60% {
    transform: translateX(4px);
  }
}

@keyframes pinBusy {
  0% {
    opacity: 0.4;
    transform: translateX(-40%);
  }

  50% {
    opacity: 0.65;
  }

  100% {
    opacity: 0.4;
    transform: translateX(40%);
  }
}

.container {
  max-width: 720px;
  display: grid;
  gap: 1.5rem;
  backdrop-filter: blur(6px);
  background: rgba(11, 13, 23, 0.65);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3rem 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

body.pin-locked #app-main {
  filter: blur(6px) saturate(80%);
  pointer-events: none;
  user-select: none;
}

.admin-launcher {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-end;
  z-index: 8;
}

.admin-launcher__bot {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: rgba(255, 255, 255, 0.9);
  color: #0b0d17;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.admin-launcher__bot:hover,
.admin-launcher__bot:focus-visible {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.45);
  outline: none;
  filter: saturate(1.15);
}

.admin-launcher__bot--background {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), rgba(58, 210, 159, 0.9));
  box-shadow: 0 16px 32px rgba(58, 210, 159, 0.45);
}

.admin-launcher__bot--advanced {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), rgba(90, 169, 255, 0.9));
  box-shadow: 0 16px 32px rgba(90, 169, 255, 0.45);
}

.admin-launcher__bot--logs {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), rgba(255, 179, 71, 0.9));
  box-shadow: 0 16px 32px rgba(255, 179, 71, 0.45);
}

.admin-launcher__bot--active {
  box-shadow: 0 24px 46px rgba(255, 255, 255, 0.35) !important;
  filter: saturate(1.2);
}

.admin-launcher__bot:active {
  transform: translateY(0) scale(0.98);
}

@media (max-width: 600px) {
  .admin-launcher {
    bottom: 1rem;
    right: 1rem;
    gap: 0.5rem;
  }

  .admin-launcher__bot {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.5rem;
  }
}

.admin-panel {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 15, 0.92);
  display: flex;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.75rem);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10;
}

.admin-panel.visible {
  opacity: 1;
  pointer-events: auto;
}

.admin-panel__content {
  width: min(1100px, 100%);
  background: rgba(12, 15, 28, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  padding: clamp(1.5rem, 2.4vw, 2.5rem);
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.admin-panel__body {
  display: grid;
  gap: 2rem;
}

.admin-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-panel__header h2 {
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.admin-panel__close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s ease;
}

.admin-panel__close:hover,
.admin-panel__close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.config-trigger {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
  font-size: 1.8rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 6;
}

.config-trigger:hover,
.config-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4);
}

.config-trigger--ready {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.75), rgba(255, 120, 196, 0.65));
  border-color: transparent;
  box-shadow: 0 18px 36px rgba(108, 99, 255, 0.45);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.admin-form fieldset {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 1rem 1.25rem 1.25rem;
}

.admin-form legend {
  padding: 0 0.5rem;
  font-size: 0.95rem;
  color: rgba(248, 249, 255, 0.8);
}

.admin-form__label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.admin-form input[type='file'] {
  width: 100%;
  color: rgba(248, 249, 255, 0.9);
}

.admin-form__controls {
  display: grid;
  gap: 1rem;
}

.admin-form input[type='range'] {
  width: 100%;
}

.admin-form__submit {
  align-self: flex-end;
  background: var(--accent-color);
  border: none;
  border-radius: 12px;
  color: var(--text-color);
  padding: 0.8rem 1.75rem;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 25px rgba(108, 99, 255, 0.35);
}

.admin-panel__mode-nav {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem;
  border-radius: 16px;
  background: rgba(10, 12, 22, 0.55);
}

.admin-panel__mode-button {
  flex: 1 0 0;
  border: none;
  border-radius: 12px;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.admin-panel__mode-button:hover:not(:disabled),
.admin-panel__mode-button:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(10, 11, 20, 0.32);
  outline: none;
}

.admin-panel__mode-button:disabled,
.admin-panel__mode-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.admin-panel__mode-button--active {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.45), rgba(255, 120, 196, 0.35));
  box-shadow: 0 16px 36px rgba(108, 99, 255, 0.4);
}

.admin-panel__section--hidden {
  display: none;
}

.admin-form__submit:hover,
.admin-form__submit:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(108, 99, 255, 0.5);
  outline: none;
}

.admin-advanced {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.25rem;
  overflow: hidden;
}

.admin-advanced__header {
  display: grid;
  gap: 0.5rem;
}

.admin-advanced__hint {
  font-size: 0.85rem;
  color: rgba(248, 249, 255, 0.7);
}

.admin-advanced__stack {
  display: grid;
  gap: 1.75rem;
}

.admin-advanced__stack > .advanced-form,
.admin-advanced__stack > .advanced-logs {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(8, 10, 18, 0.78);
  padding: clamp(1.25rem, 2vw, 1.75rem);
}

@media (max-width: 720px) {
  .admin-panel {
    padding: 1rem;
  }

  .admin-panel__content {
    border-radius: 16px;
  }

  .admin-advanced__stack > .advanced-form,
  .admin-advanced__stack > .advanced-logs {
    padding: 1.1rem;
  }
}

.advanced-form {
  display: grid;
  gap: 0.85rem;
}

.advanced-form__title {
  font-size: 1.1rem;
  font-weight: 600;
}

.advanced-form__description {
  font-size: 0.85rem;
  color: rgba(248, 249, 255, 0.65);
  line-height: 1.4;
}

.advanced-form__label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: rgba(248, 249, 255, 0.9);
}

.advanced-form textarea,
.advanced-form input,
.advanced-form select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(9, 11, 20, 0.75);
  color: var(--text-color);
  padding: 0.75rem 0.85rem;
  font-family: inherit;
}

.advanced-form textarea:focus-visible,
.advanced-form input:focus-visible,
.advanced-form select:focus-visible {
  outline: 2px solid rgba(108, 99, 255, 0.5);
}

.advanced-form input[type='range'] {
  padding: 0;
  height: 0.35rem;
  background: linear-gradient(90deg, rgba(108, 99, 255, 0.7), rgba(255, 120, 196, 0.7));
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

.advanced-form input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(108, 99, 255, 0.8);
  box-shadow: 0 0 8px rgba(108, 99, 255, 0.5);
}

.advanced-form input[type='range']::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(108, 99, 255, 0.8);
  box-shadow: 0 0 8px rgba(108, 99, 255, 0.5);
}

.advanced-form__field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.advanced-form__toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.advanced-form__toggle input {
  width: auto;
  accent-color: rgba(108, 99, 255, 0.9);
}

.advanced-form__preview {
  font-size: 0.8rem;
  color: rgba(248, 249, 255, 0.6);
  margin-top: -0.2rem;
}

.advanced-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.character-admin {
  display: grid;
  gap: 1.35rem;
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 13, 23, 0.55);
}

.character-admin__title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.character-admin__description {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  line-height: 1.6;
}

.character-form {
  display: grid;
  gap: 1rem;
  text-align: left;
}

.character-form__row {
  display: grid;
  gap: 0.45rem;
}

.character-form__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.character-form__hint {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
}

.character-form input[type='text'],
.character-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.character-form input[type='text']:focus,
.character-form textarea:focus {
  outline: none;
  border-color: rgba(108, 99, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.25);
}

.character-form input[type='file'] {
  color: rgba(255, 255, 255, 0.85);
}

.character-form__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.character-form__cancel {
  padding: 0.6rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease;
}

.character-form__cancel:hover,
.character-form__cancel:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.character-list {
  display: grid;
  gap: 0.85rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.character-list__empty {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.character-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.character-list__main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.character-list__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.character-list__identity {
  display: grid;
  gap: 0.2rem;
}

.character-list__name {
  font-weight: 600;
  font-size: 1rem;
}

.character-list__voice {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  word-break: break-all;
}

.character-list__prompt {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  max-width: 42ch;
  white-space: pre-wrap;
}

.character-list__actions {
  display: flex;
  gap: 0.5rem;
}

.character-list__action {
  padding: 0.45rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease;
}

.character-list__action:hover,
.character-list__action:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.character-list__action--danger {
  border-color: rgba(255, 90, 90, 0.4);
  color: #ff9b9b;
}

.character-list__action--danger:hover,
.character-list__action--danger:focus-visible {
  background: rgba(255, 90, 90, 0.15);
  border-color: rgba(255, 90, 90, 0.55);
}

.advanced-form__submit {
  background: linear-gradient(120deg, rgba(108, 99, 255, 0.85), rgba(255, 120, 196, 0.65));
  border: none;
  border-radius: 12px;
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 28px rgba(108, 99, 255, 0.35);
}

.advanced-form__submit:hover,
.advanced-form__submit:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(255, 120, 196, 0.45);
  outline: none;
}

.advanced-logs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.advanced-logs__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.advanced-logs__hint {
  font-size: 0.8rem;
  color: rgba(248, 249, 255, 0.6);
  margin-top: 0.35rem;
}

.advanced-logs__actions {
  display: flex;
  gap: 0.5rem;
}

.advanced-logs__button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.advanced-logs__button:hover,
.advanced-logs__button:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  outline: none;
}

.advanced-logs__timeline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.advanced-logs__label {
  font-size: 0.85rem;
  color: rgba(248, 249, 255, 0.7);
}

.advanced-logs__selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.advanced-logs__select {
  background: rgba(9, 11, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-color);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  min-width: 220px;
}

.advanced-logs__timeline {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: rgba(7, 9, 17, 0.85);
  color: rgba(248, 249, 255, 0.85);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  max-height: 360px;
  overflow-y: auto;
}

.advanced-logs__empty {
  font-size: 0.85rem;
  color: rgba(248, 249, 255, 0.6);
}

.advanced-log-entry {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 14, 24, 0.65);
  padding: 0.75rem 0.85rem;
  display: grid;
  gap: 0.4rem;
  transition: border 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.advanced-log-entry--active {
  border-color: rgba(108, 99, 255, 0.6);
  background: rgba(108, 99, 255, 0.15);
  box-shadow: 0 10px 24px rgba(108, 99, 255, 0.25);
}

.advanced-log-entry__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.advanced-log-entry__time {
  font-size: 0.78rem;
  color: rgba(248, 249, 255, 0.65);
}

.advanced-log-entry__stage {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
}

.advanced-log-entry__message {
  font-size: 0.85rem;
  color: rgba(248, 249, 255, 0.85);
}

.advanced-log-entry__details {
  margin: 0;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(248, 249, 255, 0.78);
  overflow-x: auto;
}

.floating-log__toggle {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  background: linear-gradient(120deg, rgba(108, 99, 255, 0.85), rgba(255, 120, 196, 0.65));
  color: var(--text-color);
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.35rem;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(108, 99, 255, 0.35);
  z-index: 11;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-log__toggle:hover,
.floating-log__toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(255, 120, 196, 0.45);
  outline: none;
}

.floating-log {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: min(90vw, 360px);
  max-height: min(80vh, 520px);
  background: rgba(12, 14, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 13;
}

.floating-log[hidden] {
  display: none !important;
}

.floating-log__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.floating-log__title {
  font-size: 1rem;
  font-weight: 600;
}

.floating-log__close {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
}

.floating-log__close:hover,
.floating-log__close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.floating-log__stream {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow-y: auto;
  max-height: 100%;
}

.floating-log__empty {
  font-size: 0.85rem;
  color: rgba(248, 249, 255, 0.7);
}

.floating-log__item {
  display: grid;
  gap: 0.25rem;
  background: rgba(10, 12, 22, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.6rem 0.75rem;
}

.floating-log__time {
  font-size: 0.72rem;
  color: rgba(248, 249, 255, 0.6);
}

.floating-log__stage {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.floating-log__message {
  font-size: 0.82rem;
  color: rgba(248, 249, 255, 0.82);
}

.floating-log__details {
  margin: 0;
  padding: 0.5rem 0.6rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(248, 249, 255, 0.75);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
  overflow-x: auto;
}

@media (max-width: 640px) {
  .floating-log {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }

  .floating-log__toggle {
    right: 1rem;
    left: auto;
  }
}

.admin-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: rgba(13, 16, 30, 0.92);
  color: var(--text-color);
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease;
  z-index: 12;
  font-size: 0.95rem;
}

.admin-toast.visible {
  transform: translateX(-50%) translateY(0);
}

.title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-title__heading {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.35rem, 1vw, 0.65rem);
  padding: clamp(0.75rem, 2.5vw, 1.35rem) clamp(1.75rem, 4vw, 2.75rem);
  border-radius: clamp(1.5rem, 4vw, 3rem);
  font-size: clamp(2.75rem, 6vw, 4.75rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  margin-bottom: 0;
  background: radial-gradient(circle at top, rgba(108, 99, 255, 0.35), transparent 55%),
    linear-gradient(120deg, rgba(140, 87, 255, 0.4), rgba(72, 222, 255, 0.25));
  box-shadow: 0 22px 55px rgba(25, 16, 81, 0.55);
  overflow: hidden;
}

.main-title__heading::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(14, 18, 38, 0.95), rgba(11, 13, 23, 0.75));
  z-index: 0;
  filter: blur(0.5px);
}

.main-title__text,
.main-title__highlight,
.main-title__subtitle {
  position: relative;
  z-index: 1;
}

.main-title__text {
  font-size: 1em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #f6f7ff 0%, #8d9bff 45%, #72f6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(122, 145, 255, 0.75);
}

.main-title__highlight {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: #ffdb6e;
  text-shadow: 0 0 18px rgba(255, 190, 82, 0.85);
  animation: pulseFlare 2.4s ease-in-out infinite;
}

.main-title__subtitle {
  font-size: clamp(1rem, 2.8vw, 1.35rem);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(197, 207, 255, 0.9);
}

@keyframes pulseFlare {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-6%) scale(1.1);
    opacity: 1;
  }
}

.subtitle {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: rgba(248, 249, 255, 0.75);
  margin-top: 0.5rem;
}

.intro p {
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  line-height: 1.6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.sparkle {
  font-size: 1.25rem;
  animation: float 3s ease-in-out infinite;
}

.animated-text {
  width: min(960px, 100%);
  margin: 0 auto 2.25rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 18, 32, 0.75);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.animated-text::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: linear-gradient(120deg, transparent 25%, rgba(255, 255, 255, 0.35) 50%, transparent 75%);
  transform: rotate(12deg);
  animation: shimmer 6s infinite;
}

#character-selection {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.9rem;
  justify-items: center;
  position: relative;
  z-index: 1;
}

.character-selection__label {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.character-selection__select {
  width: min(320px, 92%);
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 15, 28, 0.75);
  color: var(--text-color);
  font-size: 1rem;
  font-family: inherit;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
}

.character-selection__select:focus {
  outline: none;
  border-color: rgba(108, 99, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.25);
}

.character-selection__select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.character-selection__empty {
  font-size: 0.9rem;
  max-width: 40ch;
  color: rgba(255, 255, 255, 0.7);
}

.character-highlight {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  padding: 1.1rem 1.25rem 1.35rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 10, 20, 0.6);
  width: min(360px, 100%);
  margin-top: 0.25rem;
  box-shadow: 0 18px 32px rgba(10, 12, 22, 0.35);
}

.character-highlight__title {
  font-size: clamp(1rem, 2.1vw, 1.3rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.character-highlight__prompt {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  white-space: pre-wrap;
}

.character-highlight__figure {
  margin: 0;
}

.character-highlight__image {
  width: min(220px, 65vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

#character-selection.character-selection--empty .character-highlight {
  display: none;
}

#vision-text {
  position: relative;
  font-size: clamp(1.1rem, 2.8vw, 1.6rem);
  letter-spacing: 0.04em;
}

.voice-console {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 13, 23, 0.55);
  text-align: left;
}

.voice-console__header,
.voice-step__body--push {
  display: grid;
  gap: 1rem;
}

.voice-step__body--push {
  justify-items: center;
  text-align: center;
}

.voice-console__clock {
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 2.75rem);
  letter-spacing: 0.18em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.4rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 18px 32px rgba(8, 9, 18, 0.4);
  width: min(100%, 340px);
}

.voice-console__clock span {
  min-width: 8ch;
  text-align: center;
}

.voice-console__push-wrapper {
  position: relative;
  display: grid;
  place-items: center;
  width: min(60vw, 220px);
  aspect-ratio: 1 / 1;
}

.push-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 30%, rgba(255, 120, 90, 0.85), rgba(255, 70, 70, 0.55));
  box-shadow: 0 28px 40px rgba(255, 82, 82, 0.35), inset 0 0 0 4px rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.push-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.push-button.is-character-required {
  background: radial-gradient(circle at 30% 30%, rgba(120, 130, 150, 0.75), rgba(88, 92, 110, 0.5));
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.push-button.is-character-required::after {
  content: 'Selecciona un personaje';
  position: absolute;
  inset: auto 12% 14%;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

.push-button__inner {
  width: 68%;
  height: 68%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
  transition: transform 0.2s ease;
}

.push-button__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 112, 0.35), transparent 70%);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.push-button:not(:disabled):hover,
.push-button:not(:disabled):focus-visible {
  transform: scale(1.02);
  outline: none;
  box-shadow: 0 28px 50px rgba(255, 82, 82, 0.45);
}

.push-button.is-pressed {
  background: radial-gradient(circle at 30% 30%, rgba(120, 200, 255, 0.9), rgba(70, 140, 255, 0.6));
  box-shadow: 0 16px 30px rgba(70, 140, 255, 0.45), inset 0 0 0 6px rgba(255, 255, 255, 0.18);
  transform: scale(0.97);
}

.push-button.is-busy:not(:disabled):not(.is-pressed) .push-button__pulse {
  opacity: 0.85;
  transform: scale(1.1);
  animation: pushButtonPulse 1.8s ease-in-out infinite;
}

.push-button.is-pressed .push-button__inner {
  transform: scale(0.9);
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.05));
}

.push-button.is-pressed .push-button__pulse {
  opacity: 1;
  transform: scale(1.2);
}

.voice-console__hint {
  font-size: 0.95rem;
  color: rgba(248, 249, 255, 0.8);
  max-width: 26ch;
}

.voice-console__action {
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.8rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.85), rgba(72, 149, 255, 0.75));
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 18px 36px rgba(12, 21, 58, 0.45);
}

.voice-console__action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.voice-console__action:not(:disabled):hover,
.voice-console__action:not(:disabled):focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 24px 44px rgba(72, 149, 255, 0.55);
  outline: none;
}

.voice-progress {
  width: min(100%, 420px);
  margin-top: 0.5rem;
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.voice-progress__label {
  font-size: 0.95rem;
  color: rgba(248, 249, 255, 0.85);
}

.voice-progress__steps {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  font-size: 0.85rem;
  color: rgba(248, 249, 255, 0.6);
}

.voice-progress__steps span {
  position: relative;
  padding-left: 1.4rem;
  display: block;
}

.voice-progress__steps span::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: rgba(248, 249, 255, 0.35);
  box-shadow: 0 0 0 2px rgba(248, 249, 255, 0.12);
  transition: background 0.2s ease, transform 0.2s ease;
}

.voice-progress__steps span.is-active {
  color: rgba(248, 249, 255, 0.92);
  font-weight: 600;
}

.voice-progress__steps span.is-active::before {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.85), rgba(72, 149, 255, 0.9));
  transform: translateY(-50%) scale(1.12);
}

.voice-visualizer {
  justify-self: stretch;
}

@keyframes pushButtonPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1.05);
  }

  50% {
    opacity: 0.2;
    transform: scale(0.95);
  }
}

.voice-console__title {
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  font-weight: 600;
}

.push-to-talk {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
  color: var(--text-color);
  padding: 1.1rem 1.85rem;
  width: min(100%, 420px);
  min-height: 3.75rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.22s ease, background 0.25s ease, filter 0.2s ease;
  box-shadow: 0 18px 38px rgba(18, 21, 46, 0.45);
  user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  isolation: isolate;
}

.push-to-talk::after {
  content: '';
  position: absolute;
  inset: -20%;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 75, 75, 0.35), transparent 70%);
  opacity: 0;
  transform: scale(0.5);
  transition: transform 0.18s ease, opacity 0.18s ease;
  z-index: -2;
}

.push-to-talk__halo {
  position: absolute;
  inset: -0.75rem;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 75, 75, 0.35), rgba(255, 75, 75, 0));
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

.push-to-talk__label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  line-height: 1.25;
  text-align: left;
  position: relative;
  padding-right: 0.25rem;
}

.push-to-talk__label::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease, background 0.25s ease;
}

.push-to-talk__text {
  display: block;
}

.push-to-talk__text--recording {
  display: none;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
}

.push-to-talk__dot {
  position: relative;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #ff5858;
  box-shadow: 0 0 14px rgba(255, 75, 75, 0.65);
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.push-to-talk:hover:not(:disabled),
.push-to-talk:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px rgba(255, 75, 75, 0.35);
  outline: none;
}

.push-to-talk.is-pressed:not(:disabled) {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 14px 32px rgba(255, 75, 75, 0.28);
  filter: brightness(1.05);
}

.push-to-talk.is-pressed::after {
  opacity: 0.45;
  transform: scale(1.05);
}

.push-to-talk.recording {
  background: linear-gradient(135deg, rgba(255, 92, 92, 0.18), rgba(255, 75, 75, 0.05));
  box-shadow: 0 22px 48px rgba(255, 75, 75, 0.4);
  transform: translateY(0) scale(1.01);
}

.push-to-talk.recording .push-to-talk__halo {
  opacity: 1;
  transform: scale(1.05);
  animation: pushHaloPulse 1.8s ease-in-out infinite;
}

.push-to-talk.recording .push-to-talk__dot {
  background: #ff3b3b;
  box-shadow: 0 0 22px rgba(255, 59, 59, 0.7);
  animation: pushToTalkDotPulse 1.2s ease-in-out infinite;
}

.push-to-talk.recording::after {
  opacity: 0.55;
  transform: scale(1.1);
  animation: pushToTalkRipples 1.6s ease-out infinite;
}

.push-to-talk.recording .push-to-talk__text--default {
  display: none;
}

.push-to-talk.recording .push-to-talk__text--recording {
  display: block;
}

.push-to-talk.recording .push-to-talk__label::after {
  background: rgba(255, 86, 86, 0.85);
  transform: scaleX(1);
  animation: pushToTalkIntensity 1.8s ease-in-out infinite;
}

.push-to-talk.uploading {
  background: linear-gradient(135deg, rgba(118, 108, 255, 0.2), rgba(118, 108, 255, 0.05));
  box-shadow: 0 20px 44px rgba(118, 108, 255, 0.35);
}

.push-to-talk[data-state='uploading'] .push-to-talk__dot {
  background: #746bff;
  box-shadow: 0 0 20px rgba(118, 108, 255, 0.65);
  animation: none;
}

.push-to-talk[data-state='uploading']::after {
  opacity: 0.35;
  transform: scale(1.05);
  background: radial-gradient(circle, rgba(118, 108, 255, 0.3), transparent 70%);
  animation: pushToTalkRipples 2s ease-out infinite;
}

.push-to-talk[data-state='uploading'] .push-to-talk__label::after {
  background: rgba(118, 108, 255, 0.8);
  transform: scaleX(1);
  animation: pushToTalkProgress 1.1s ease-in-out infinite;
}

.push-to-talk:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
  box-shadow: 0 12px 28px rgba(18, 21, 46, 0.25);
}

@keyframes pushToTalkDotPulse {
  0%,
  100% {
    transform: scale(1);
  }

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

@keyframes pushToTalkRipples {
  0% {
    opacity: 0.45;
    transform: scale(0.95);
  }

  60% {
    opacity: 0.15;
  }

  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

@keyframes pushToTalkIntensity {
  0%,
  100% {
    opacity: 0.85;
  }

  50% {
    opacity: 0.45;
  }
}

@keyframes pushToTalkProgress {
  0% {
    transform: scaleX(0);
    opacity: 0.4;
  }

  50% {
    transform: scaleX(1);
    opacity: 1;
  }

  100% {
    transform: scaleX(0);
    opacity: 0.4;
  }
}

@keyframes pushHaloPulse {
  0% {
    opacity: 0.85;
    transform: scale(1.02);
  }

  50% {
    opacity: 0.35;
    transform: scale(1.14);
  }

  100% {
    opacity: 0.85;
    transform: scale(1.02);
  }
}

.voice-console__status {
  font-size: 0.95rem;
  color: rgba(248, 249, 255, 0.7);
  min-height: 1.1em;
}

.voice-console__feedback {
  display: grid;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: rgba(248, 249, 255, 0.82);
}

.voice-console__feedback strong {
  font-weight: 600;
  color: var(--text-color);
}

.voice-console__text {
  display: inline-block;
  margin-left: 0.25rem;
  word-break: break-word;
  color: rgba(248, 249, 255, 0.9);
}

.voice-console {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 13, 23, 0.55);
  text-align: left;
}

.voice-console__title {
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  font-weight: 600;
}

.voice-console__status {
  font-size: 0.95rem;
  color: rgba(248, 249, 255, 0.72);
  min-height: 1.1em;
}

.voice-slot {
  display: grid;
  gap: 1rem;
}

.voice-step {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(14, 17, 30, 0.65);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: 0 12px 28px rgba(8, 9, 18, 0.35);
}

.voice-step__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.voice-step__title {
  font-size: 1.05rem;
  font-weight: 600;
}

.voice-step__status {
  font-size: 0.85rem;
  color: rgba(248, 249, 255, 0.68);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.voice-step__body {
  display: grid;
  gap: 0.85rem;
}

.voice-step__timer {
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  letter-spacing: 0.12em;
}

.voice-step__vu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
}

.voice-step__vu-track {
  position: relative;
  flex: 1;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.voice-step__vu-bar {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(var(--vu-level, 0));
  background: linear-gradient(90deg, #34d399, #fbbf24, #f87171);
  transition: transform 0.12s ease-out;
  will-change: transform;
}

.voice-step__vu-label {
  font-size: 0.85rem;
  color: rgba(248, 249, 255, 0.76);
  min-width: 4.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.voice-step__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.voice-step__controls button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  color: var(--text-color);
  padding: 0.65rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.18s ease;
  box-shadow: 0 12px 24px rgba(10, 11, 20, 0.35);
}

.voice-step__action--primary {
  border-color: rgba(255, 89, 89, 0.6);
  background: linear-gradient(135deg, rgba(255, 105, 105, 0.82), rgba(255, 72, 129, 0.7));
  color: #fff;
  box-shadow: 0 16px 32px rgba(255, 95, 125, 0.35);
}

.voice-step__controls button:hover:not(:disabled),
.voice-step__controls button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08));
  box-shadow: 0 16px 30px rgba(10, 11, 20, 0.45);
}

.voice-step__action--primary:hover:not(:disabled),
.voice-step__action--primary:focus-visible:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 135, 135, 0.95), rgba(255, 92, 149, 0.88));
  box-shadow: 0 22px 42px rgba(255, 105, 135, 0.45);
}

.voice-step__controls button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

#send-to-character {
  flex: 1 1 100%;
}

@media (min-width: 620px) {
  #send-to-character {
    flex: 0 1 auto;
  }
}

.voice-progress {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 15, 28, 0.65);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.18);
}

.voice-progress__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(248, 249, 255, 0.85);
}

.voice-progress__track {
  position: relative;
  width: 100%;
  height: 0.55rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
}

.voice-progress__bar {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, #6366f1, #a855f7, #f97316);
  transition: transform 0.35s ease;
}

.voice-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  height: 2.25rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.voice-visualizer.is-active {
  opacity: 1;
  transform: translateY(0);
}

.voice-visualizer__bar {
  flex: 1;
  min-width: 0.35rem;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(148, 163, 255, 0.65));
  transform-origin: bottom center;
  transform: scaleY(0.2);
  animation: voice-visualizer-wave 1.05s ease-in-out infinite;
  animation-delay: calc(var(--bar-index) * 0.08s);
}

@keyframes voice-visualizer-wave {
  0% {
    transform: scaleY(0.18);
  }

  35% {
    transform: scaleY(0.9);
  }

  65% {
    transform: scaleY(0.35);
  }

  100% {
    transform: scaleY(0.75);
  }
}

.voice-step__meta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: center;
}

.voice-step__toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: rgba(248, 249, 255, 0.72);
}

.voice-step__toggle input {
  accent-color: var(--accent-color);
}

.voice-step__meta {
  font-size: 0.85rem;
  color: rgba(248, 249, 255, 0.7);
}

.voice-step__textarea {
  width: 100%;
  min-height: 7.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-color);
  resize: vertical;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
}

.voice-step__textarea:focus-visible {
  outline: 2px solid rgba(108, 99, 255, 0.65);
  outline-offset: 2px;
}

.voice-step__textarea[readonly] {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 249, 255, 0.82);
}

.voice-step__output {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  line-height: 1.45;
  min-height: 3.5rem;
  color: rgba(248, 249, 255, 0.9);
  white-space: pre-wrap;
}

.voice-step__preview audio {
  width: 100%;
  display: block;
}

.voice-step--response .voice-step__preview audio,
.voice-step--audio .voice-step__preview audio {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  60% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 2.5rem 1.5rem;
  }

  .intro p {
    flex-direction: column;
    gap: 0.5rem;
  }

  .admin-form__submit {
    width: 100%;
  }

  .push-to-talk {
    width: 100%;
    justify-content: center;
  }
}
