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

body {
  margin: 0;
  background: #1a1a2e;
  /* Prevent pull-to-refresh and overscroll on mobile */
  overscroll-behavior-y: contain;
}

/* Prevent iOS bounce/rubber-banding */
html {
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#root {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

:root {
  --vh: 1vh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html, body {
  height: 100%;
  overscroll-behavior: none;
}

/* ===== APP CONTAINER ===== */
.app-container {
  min-height: calc(var(--vh) * 100);
  min-height: 100dvh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  color: #e8e8e8;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Fullscreen-friendly container for post-rating etc */
.fullscreen-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--vh) * 100);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  color: #e8e8e8;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

@media (max-width: 600px) {
  .app-container {
    padding: 12px;
    justify-content: flex-start;
    padding-top: env(safe-area-inset-top, 12px);
  }
}

/* ===== CARD ===== */
.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 32px;
  max-width: 550px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card.welcome-card {
  max-width: 650px;
}

/* Small mobile */
@media (max-width: 600px) {
  .card {
    padding: 20px 16px;
    border-radius: 20px;
    margin-top: 8px;
  }
}

/* iPad and tablets */
@media (min-width: 768px) and (max-width: 1024px) {
  .card {
    padding: 40px;
    max-width: 600px;
    border-radius: 28px;
  }
  .card.welcome-card {
    max-width: 700px;
  }
}

/* iPad landscape */
@media (min-width: 1024px) and (max-height: 850px) {
  .card {
    padding: 36px;
    max-width: 580px;
  }
}

/* ===== TYPOGRAPHY ===== */
.title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.subtitle { font-size: 16px; color: rgba(255, 255, 255, 0.6); font-weight: 500; }
.section-title { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.section-title.center { text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px; }
.section-subtitle { color: rgba(255, 255, 255, 0.7); margin-bottom: 24px; line-height: 1.6; }
.text-center { text-align: center; }
.text-muted { color: rgba(255, 255, 255, 0.6); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.highlight { color: #667eea; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }

@media (max-width: 600px) {
  .title { font-size: 24px; }
  .section-title { font-size: 20px; }
}

/* ===== LOGO ===== */
.logo-container {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

/* ===== INTRO TEXT ===== */
.intro-text { font-size: 15px; line-height: 1.7; color: rgba(255, 255, 255, 0.85); }
.intro-text p { margin-bottom: 12px; }

/* ===== EXPANDABLE SECTIONS ===== */
.expandable-section {
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.expandable-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  transition: background 0.2s;
  touch-action: manipulation;
}

.expandable-header:hover,
.expandable-header:active {
  background: rgba(255, 255, 255, 0.05);
}

.expandable-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.expandable-content {
  padding: 0 20px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  animation: slideDown 0.3s ease;
}

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

.feature-list { list-style: none; padding-left: 0; }
.feature-list li { padding: 6px 0 6px 24px; position: relative; }
.feature-list li::before { content: "•"; position: absolute; left: 8px; color: #667eea; }

/* ===== DISCLAIMER ===== */
.disclaimer-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 16px;
  padding: 20px;
  margin: 20px 0;
}

.disclaimer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.disclaimer-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fbbf24;
  margin: 0;
}

.disclaimer-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
}

.disclaimer-list li {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
}

.disclaimer-list li::before {
  content: "⚠";
  position: absolute;
  left: 0;
  font-size: 12px;
}

.disclaimer-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  transition: background 0.2s;
  touch-action: manipulation;
}

.disclaimer-checkbox:hover,
.disclaimer-checkbox:active {
  background: rgba(0, 0, 0, 0.3);
}

.disclaimer-checkbox input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #667eea;
}

.disclaimer-checkbox span {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  padding: 16px 24px;
  color: white;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  touch-action: manipulation;
  min-height: 52px;
}

.btn-primary:hover,
.btn-primary:active {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}



@media (hover: none) {
  .btn-primary:hover { transform: none; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); }
  .btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }
}

.btn-primary.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary.full-width { width: 100%; }
.btn-primary.large { padding: 20px 32px; font-size: 18px; min-height: 60px; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 14px 20px;
  color: white;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, border-color 0.2s;
  touch-action: manipulation;
  min-height: 48px;
}

.btn-secondary:hover,
.btn-secondary:active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-back {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  margin-bottom: 16px;
  transition: color 0.2s;
  touch-action: manipulation;
}

.btn-back:hover,
.btn-back:active { color: white; }

.button-group { display: flex; gap: 12px; margin-top: 24px; }
.button-group .btn-primary,
.button-group .btn-secondary { flex: 1; }

