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

:root {
  --bg-deep: #0a0515;
  --bg-dark: #0f0a1e;
  --bg-card: rgba(25, 12, 50, 0.6);
  --glass: rgba(30, 15, 60, 0.45);
  --glass-border: rgba(124, 77, 255, 0.2);
  --glass-border-hover: rgba(255, 105, 180, 0.4);
  --pink: #ff69b4;
  --pink-light: #ff8cc8;
  --pink-glow: rgba(255, 105, 180, 0.35);
  --purple: #7c4dff;
  --purple-light: #b388ff;
  --purple-glow: rgba(124, 77, 255, 0.3);
  --neon-purple: #aa00ff;
  --text-light: #f0e6f6;
  --text-muted: #9b85b5;
  --user-bubble: rgba(60, 30, 100, 0.5);
  --bot-bubble: rgba(40, 18, 75, 0.5);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Rubik', sans-serif;
  background: var(--bg-deep);
  color: var(--text-light);
  direction: rtl;
}

/* ===== Login Screen ===== */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
}

.login-screen.hidden {
  display: none;
}

.login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px;
  animation: fadeIn 0.8s ease-out;
}

.login-logo {
  width: 140px;
  height: 140px;
  border-radius: 32px;
  margin-bottom: 20px;
  animation: logoFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(200, 140, 255, 0.4))
          drop-shadow(0 0 60px rgba(255, 105, 180, 0.2));
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.02); }
}

.login-title {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink-light), #c8a0ff, var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.login-code-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.login-dots {
  display: flex;
  gap: 16px;
  direction: ltr;
}

.dot-slot {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(30, 15, 60, 0.6);
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: var(--pink-light);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.dot-slot.filled {
  border-color: var(--pink);
  background: rgba(255, 105, 180, 0.1);
  transform: scale(1.05);
}

.dot-slot.filled::after {
  content: '●';
  color: var(--pink);
  font-size: 18px;
}

.dot-slot.error {
  border-color: #ff4444;
  animation: slotShake 0.4s ease-in-out;
}

@keyframes slotShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.dot-slot.success {
  border-color: #69ff94;
  background: rgba(105, 255, 148, 0.1);
  animation: slotPop 0.3s ease-out;
}

@keyframes slotPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1.05); }
}

.login-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 24px;
  cursor: pointer;
}

.login-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-error {
  font-size: 13px;
  color: #ff6b8a;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.3s;
}

.login-error.show {
  opacity: 1;
}

/* ===== Background Effects ===== */
.bg-effects {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 8s ease-in-out infinite;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--purple) 0%, transparent 70%);
  top: -50px;
  right: -80px;
  animation-duration: 10s;
}

.orb-2 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, var(--pink) 0%, transparent 70%);
  bottom: 10%;
  left: -60px;
  animation-duration: 12s;
  animation-delay: -3s;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--neon-purple) 0%, transparent 70%);
  top: 40%;
  right: 30%;
  animation-duration: 14s;
  animation-delay: -6s;
  opacity: 0.25;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(20px, -30px) scale(1.05); }
  50% { transform: translate(-15px, 20px) scale(0.95); }
  75% { transform: translate(25px, 15px) scale(1.03); }
}

#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ===== App Layout ===== */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== Magic Orb Section ===== */
.robot-section {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 20px 0;
  position: relative;
}

.robot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s;
}

.robot-container:active {
  transform: scale(0.96);
}

#orbCanvas {
  width: 160px;
  height: 160px;
}

.emotion-label {
  margin-top: 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  transition: opacity 0.3s;
  min-height: 20px;
}

/* ===== Chat Section ===== */
.chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 12px 12px;
}

.chat-glass {
  flex: 1;
  min-height: 0;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
}

