:root {
  /* Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.4);
  --accent-hover: #2563eb;
  --border: rgba(148, 163, 184, 0.1);
  --success: #22c55e;
  --warning: #f59e0b;

  /* Brain colors */
  --chatgpt-color: #10a37f;
  --gemini-color: #4285f4;
  --deepseek-color: #0ea5e9;
  --qwen-color: #eab308;

  /* Spacing */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 24px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Screen Container ─────────────────────────── */
.app {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  overflow-y: auto;
}

.screen.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.screen.exit-left {
  opacity: 0;
  transform: translateX(-40px);
}

.screen.exit-right {
  opacity: 0;
  transform: translateX(40px);
}

/* ─── Screen 1: Start ─────────────────────────── */
.start-screen {
  background: radial-gradient(ellipse at 50% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 70%),
              linear-gradient(180deg, var(--bg-primary) 0%, #0f172a 100%);
}

.robot-image-wrapper {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 60px rgba(59, 130, 246, 0.15), 0 0 120px rgba(59, 130, 246, 0.05);
  margin-bottom: 32px;
  animation: float 6s ease-in-out infinite;
}

.robot-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.start-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
}

.start-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 48px;
  text-align: center;
  line-height: 1.5;
}

/* ─── Buttons ──────────────────────────────────── */
.btn-primary {
  width: 100%;
  max-width: 320px;
  padding: 18px 32px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 24px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 16px var(--accent-glow);
}

/* ─── Screen 2: Main Menu ──────────────────────── */
.menu-screen {
  background: linear-gradient(180deg, var(--bg-primary) 0%, #0f172a 100%);
  justify-content: flex-start;
  padding-top: 60px;
}

.menu-header {
  text-align: center;
  margin-bottom: 40px;
}

.menu-greeting {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.menu-greeting .emoji {
  font-size: 28px;
}

.menu-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
}

.menu-cards {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.menu-card {
  width: 100%;
  padding: 20px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
}

.menu-card:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
  border-color: rgba(59, 130, 246, 0.3);
}

.menu-card:active {
  transform: translateX(2px);
}

.menu-card .card-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.1);
}

.menu-card .card-arrow {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 20px;
}

/* ─── Screen 3: Personal ──────────────────────── */
.personal-screen {
  background: linear-gradient(180deg, var(--bg-primary) 0%, #0f172a 100%);
  justify-content: flex-start;
  padding-top: 60px;
}

.personal-header {
  text-align: center;
  margin-bottom: 32px;
}

.personal-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.personal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.brain-grid {
  width: 100%;
  max-width: 380px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.brain-card {
  padding: 24px 16px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.brain-card:hover {
  transform: translateY(-4px);
  border-color: var(--brain-color, var(--accent));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.brain-card:active {
  transform: translateY(-2px);
}

.brain-card .brain-icon {
  font-size: 36px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.brain-card .brain-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.brain-card[data-brain="chatgpt"] { --brain-color: var(--chatgpt-color); }
.brain-card[data-brain="gemini"] { --brain-color: var(--gemini-color); }
.brain-card[data-brain="deepseek"] { --brain-color: var(--deepseek-color); }
.brain-card[data-brain="qwen"] { --brain-color: var(--qwen-color); }

.brain-card[data-brain="chatgpt"]:hover { border-color: var(--chatgpt-color); box-shadow: 0 8px 32px rgba(16, 163, 127, 0.2); }
.brain-card[data-brain="gemini"]:hover { border-color: var(--gemini-color); box-shadow: 0 8px 32px rgba(66, 133, 244, 0.2); }
.brain-card[data-brain="deepseek"]:hover { border-color: var(--deepseek-color); box-shadow: 0 8px 32px rgba(14, 165, 233, 0.2); }
.brain-card[data-brain="qwen"]:hover { border-color: var(--qwen-color); box-shadow: 0 8px 32px rgba(234, 179, 8, 0.2); }

.btn-back {
  width: 100%;
  max-width: 380px;
  padding: 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-back:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.3);
}

/* ─── Loading/Status overlay ───────────────────── */
.status-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.status-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.status-text {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
}

/* ─── Responsive ───────────────────────────────── */
@media (max-height: 600px) {
  .robot-image-wrapper { width: 140px; height: 140px; margin-bottom: 20px; }
  .start-title { font-size: 28px; }
  .start-subtitle { margin-bottom: 32px; }
  .menu-screen, .personal-screen { padding-top: 32px; }
}