@media (max-width: 400px) {
  .button-group { flex-direction: column; }
}

/* ===== STEP BOXES ===== */
.step-box {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.step-number {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.step-content h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.step-content p { font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, 0.75); }

/* ===== TIP BOX ===== */
.tip-box {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: rgba(251, 191, 36, 0.1);
  border-radius: 12px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.tip-box p { font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, 0.85); margin: 0; }

/* ===== INPUT ===== */
.input-container { margin-bottom: 24px; }

.text-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: white;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  min-height: 56px;
}

.text-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.text-input:focus { border-color: #667eea; background: rgba(255, 255, 255, 0.1); }
.input-hint { font-size: 13px; color: rgba(255, 255, 255, 0.5); margin-top: 10px; line-height: 1.5; }

/* ===== RATING ===== */
.rating-display {
  font-size: 64px;
  font-weight: 700;
  text-align: center;
  margin: 20px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.slider-container { margin-bottom: 24px; }

.range-input {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  outline: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.5);
}

.range-input::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.5);
}

.range-input.large::-webkit-slider-thumb { width: 36px; height: 36px; }
.range-input.large::-moz-range-thumb { width: 36px; height: 36px; }

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.duration-preview {
  text-align: center;
  padding: 16px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 12px;
  margin-bottom: 24px;
}

.duration-preview p { margin: 0; }
.duration-preview strong { color: #667eea; }

/* ===== INSTRUCTIONS BOX ===== */
.instructions-box {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.instructions-box h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.9);
}

.instructions-list { list-style: none; padding: 0; margin: 0; }

.instructions-list li {
  padding: 10px 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.instructions-list li:last-child { border-bottom: none; }

.instructions-list kbd {
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
}

/* ===== ICON PREVIEW ===== */
.icon-preview { text-align: center; margin-bottom: 24px; }
.icon-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }

.preview-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== DURATION DISPLAY ===== */
.duration-display { text-align: center; margin-bottom: 24px; }
.duration-time { font-size: 36px; font-weight: 700; color: #667eea; }
.inline-icon { display: inline-flex; }

/* ===== EXERCISE CONTAINER ===== */
.exercise-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--vh) * 100);
  height: 100dvh; /* Dynamic viewport height for modern browsers */
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  color: #e8e8e8;
  overflow: hidden;
  cursor: pointer;
  /* Prevent double-tap zoom and improve tap responsiveness */
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  /* Respect notch/safe areas */
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* ===== LANDSCAPE PROMPT ===== */
.landscape-prompt {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.landscape-prompt-content { text-align: center; max-width: 300px; }

.landscape-prompt-content .phone-icon {
  font-size: 60px;
  margin-bottom: 10px;
  display: inline-block;
  animation: tilt 1.5s ease-in-out infinite;
}

@keyframes tilt {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-20deg); }
  75% { transform: rotate(20deg); }
}

.landscape-prompt-content .rotate-arrow { font-size: 36px; margin-bottom: 16px; opacity: 0.7; }
.landscape-prompt-content h3 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.landscape-prompt-content p { font-size: 14px; color: rgba(255, 255, 255, 0.7); line-height: 1.5; }

/* ===== EXERCISE HEADER ===== */
.exercise-header {
  position: absolute;
  top: calc(16px + var(--safe-top));
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  gap: 8px;
}

@media (max-width: 500px) {
  .exercise-header { top: calc(10px + var(--safe-top)); left: 10px; right: 10px; }
}

.timer-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 18px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.timer-text { font-size: 22px; font-weight: 600; font-family: monospace; }

@media (max-width: 400px) {
  .timer-text { font-size: 18px; }
  .timer-box { padding: 8px 14px; }
}

.reaction-counter {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 18px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 500px) {
  .reaction-counter { display: none; }
}

.exercise-controls { display: flex; gap: 8px; }

.control-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 10px 16px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action: manipulation;
  min-height: 44px;
}