.chat-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.2), transparent, rgba(255, 105, 180, 0.15));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.chat-container {
  height: 100%;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

/* Scrollbar */
.chat-container::-webkit-scrollbar {
  width: 4px;
}
.chat-container::-webkit-scrollbar-track {
  background: transparent;
}
.chat-container::-webkit-scrollbar-thumb {
  background: rgba(124, 77, 255, 0.3);
  border-radius: 2px;
}

/* Welcome */
.welcome-message {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 2;
  animation: fadeIn 0.6s ease-out;
}

/* Messages */
.message {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: msgIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.message.user {
  align-self: flex-start;
}

.message.assistant {
  align-self: flex-end;
}

.message .bubble {
  padding: 12px 18px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.7;
  word-wrap: break-word;
  white-space: pre-wrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  transition: border-color 0.3s;
}

.message .bubble:active {
  border-color: var(--glass-border-hover);
}

.message.user .bubble {
  background: var(--user-bubble);
  border-bottom-right-radius: 6px;
}

.message.assistant .bubble {
  background: var(--bot-bubble);
  border-bottom-left-radius: 6px;
  border-color: rgba(255, 105, 180, 0.12);
  box-shadow: 0 2px 20px rgba(124, 77, 255, 0.08);
}

/* Typing */
.typing-indicator {
  display: flex;
  align-self: flex-end;
  padding: 14px 22px;
  background: var(--bot-bubble);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 105, 180, 0.12);
  gap: 7px;
  animation: msgIn 0.3s ease-out;
}

.typing-indicator .dot {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border-radius: 50%;
  animation: typeBounce 1.4s ease-in-out infinite;
}
.typing-indicator .dot:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typeBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-10px); opacity: 1; }
}

/* ===== Input Area ===== */
.input-area {
  padding: 10px 4px;
  flex-shrink: 0;
}

.input-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 8px 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
}

.input-form::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.15), transparent, rgba(255, 105, 180, 0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.input-form:focus-within {
  border-color: var(--pink);
  box-shadow: 0 0 30px var(--pink-glow), 0 0 60px rgba(124, 77, 255, 0.15);
}

.input-form:focus-within::before {
  opacity: 1;
}

textarea {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-light);
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  resize: none;
  outline: none;
  max-height: 100px;
  line-height: 1.5;
  direction: rtl;
  padding: 6px 0;
}

textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

button[type="submit"] {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

button[type="submit"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.2s;
}

button[type="submit"]:hover::after {
  opacity: 1;
}

button[type="submit"]:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px var(--pink-glow), 0 0 40px rgba(124, 77, 255, 0.2);
}

button[type="submit"]:active {
  transform: scale(0.93);
}

button[type="submit"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== 3-Dot Menu ===== */
.menu-wrapper {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 12px;
  transition: background 0.2s;
}

.menu-btn:hover {
  background: rgba(255, 105, 180, 0.1);
}

.menu-btn span {
  display: block;
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: background 0.2s;
}

.menu-btn:hover span {
  background: var(--pink);
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: rgba(30, 15, 60, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 6px;
  min-width: 160px;
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.menu-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text-light);
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  text-align: right;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s;
}

.menu-item:hover {
  background: rgba(255, 105, 180, 0.15);
}

.menu-item-danger {
  color: var(--pink);
}

/* ===== Emoji Toggle Button ===== */
.emoji-toggle-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  transition: transform 0.2s;
  line-height: 1;
}

.emoji-toggle-btn:hover {
  transform: scale(1.15);
}

.emoji-toggle-btn:active {
  transform: scale(0.9);
}

