:root {
  --bg-left: #070d18;
  --bg-left-active: #0f2444;
  --bg-right: #140714;
  --bg-right-active: #3a1038;
  --accent-left: #00f2fe;
  --accent-right: #f72585;
  --accent-purple: #9d4edd;
  --text-main: #f8fafc;
  --font-mono: 'JetBrains Mono', monospace, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: #000000;
  font-family: var(--font-mono);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

body {
  position: relative;
  display: flex;
}

.screen-split {
  position: absolute;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.touch-zone {
  flex: 1;
  height: 100%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 32px);
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  transition: background-color 0.08s ease;
  position: relative;
}

.zone-left {
  background-color: var(--bg-left);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.zone-left:active, .zone-left.active {
  background-color: var(--bg-left-active);
}

.zone-right {
  background-color: var(--bg-right);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.zone-right:active, .zone-right.active {
  background-color: var(--bg-right-active);
}

.zone-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0.45;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.zone-left.active .zone-badge,
.zone-right.active .zone-badge {
  opacity: 1;
  transform: scale(1.08);
}

.zone-icon {
  font-size: 1.6rem;
}

.zone-left .zone-icon { color: var(--accent-left); }
.zone-right .zone-icon { color: var(--accent-right); }

.zone-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.zone-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.8);
}

.center-content {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  pointer-events: none !important;
  user-select: none !important;
}

.live-status-pill {
  margin-bottom: 24px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #94a3b8;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  transition: all 0.15s ease;
  pointer-events: none;
  text-align: center;
  max-width: 90%;
}

.live-status-pill.highlight {
  border-color: var(--accent-left);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.35);
  transform: scale(1.05);
}

.live-status-pill.thinking {
  border-color: var(--accent-purple);
  color: #ffffff;
  background: rgba(88, 28, 135, 0.85);
  box-shadow: 0 0 20px rgba(157, 78, 221, 0.6);
  animation: pulse-glow 1.2s infinite alternate;
}

.live-status-pill.speaking {
  border-color: #10b981;
  color: #ffffff;
  background: rgba(6, 78, 59, 0.85);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
  animation: pulse-glow 1s infinite alternate;
}

@keyframes pulse-glow {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(1.06); opacity: 1; }
}

.text-display-wrapper {
  max-width: 90%;
  max-height: 55%;
  overflow-y: auto;
  text-align: center;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.6;
  pointer-events: none;
}

.main-text {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.04em;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

.blinking-cursor {
  display: inline-block;
  width: 10px;
  height: 28px;
  background: var(--accent-left);
  vertical-align: middle;
  margin-left: 4px;
  animation: blink 1s infinite;
  box-shadow: 0 0 10px var(--accent-left);
  pointer-events: none;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.floating-controls {
  position: absolute;
  top: env(safe-area-inset-top, 16px);
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 20;
  display: flex;
  gap: 8px;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.1s ease;
}

.tool-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.2);
}

.tool-btn.send-btn {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(157, 78, 221, 0.35));
  border-color: rgba(0, 242, 254, 0.5);
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.3);
}

.tool-btn.tts-btn {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
  animation: pulse-glow 0.8s infinite alternate;
}

.tool-btn.hidden {
  display: none !important;
}

.config-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.config-modal.hidden {
  display: none !important;
}

.config-card {
  width: 100%;
  max-width: 420px;
  background: #111622;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.config-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
}

.config-label {
  font-size: 0.8rem;
  color: #94a3b8;
}

.config-input {
  width: 100%;
  background: #080c14;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
}

.config-input:focus {
  border-color: var(--accent-left);
}

.config-info {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.5;
}

.config-save-btn {
  background: linear-gradient(135deg, var(--accent-left), var(--accent-purple));
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  margin-top: 4px;
}

.toast {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 30;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