.control-btn.end {
  background: rgba(255, 100, 100, 0.2);
  border-color: rgba(255, 100, 100, 0.3);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  position: absolute;
  top: 75px;
  left: 16px;
  right: 16px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

@media (max-width: 500px) {
  .progress-bar { top: 70px; left: 10px; right: 10px; }
}

/* Landscape mobile (iPhone landscape) */
@media (max-height: 500px) {
  .exercise-header { top: calc(8px + var(--safe-top)); left: 10px; right: 10px; }
  .progress-bar { top: 55px; left: 10px; right: 10px; height: 3px; }
  .timer-box { padding: 6px 12px; }
  .timer-text { font-size: 14px; }
  .control-btn { padding: 6px 12px; font-size: 12px; min-height: 36px; }
  .encouragement-eye-level { margin-bottom: 20px; }
  .encouragement-eye-level p { font-size: 16px; }
  .tap-instruction { bottom: calc(15px + var(--safe-bottom)); }
  .tap-instruction p { font-size: 14px; }
}

/* ===== iPad Portrait (768px - 1024px width) ===== */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .exercise-header { top: calc(20px + var(--safe-top)); left: 24px; right: 24px; }
  .progress-bar { top: 85px; left: 24px; right: 24px; height: 5px; }
  .timer-box { padding: 14px 24px; border-radius: 14px; }
  .timer-text { font-size: 26px; }
  .control-btn { padding: 14px 24px; font-size: 16px; min-height: 54px; border-radius: 14px; }
  .exercise-eye-level { left: 60px; right: 60px; }
  .encouragement-eye-level p { font-size: 28px; }
  .encouragement-eye-level { margin-bottom: 50px; }
  .ball { width: 100px; height: 100px; }
  .tap-instruction { bottom: calc(60px + var(--safe-bottom)); }
  .tap-instruction p { font-size: 20px; }
  .reaction-feedback { font-size: 48px; padding: 20px 40px; }
  .reaction-counter { font-size: 16px; padding: 14px 24px; }
}

/* ===== iPad Landscape (1024px+ width, shorter height) ===== */
@media (min-width: 1024px) and (max-height: 850px) {
  .exercise-header { top: calc(16px + var(--safe-top)); left: 30px; right: 30px; }
  .progress-bar { top: 75px; left: 30px; right: 30px; height: 4px; }
  .timer-box { padding: 12px 22px; }
  .timer-text { font-size: 24px; }
  .control-btn { padding: 12px 22px; font-size: 15px; min-height: 50px; }
  .exercise-eye-level { left: 80px; right: 80px; }
  .encouragement-eye-level p { font-size: 26px; }
  .encouragement-eye-level { margin-bottom: 40px; }
  .ball { width: 90px; height: 90px; }
  .tap-instruction { bottom: calc(40px + var(--safe-bottom)); }
  .tap-instruction p { font-size: 18px; }
}

/* ===== Large Desktop (1200px+) ===== */
@media (min-width: 1200px) {
  .exercise-eye-level { left: 100px; right: 100px; }
  .ball { width: 100px; height: 100px; }
  .encouragement-eye-level p { font-size: 28px; }
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 1s linear;
}

/* ===== EYE LEVEL CONTAINER ===== */
.exercise-eye-level {
  position: absolute;
  top: 50%;
  left: 30px;
  right: 30px;
  transform: translateY(-50%);
}

@media (max-width: 500px) {
  .exercise-eye-level { left: 20px; right: 20px; }
}

.encouragement-eye-level { text-align: center; margin-bottom: calc(40px + var(--safe-bottom)); }

.encouragement-eye-level p {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
  transition: opacity 0.5s;
  margin: 0;
}

@media (max-width: 500px) {
  .encouragement-eye-level { margin-bottom: 30px; }
  .encouragement-eye-level p { font-size: 18px; padding: 0 10px; }
}

/* ===== BALL TRACK ===== */
.track-line {
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
}

.ball-wrapper {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  animation: moveBall 2s ease-in-out infinite alternate;
  /* Use CSS custom property for ball size to sync with animation */
  --ball-size: 80px;
}

.ball-wrapper.paused { animation-play-state: paused; }

@keyframes moveBall {
  0% { left: 0; }
  100% { left: calc(100% - var(--ball-size, 80px)); }
}

.ball {
  width: var(--ball-size, 80px);
  height: var(--ball-size, 80px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, box-shadow 0.3s;
}

/* Small phones */
@media (max-width: 400px) {
  .ball-wrapper { --ball-size: 60px; }
  .ball { width: 60px; height: 60px; }
}

/* Landscape mobile (iPhone landscape) */
@media (max-height: 500px) {
  .ball-wrapper { --ball-size: 60px; }
  .ball { width: 60px; height: 60px; }
  .exercise-eye-level { left: 15px; right: 15px; }
}

/* iPad Portrait - larger ball */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .ball-wrapper { --ball-size: 100px; }
  .ball { width: 100px; height: 100px; }
}

/* iPad Landscape - slightly smaller but still big */
@media (min-width: 1024px) and (max-height: 850px) {
  .ball-wrapper { --ball-size: 90px; }
  .ball { width: 90px; height: 90px; }
}