/* ===== Emoji Picker ===== */
.emoji-picker {
  display: none;
  background: rgba(20, 10, 45, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  margin-top: 8px;
  padding: 10px;
  animation: pickerIn 0.25s ease-out;
}

.emoji-picker.open {
  display: block;
}

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

.emoji-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.emoji-tabs::-webkit-scrollbar { display: none; }

.emoji-tab {
  background: none;
  border: none;
  font-size: 18px;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 10px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.emoji-tab:hover {
  background: rgba(255, 105, 180, 0.15);
}

.emoji-tab.active {
  background: rgba(255, 105, 180, 0.25);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 77, 255, 0.3) transparent;
}

.emoji-grid::-webkit-scrollbar { width: 4px; }
.emoji-grid::-webkit-scrollbar-thumb { background: rgba(124, 77, 255, 0.3); border-radius: 2px; }

.emoji-btn {
  background: none;
  border: none;
  font-size: 22px;
  padding: 6px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, transform 0.15s;
  text-align: center;
}

.emoji-btn:hover {
  background: rgba(255, 105, 180, 0.15);
  transform: scale(1.2);
}

.emoji-btn:active {
  transform: scale(0.9);
}

/* ===== Clear History Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 2, 15, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: rgba(30, 15, 60, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  max-width: 300px;
  width: 90%;
  animation: pickerIn 0.25s ease-out;
}

.modal-box p {
  font-size: 16px;
  margin-bottom: 20px;
  color: var(--text-light);
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 14px;
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.modal-btn:active {
  transform: scale(0.95);
}

.modal-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
}

.modal-confirm {
  background: linear-gradient(135deg, var(--pink), #d4427a);
  color: white;
  box-shadow: 0 0 15px var(--pink-glow);
}

.modal-confirm:hover {
  box-shadow: 0 0 25px var(--pink-glow);
}

/* ===== Tap Ripple Effect ===== */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 105, 180, 0.3) 0%, transparent 70%);
  transform: scale(0);
  animation: rippleOut 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleOut {
  to { transform: scale(4); opacity: 0; }
}

/* ===== Quick Reply Choices ===== */
.choices-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 6px 0;
  animation: msgIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.choice-btn {
  background: rgba(40, 18, 75, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 105, 180, 0.25);
  color: var(--pink-light);
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.choice-btn:hover {
  border-color: var(--pink);
  background: rgba(255, 105, 180, 0.12);
  box-shadow: 0 0 15px var(--pink-glow);
  transform: scale(1.04);
}

.choice-btn:active {
  transform: scale(0.95);
  background: rgba(255, 105, 180, 0.2);
}

/* ===== Sleep Exercise Widgets ===== */
.exercise-widget {
  align-self: center;
  width: 90%;
  max-width: 320px;
  background: rgba(25, 10, 55, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(200, 140, 255, 0.25);
  border-radius: 24px;
  padding: 20px;
  text-align: center;
  animation: msgIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 30px rgba(124, 77, 255, 0.1), inset 0 0 30px rgba(200, 140, 255, 0.03);
}

.exercise-header {
  font-size: 16px;
  font-weight: 600;
  color: var(--pink-light);
  margin-bottom: 16px;
}

.exercise-start-btn {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: none;
  color: white;
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 28px;
  border-radius: 20px;
  cursor: pointer;
  margin-top: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 15px var(--pink-glow);
}

.exercise-start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px var(--pink-glow);
}

.exercise-start-btn:active {
  transform: scale(0.95);
}

.exercise-stop-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 105, 180, 0.25);
  color: var(--pink-light);
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 20px;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.exercise-stop-btn:hover {
  background: rgba(255, 105, 180, 0.12);
  border-color: var(--pink);
}

.exercise-stop-btn:active {
  transform: scale(0.95);
}

.exercise-start-btn.hidden,
.exercise-stop-btn.hidden {
  display: none;
}

/* --- Breathing Exercise --- */
.breathing-circle-wrapper {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.breathing-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 140, 255, 0.3) 0%, rgba(255, 105, 180, 0.15) 50%, transparent 70%);
  border: 2px solid rgba(200, 140, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 4s ease-in-out, border-color 0.5s, box-shadow 0.5s;
  box-shadow: 0 0 20px rgba(200, 140, 255, 0.15);
}

.breathing-circle.inhale {
  transform: scale(1.5);
  border-color: rgba(200, 180, 255, 0.5);
  box-shadow: 0 0 40px rgba(200, 140, 255, 0.3), 0 0 80px rgba(255, 105, 180, 0.15);
  transition-duration: 4s;
}

.breathing-circle.hold {
  transform: scale(1.5);
  border-color: rgba(255, 200, 240, 0.5);
  box-shadow: 0 0 50px rgba(255, 105, 180, 0.25);
  transition-duration: 0.3s;
}

.breathing-circle.exhale {
  transform: scale(1);
  border-color: rgba(150, 120, 200, 0.3);
  box-shadow: 0 0 15px rgba(124, 77, 255, 0.1);
  transition-duration: 6s;
}

.breathing-circle.done {
  border-color: rgba(105, 255, 180, 0.4);
  box-shadow: 0 0 30px rgba(105, 255, 180, 0.2);
  animation: donePulse 2s ease-in-out infinite;
}

@keyframes donePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.breathing-text {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}

.breathing-counter {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Stars Exercise --- */
.stars-field {
  position: relative;
  height: 200px;
  border-radius: 16px;
  background: radial-gradient(ellipse at center, rgba(15, 5, 35, 0.8) 0%, rgba(5, 2, 20, 0.9) 100%);
  overflow: hidden;
  margin: 8px 0;
}

.stars-field.done {
  background: radial-gradient(ellipse at center, rgba(30, 15, 60, 0.6) 0%, rgba(15, 5, 35, 0.8) 100%);
}

.floating-star {
  position: absolute;
  font-size: 24px;
  cursor: pointer;
  animation: starAppear 0.6s ease-out, starTwinkle 2s ease-in-out infinite;
  transition: transform 0.3s, opacity 0.3s;
  user-select: none;
  -webkit-user-select: none;
}

.floating-star:hover {
  transform: scale(1.3);
}

.floating-star.caught {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

@keyframes starAppear {
  from { transform: scale(0) rotate(-180deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes starTwinkle {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
}

.stars-counter {
  margin-top: 8px;
  font-size: 14px;
  color: var(--pink-light);
  font-weight: 500;
}

/* --- Body Scan Exercise --- */
.bodyscan-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
}

.scan-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(124, 77, 255, 0.2);
  border: 1px solid rgba(124, 77, 255, 0.3);
  transition: background 0.5s, border-color 0.5s, transform 0.3s;
}

.scan-dot.active {
  background: rgba(200, 140, 255, 0.5);
  border-color: rgba(200, 140, 255, 0.6);
}

.scan-dot.current {
  background: var(--pink);
  border-color: var(--pink-light);
  transform: scale(1.3);
  box-shadow: 0 0 10px var(--pink-glow);
}

.bodyscan-part {
  font-size: 20px;
  font-weight: 600;
  color: var(--pink-light);
  margin-bottom: 8px;
  min-height: 30px;
}

.bodyscan-instruction {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  min-height: 44px;
}

/* --- Visualize Exercise --- */
.visualize-scene {
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
}

.visualize-orb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 240, 0.4) 0%, rgba(200, 140, 255, 0.2) 40%, transparent 70%);
  box-shadow: 0 0 40px rgba(255, 105, 180, 0.2), 0 0 80px rgba(200, 140, 255, 0.1);
  animation: vizFloat 6s ease-in-out infinite;
}

@keyframes vizFloat {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 0 40px rgba(255, 105, 180, 0.2), 0 0 80px rgba(200, 140, 255, 0.1); }
  50% { transform: translateY(-10px) scale(1.1); box-shadow: 0 0 60px rgba(255, 105, 180, 0.3), 0 0 100px rgba(200, 140, 255, 0.15); }
}

.visualize-text {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.7;
  min-height: 50px;
  font-weight: 500;
}

.visualize-timer {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Mobile ===== */
@media (max-width: 500px) {
  .app {
    max-width: 100%;
  }
  #orbCanvas {
    width: 140px;
    height: 140px;
  }
  .robot-section {
    padding: 6px 16px 0;
  }
  .chat-section {
    padding: 0 8px 8px;
  }
}

@media (max-height: 650px) {
  #orbCanvas {
    width: 110px;
    height: 110px;
  }
  .robot-section {
    padding: 4px 16px 0;
  }
  .emotion-label {
    font-size: 11px;
  }
}