/* Large desktop */
@media (min-width: 1200px) {
  .ball-wrapper { --ball-size: 100px; }
  .ball { width: 100px; height: 100px; }
}

/* ===== TAP INSTRUCTION ===== */
.tap-instruction {
  position: absolute;
  bottom: calc(40px + var(--safe-bottom));
  left: 20px;
  right: 20px;
  text-align: center;
}

.tap-instruction p { font-size: 18px; color: rgba(255, 255, 255, 0.5); }

@media (max-width: 500px) {
  .tap-instruction { bottom: calc(30px + var(--safe-bottom)); }
  .tap-instruction p { font-size: 14px; }
}

/* ===== REACTION FEEDBACK ===== */
/* Container keeps fixed height to prevent layout shift */
.score-container {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

/* Inline score that fades in/out without position changes */
.reaction-feedback-inline {
  background: rgba(0, 0, 0, 0.8);
  padding: 12px 28px;
  border-radius: 14px;
  font-size: 32px;
  font-weight: 700;
  animation: fadeScale 0.2s ease-out;
}

@keyframes fadeScale {
  0% { 
    opacity: 0; 
    transform: scale(0.85); 
  }
  100% { 
    opacity: 1; 
    transform: scale(1); 
  }
}

@media (max-width: 500px) {
  .score-container {
    height: 60px;
    margin-bottom: 8px;
  }
  .reaction-feedback-inline {
    padding: 10px 24px;
    font-size: 28px;
  }
}

@media (max-height: 500px) {
  .score-container {
    height: 50px;
    margin-bottom: 5px;
  }
  .reaction-feedback-inline {
    padding: 8px 20px;
    font-size: 24px;
  }
}

/* ===== FLASH WORDS ===== */
@keyframes flashIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ===== PAUSED OVERLAY ===== */
.paused-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.paused-content { text-align: center; }
.paused-text { font-size: 24px; margin: 20px 0; }

/* ===== POST RATING ===== */
.complete-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
}

.progress-comparison {
  background: rgba(102, 126, 234, 0.1);
  padding: 15px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.progress-comparison .positive { color: #4ade80; }
.progress-comparison .negative { color: #f87171; }
.progress-message { font-size: 13px; color: #4ade80; margin-top: 8px; }

/* ===== POSITIVITY SCREEN ===== */
.positivity-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--vh) * 100);
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 50%, #1a3a5c 100%);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  color: #e8e8e8;
  overflow: hidden;
}

.particles { position: absolute; inset: 0; overflow: hidden; opacity: 0.3; }

.particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

.positivity-timer {
  position: absolute;
  top: 30px;
  right: 30px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 20px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 18px;
  font-family: monospace;
  z-index: 10;
}

.positivity-instruction {
  position: absolute;
  top: 30px;
  left: 30px;
  right: 120px;
  text-align: center;
}

.positivity-instruction p { font-size: 14px; color: rgba(255, 255, 255, 0.5); margin: 0; }

@media (max-width: 500px) {
  .positivity-instruction { top: 80px; left: 20px; right: 20px; }
}

@media (max-height: 500px) {
  .positivity-timer { top: 10px; right: 15px; padding: 6px 12px; font-size: 14px; }
  .positivity-instruction { top: 10px; left: 15px; right: 100px; }
  .positivity-instruction p { font-size: 12px; }
  .eye-level-container { left: 15px; right: 15px; }
  .affirmation-eye-level { margin-bottom: 20px; }
  .affirmation-text-inline { font-size: 20px; }
  .affirmation-icon-inline { width: 36px; height: 36px; }
  .breathing-guide { bottom: 10%; }
  .breathing-circle { width: 50px; height: 50px; }
  .skip-button-container { bottom: 10px; }
}

.eye-level-container {
  position: absolute;
  top: 50%;
  left: 30px;
  right: 30px;
  transform: translateY(-50%);
}

@media (max-width: 500px) {
  .eye-level-container { left: 20px; right: 20px; }
}

.affirmation-eye-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: calc(40px + var(--safe-bottom));
  text-align: center;
}

.affirmation-icon-inline {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  animation: pulse 2s ease-in-out infinite;
}

.affirmation-text-inline {
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.5s ease-out;
  margin: 0;
}

@media (max-width: 500px) {
  .affirmation-text-inline { font-size: 20px; }
  .affirmation-icon-inline { width: 40px; height: 40px; }
  .affirmation-eye-level { margin-bottom: 30px; }
}

.positivity-track { background: rgba(255, 255, 255, 0.08); }
.positivity-ball-wrapper { animation-duration: 2.5s; }

.positivity-ball {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 400px) {
  .positivity-ball { width: 50px; height: 50px; }
}

.breathing-guide {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.breathing-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid rgba(240, 147, 251, 0.4);
  margin: 0 auto 12px;
  animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.7); opacity: 0.3; border-color: rgba(240, 147, 251, 0.2); }
  50% { transform: scale(1.3); opacity: 1; border-color: rgba(240, 147, 251, 0.8); }
}

.breathing-text { font-size: 13px; color: rgba(255, 255, 255, 0.5); }

@media (max-width: 500px) {
  .breathing-guide { bottom: 18%; }
  .breathing-circle { width: 70px; height: 70px; }
}

.skip-button-container {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
}

@media (max-width: 500px) {
  .skip-button-container { bottom: 20px; }
}

/* ===== CONGRATULATORY SCREEN ===== */
.positivity-congrats-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 50%, #1a3a5c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.positivity-congrats-content {
  text-align: center;
  max-width: 400px;
  animation: fadeInUp 0.5s ease-out;
}

.congrats-emojis {
  font-size: 48px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.congrats-emoji { display: inline-block; }
.congrats-emoji.bounce-1 { animation: bounce 1s ease-in-out infinite; animation-delay: 0s; }
.congrats-emoji.bounce-2 { animation: bounce 1s ease-in-out infinite; animation-delay: 0.2s; }
.congrats-emoji.bounce-3 { animation: bounce 1s ease-in-out infinite; animation-delay: 0.4s; }

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

.congrats-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.congrats-subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
}

.congrats-message {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 24px;
}

.congrats-message p {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.congrats-emojis-bottom {
  font-size: 32px;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.congrats-btn { min-width: 200px; }

@media (max-width: 500px) {
  .congrats-emojis { font-size: 40px; }
  .congrats-title { font-size: 28px; }
  .congrats-subtitle { font-size: 16px; }
  .congrats-emojis-bottom { font-size: 28px; }
}

/* ===== COMPLETION SCREEN ===== */
.success-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 30px rgba(74, 222, 128, 0.4);
}

.success-title { font-size: 32px; font-weight: 700; margin-bottom: 15px; }
.success-subtitle { color: rgba(255, 255, 255, 0.7); margin-bottom: 24px; line-height: 1.7; }

.positivity-options {
  background: rgba(255, 255, 255, 0.05);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 24px;
}

.positivity-options-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.positivity-buttons { display: flex; gap: 12px; margin-top: calc(16px + var(--safe-top)); }

@media (max-width: 400px) {
  .positivity-buttons { flex-direction: column; }
}

.btn-positivity {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  color: white;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, border-color 0.2s;
  touch-action: manipulation;
}

.btn-positivity:hover,
.btn-positivity:active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.duration-badge { font-size: 12px; color: rgba(255, 255, 255, 0.5); }

.divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.divider span { padding: 0 16px; font-size: 13px; color: rgba(255, 255, 255, 0.4); }

.self-care-box {
  background: rgba(74, 222, 128, 0.1);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.self-care-box h3 { font-size: 16px; margin-bottom: 12px; color: #4ade80; }
.self-care-box ul { list-style: none; line-height: 2; color: rgba(255, 255, 255, 0.7); font-size: 14px; }
.self-care-box li::before { content: "• "; color: #4ade80; }

/* ===== SCREEN TRANSITIONS ===== */
.screen-wrapper {
  width: 100%;
  max-width: 650px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.screen-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.screen-wrapper.hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

/* ===== POSITIVITY MODE STYLES ===== */
.exercise-container.positivity-mode {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 50%, #1a3a5c 100%);
}

.progress-fill.positivity {
  background: linear-gradient(90deg, #f093fb, #f5576c);
}

/* ===== SESSION CONGRATS OVERLAY ===== */
.session-congrats-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
  transition: opacity 0.25s ease;
}

.session-congrats-overlay.visible {
  opacity: 1;
}

.session-congrats-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.positivity-mode .session-congrats-overlay {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 50%, #1a3a5c 100%);
}

.session-congrats-content {
  text-align: center;
  max-width: 400px;
  animation: fadeInUp 0.5s ease-out;
}

/* ===== KIDS MODE LINK ===== */
.kids-mode-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  border-radius: 12px;
  transition: color 0.2s ease, background 0.2s ease;
}
.kids-mode-link:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
}

/* ===== UTILITIES ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
::selection { background: rgba(102, 126, 234, 0.3); }
