/* Content Protection - Disable text selection */
* {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Allow selection in input fields */
input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Generic hidden class */
.hidden {
  display: none !important;
}

/* CSS Custom Properties for theming */
:root {
  /* Dynamic color palette - updated by JavaScript */
  --primary-color: #007E02;
  --primary-pastel: #CCE5CC;
  --primary-dark: rgb(0, 88, 1);
  --primary-light: #CCE5CC;
  --primary-contrast: #2c2c2c;
  --bg-color: rgb(235, 243, 235);
  --bg-secondary: rgb(246, 251, 246);
  --controls-bg: rgb(225, 237, 225);
  --text-color: #2c2c2c;
  --text-muted: #6b7280;
  --text-accent: #007E02;
  --petal-color: #007E02;
  --ring-color: #007E02;
  --accent-color: #007E02;
  --button-bg: #ffffff;
  --button-hover: rgb(246, 251, 246);
  --button-active: rgb(235, 243, 235);
  --input-bg: #ffffff;
  --input-border: #d1d5db;
  --border-color: rgb(250, 253, 250);
  --success-color: #22c55e;
  --warning-color: #f59e0b;
  --glow-color: rgba(0, 126, 2, 0.4);
  --lotus-center: #007E02;
}

/* White chakra theme - white theme with subtle grey contrasts */
.white-chakra-theme {
  --primary-color: #FFFFFF;
  --primary-pastel: #F8F8F8;
  --primary-dark: #E0E0E0;
  --primary-light: #FFFFFF;
  --primary-contrast: #282828;
  --bg-color: #FEFEFE;
  --bg-secondary: #FFFFFF;
  --controls-bg: #F5F5F5;
  --text-color: #282828;
  --text-muted: #666666;
  --text-accent: #282828;
  --petal-color: #FFFFFF;
  --ring-color: #888888;
  --accent-color: #282828;
  --button-bg: #FFFFFF;
  --button-hover: #F0F0F0;
  --button-active: #E8E8E8;
  --input-bg: #FFFFFF;
  --input-border: #CCCCCC;
  --border-color: #DDDDDD;
  --success-color: #22c55e;
  --warning-color: #f59e0b;
  --glow-color: rgba(136, 136, 136, 0.5);
  --lotus-center: #FFFFFF;
}

/* Special icon styling for white chakra theme - add grey outlines for visibility */
.white-chakra-theme .petal {
  stroke: #888888 !important;
  stroke-width: 0.8 !important;
}

/* Lotus icon - add stroke to all paths for visibility */
.white-chakra-theme #lotusIcon path,
.white-chakra-theme #fullscreenLotusIcon path {
  stroke: #AAAAAA !important;
  stroke-width: 1.5 !important;
}

/* Heart icon - add stroke to heart and flames for visibility */
.white-chakra-theme #heartIcon path,
.white-chakra-theme #fullscreenHeartIcon path {
  stroke: #AAAAAA !important;
  stroke-width: 40 !important;
}

/* Circles icon - already visible with strokes, just enhance slightly */
.white-chakra-theme #circlesIcon .circle-layer,
.white-chakra-theme #fullscreenCirclesIcon .circle-layer {
  stroke: #999999 !important;
}

/* White chakra theme - button text visibility on hover */
.white-chakra-theme .primary-btn:hover,
.white-chakra-theme #fullscreenStartPauseBtn:hover {
  color: #000000 !important;
}

/* White chakra theme - randomize button text visibility */
.white-chakra-theme .random-btn {
  color: #000000 !important;
}


/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  animation: pageLoad 0.8s ease-out;
}

/* Accessibility helpers */
.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;
}

/* Focus styles */
*:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Main layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 120px);
  padding: 1.5rem;
  gap: 2rem;
  align-items: center;
  justify-content: flex-start;
  max-width: 1200px;
  margin: 0 auto;
}

/* Breathing area wrapper - contains icon and stats */
.breathing-area-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
}

/* Main view stats panel */
.main-stats-panel {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 2px solid var(--accent-color);
  min-width: 80px;
}

.main-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.main-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1.2;
}

.main-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Breathing Icon container */
.breathing-icon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80%;
  position: relative;
  margin-bottom: 1rem;
}

.breathing-icon {
  width: 100%;
  max-width: 280px;
  height: auto;
  filter: drop-shadow(0 0 20px var(--glow-color));
  transition: filter 0.3s ease, opacity 0.3s ease;
  display: none;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.breathing-icon.active {
  display: block;
  position: relative;
  transform: none;
  left: auto;
}

.lotus-breathing #lotus {
  filter: drop-shadow(0 0 30px var(--glow-color));
}

/* Lotus animations */
.petal {
  transform-origin: 100px 100px;
  transition: transform 0.3s ease-out, opacity 0.3s ease;
}

/* Progress ring */
#progressRing {
  stroke-dasharray: 565.48; /* 2 * π * 90 */
  stroke-dashoffset: 565.48;
  transition: stroke-dashoffset 0.1s linear;
  opacity: 0.8;
}


/* Phase caption */
.lotus-caption {
  margin-top: 1.5rem;
  font-size: 1.8rem;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  text-align: center;
  color: var(--text-accent);
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 2px 8px var(--glow-color);
}

/* Intention display */
.intention-display,
.fullscreen-intention-display {
  color: var(--text-color);
  font-size: 1rem;
  font-style: italic;
  text-align: center;
  margin-top: 0.75rem;
  opacity: 0.85;
  min-height: 1.2rem;
  font-weight: 400;
}

.fullscreen-intention-display {
  font-size: 1.2rem;
  margin-top: 1rem;
}


/* Controls panel */
.controls-panel {
  width: 100%;
  background: var(--controls-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px var(--glow-color);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Top controls layout */
.top-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

/* Preset section */
.preset-section {
  margin-bottom: 0;
}

.preset-section label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-accent);
}

select, input[type="number"] {
  width: 100%;
  padding: 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.9rem;
  min-height: 40px; /* Minimum touch target */
}

select:focus, input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.2);
}

/* Duration inputs */
.duration-inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  text-align: center;
}

/* Help text */
.help-text {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  text-align: center;
  line-height: 1.2;
}

/* Pattern description */
.pattern-description {
  font-family: 'Caveat', cursive;
  font-size: 18px;
  font-weight: 400;
  color: var(--text-color);
  margin-top: 0.75rem;
  padding: 0.5rem;
  text-align: center;
  line-height: 20px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  max-width: 100%;
}

/* Control buttons */
.control-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0;
}

/* Icon and Stats Row - 4 column layout */
.icon-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.icon-selector-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.icon-selector-cell label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-color);
}

.icon-selector-cell .icon-select {
  width: 100%;
  border: 2px solid var(--accent-color);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.inline-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.25rem;
}

.inline-stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.inline-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-color);
}

/* Mobile lifetime stats - hidden on desktop, shown on mobile */
.mobile-lifetime-stats {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 10px;
  border: 2px solid var(--accent-color);
  margin-top: 1rem;
}

.mobile-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
}

.mobile-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-color);
}

.mobile-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.icon-select {
  padding: 0.5rem;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 0.875rem;
  cursor: pointer;
}

button {
  padding: 0.75rem 1.5rem;
  background: var(--button-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  min-width: 44px;
}

button:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
}

button:active {
  background: var(--button-active);
  transform: translateY(0);
}

.primary-btn {
  background: var(--accent-color);
  color: var(--button-text-color, #ffffff) !important;
  font-weight: 600;
  box-shadow: 0 4px 12px var(--glow-color);
}

.primary-btn:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px var(--glow-color);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Settings section */
.settings-section {
  margin-bottom: 1.5rem;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.setting-row label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 0.5rem;
  accent-color: var(--accent-color);
}

.keyboard-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Custom patterns section */
.custom-patterns-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.pattern-overlay {
  position: absolute;
  top: 0;
  left: -0.5rem;
  right: -0.5rem;
  bottom: 0;
  background: rgba(180, 180, 180, 0.85);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.pattern-overlay.hidden {
  display: none;
}

.pattern-overlay-link {
  color: var(--text-accent);
  font-weight: bold;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pattern-overlay-link:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.custom-patterns-section label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-accent);
}

.custom-pattern-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

#customPatternName {
  flex: 1;
  padding: 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.875rem;
}

.save-pattern-btn {
  padding: 0.5rem 1rem;
  background: var(--accent-color);
  color: var(--button-text-color, white);
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}

.save-pattern-btn:hover:not(:disabled) {
  background: white;
  color: var(--accent-color);
}


.saved-patterns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.saved-pattern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font-size: 0.875rem;
}

.pattern-name {
  font-weight: 500;
  color: var(--text-accent);
}

.pattern-details {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.pattern-actions {
  display: flex;
  gap: 0.25rem;
}

.pattern-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

.pattern-load {
  background: var(--petal-color);
  color: black;
  transition: all 0.2s ease;
}

.pattern-load:hover {
  background: white;
  color: black;
}

.pattern-edit {
  background: #6b7280;
  color: white;
}

.pattern-edit:hover {
  background: #4b5563;
  color: white;
}

.pattern-delete {
  background: #000000;
  color: white;
}

.pattern-delete:hover {
  background: #333333;
  color: white;
}

/* Save button editing state */
.save-pattern-btn.editing {
  background: #6b7280;
  animation: pulse-edit 2s infinite;
}

@keyframes pulse-edit {
  0%, 100% { box-shadow: 0 0 0 0 rgba(107, 114, 128, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(107, 114, 128, 0); }
}

/* Stats section */
.stats-section {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.session-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 0.9rem;
  gap: 0.25rem;
}

.stat-item .label {
  font-weight: 500;
}

.stat-item span:last-child {
  font-weight: 600;
  color: var(--text-accent);
  text-shadow: 0 1px 4px var(--glow-color);
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.action-button-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.action-button-group .help-text {
  text-align: center;
  margin-top: 0.5rem;
}

.random-btn {
  background: var(--primary-color);
  color: var(--button-text-color, white);
  font-weight: 600;
  border: none;
  padding: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}


.random-btn:hover {
  color: var(--primary-color);
  background: white;
}

.share-btn {
  width: 100%;
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #e5e7eb !important;
  font-weight: 600;
  padding: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.share-btn:hover {
  background: #f8f9fa !important;
  color: #000000 !important;
  border-color: #d1d5db !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  background: var(--bg-secondary);
}

.footer-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.footer-text {
  text-align: center;
}

.footer-text p {
  margin: 0;
  line-height: 1.4;
  color: var(--text-color);
}

.footer-text a {
  color: #7812FF;
  text-decoration: none;
  font-weight: 500;
}

.footer-text a:hover {
  text-decoration: underline;
}

.tagline {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem !important;
}

.keyboard-shortcuts {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Keyboard shortcuts panel inside controls */
.keyboard-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  opacity: 0.9;
}

.keyboard-hints span {
  background: var(--bg-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.keyboard-hints .fullscreen-hint {
  display: flex;
  align-items: center;
}

.keyboard-hints .fullscreen-hint label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.keyboard-hints .fullscreen-hint input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent-color);
  cursor: pointer;
}

/* Session Complete Modal */
.session-complete-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(8px);
}

.session-complete-modal.hidden {
  display: none;
}

.session-complete-content {
  background: #ffffff;
  border: 2px solid var(--accent-color);
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px var(--accent-glow);
  animation: modalAppear 0.5s ease-out;
}

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

.session-complete-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: gentlePulse 2s infinite;
}

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

.session-complete-title {
  font-family: 'Caveat', cursive;
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px var(--accent-glow);
}

.session-complete-message {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-style: italic;
}

.session-complete-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.complete-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.complete-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
}

.complete-stat-label {
  font-size: 0.9rem;
  color: #777;
  margin-top: 0.25rem;
}

.session-complete-btn {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.session-complete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
  background: #fff;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
}

/* About Link under welcome message */
.about-link-container {
  text-align: center;
  margin: 0.5rem 0 1rem 0;
}

.about-link {
  background: none;
  border: none;
  color: var(--text-accent);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.about-link:hover {
  background: var(--primary-pastel);
}

.about-link-container.hidden {
  display: none;
}

/* About Modal */
.about-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(8px);
}

.about-modal.hidden {
  display: none;
}

.about-modal-content {
  background: #ffffff;
  border: 2px solid var(--accent-color);
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.about-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  z-index: 10;
}

.about-modal-close:hover {
  background: var(--primary-pastel);
  color: var(--text-color);
}

.about-modal-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  animation: gentlePulse 2s infinite;
}

.about-modal-title {
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  color: var(--text-accent);
  margin-bottom: 1.5rem;
}

.about-modal-body {
  text-align: left;
  line-height: 1.7;
  color: var(--text-color);
}

.about-modal-body p {
  margin-bottom: 1rem;
}

.about-modal-body p:last-child {
  margin-bottom: 0;
}

.about-modal-body a {
  color: var(--text-accent);
  text-decoration: underline;
}

.about-modal-btn {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1.5rem;
}

.about-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--glow-color);
  background: #fff;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
}

/* ================================
   LEARN MODAL (Enhanced About)
   ================================ */
.learn-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 1rem;
  backdrop-filter: blur(8px);
}

.learn-modal.hidden {
  display: none;
}

.learn-modal-content {
  background: #ffffff;
  border: 2px solid var(--accent-color);
  border-radius: 20px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.learn-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  z-index: 10;
  line-height: 1;
}

.learn-modal-close:hover {
  background: var(--primary-pastel);
  color: var(--text-color);
}

/* Tab Navigation */
.learn-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  padding: 1rem 1rem 0 1rem;
  gap: 0.5rem;
  flex-shrink: 0;
}

.learn-tab {
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.learn-tab:hover {
  color: var(--text-accent);
}

.learn-tab.active {
  color: var(--text-accent);
  border-bottom-color: var(--accent-color);
}

/* Tab Content */
.learn-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.learn-panel {
  display: none;
}

.learn-panel.active {
  display: block;
}

.learn-panel-title {
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  color: var(--text-accent);
  margin-bottom: 1.5rem;
  text-align: center;
}

.learn-intro {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.learn-section {
  margin-bottom: 1.5rem;
}

.learn-section h3 {
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  color: var(--text-accent);
  margin-bottom: 0.75rem;
}

.learn-section p {
  line-height: 1.7;
  color: var(--text-color);
}

/* Benefits List */
.learn-benefits {
  list-style: none;
  padding: 0;
  margin: 0;
}

.learn-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.benefit-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.benefit-content {
  flex: 1;
}

.benefit-content strong {
  color: var(--text-accent);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

.benefit-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Pattern Examples */
.pattern-examples {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pattern-example {
  background: var(--primary-pastel);
  padding: 1rem;
  border-radius: 12px;
  border-left: 4px solid var(--accent-color);
}

.pattern-example strong {
  color: var(--text-accent);
  display: block;
  margin-bottom: 0.25rem;
}

.pattern-example p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Chakra Accordion */
.chakra-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chakra-item {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.chakra-item:hover {
  border-color: var(--accent-color);
}

.chakra-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
  background: #fff;
  transition: background 0.2s ease;
  width: 100%;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
}

.chakra-header:hover {
  background: var(--primary-pastel);
}

.chakra-color {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chakra-title {
  flex: 1;
}

.chakra-title h3 {
  font-family: 'Caveat', cursive;
  font-size: 1.25rem;
  color: var(--text-accent);
  margin: 0;
}

.chakra-location {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.chakra-toggle {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 300;
  transition: transform 0.3s ease;
}

.chakra-item.expanded .chakra-toggle {
  transform: rotate(45deg);
}

.chakra-details {
  display: none;
  padding: 0 1rem 1rem 1rem;
  background: var(--primary-pastel);
  border-top: 1px solid var(--border-color);
}

.chakra-item.expanded .chakra-details {
  display: block;
}

.chakra-details p {
  margin: 0.5rem 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

.chakra-details p:first-child {
  margin-top: 1rem;
}

.chakra-details strong {
  color: var(--text-accent);
}

/* About Tab Icon */
.about-icon {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 0.5rem;
  animation: gentlePulse 2s infinite;
}

.about-sponsor {
  background: var(--primary-pastel);
  padding: 1rem;
  border-radius: 12px;
  margin-top: 1rem;
}

.about-sponsor a {
  color: var(--text-accent);
  text-decoration: underline;
}

/* Learn Modal Button */
.learn-modal-btn {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 1rem 1.5rem 1.5rem;
  flex-shrink: 0;
}

.learn-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--glow-color);
  background: #fff;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .learn-modal {
    padding: 0;
  }
  
  .learn-modal-content {
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  
  .learn-tabs {
    padding: 0.75rem 0.5rem 0;
    gap: 0.25rem;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  
  .learn-tab {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .learn-tab-content {
    padding: 1rem;
  }
  
  .learn-panel-title {
    font-size: 1.6rem;
  }
  
  .chakra-header {
    padding: 0.75rem;
  }
  
  .chakra-color {
    width: 32px;
    height: 32px;
  }
  
  .chakra-title h3 {
    font-size: 1.1rem;
  }
  
  .learn-modal-btn {
    margin: 1rem;
  }
}

/* Floating About Button */
.floating-about-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  border: none;
  color: var(--accent-color);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 100;
}

.floating-about-btn:hover {
  transform: scale(1.1);
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.floating-about-btn.hidden {
  display: none;
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
  .footer-logo {
    width: 36px;
    height: 36px;
  }
}

/* Three column row */
.two-column-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
}

.three-column-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  align-items: start;
}

.three-column-row > * {
  flex: 1 1 200px;
  min-width: 0;
}

.three-column-row .intention-section {
  flex: 2 1 300px;
}

/* Intention section */
.intention-section {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.intention-section label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-accent);
}

.intention-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

#intentionInput {
  flex: 1;
  padding: 0.5rem 0.8rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.9rem;
  min-height: 40px;
}

.inspire-btn {
  padding: 0.5rem 0.75rem;
  background: var(--text-accent);
  border: 1px solid var(--text-accent);
  border-radius: 6px;
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  min-height: 40px;
}

.inspire-btn:hover {
  background: var(--button-bg);
  color: var(--text-accent);
  border-color: var(--button-border);
}

/* Rounds section */
.rounds-section {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.rounds-section label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-accent);
}

.target-rounds-select {
  width: 100%;
  padding: 0.5rem 0.8rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.9rem;
  min-height: 40px;
  cursor: pointer;
}

.custom-rounds-input {
  width: 100%;
  padding: 0.5rem 0.8rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.9rem;
  min-height: 40px;
  margin-top: 0.5rem;
}

.custom-rounds-input.hidden {
  display: none;
}

/* Audio section */
.audio-section {
  margin-bottom: 1.5rem;
}

.audio-controls {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 1rem;
}

.bell-tone-select, .soundscape-select {
  width: 100%;
  padding: 0.75rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 1rem;
  min-height: 44px;
  cursor: pointer;
}

.volume-slider {
  width: 100%;
  height: 6px;
  background: var(--input-border);
  outline: none;
  border-radius: 3px;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Audio preview button styling */
.audio-control-with-preview {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.audio-control-with-preview select {
  flex: 1;
}

.preview-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  min-width: 48px;
}

.preview-btn:hover {
  background: var(--accent-color);
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.preview-btn:active {
  transform: translateY(0);
}

/* Color picker styles */
.color-picker-section {
  margin-top: 0;
}

.color-picker-section label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-accent);
}

.mood-color-select {
  width: 100%;
  padding: 0.5rem 0.8rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.9rem;
  min-height: 40px;
  cursor: pointer;
}

.mood-color-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--glow-color);
}

.mood-color-select option {
  background: var(--input-bg);
  color: var(--text-color);
  padding: 0.5rem;
}

/* ===== LOTUS MOON ICON ANIMATIONS ===== */
/* Note: Removed old #lotusShape opacity rule - new layered design controls each layer independently */
/* Moon - constant at 40% opacity */
.lotus-moon {
  opacity: 0.4;
  transition: none;
}

/* Stars - twinkling animation (like rainbow) */
.lotus-stars {
  opacity: 0.3;
  animation: lotus-twinkle 2s ease-in-out infinite;
}

@keyframes lotus-twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Lotus petals - sequential breathing animation */
.lotus-petals {
  opacity: 0.1;
  transition: opacity var(--layer-transition) ease-in-out;
}

/* INHALE: Petals appear sequentially from inner to outer (1→2→3→4) */
.phase-inhale .lotus-petals--1 {
  opacity: 1;
  transition-delay: 0s;
}

.phase-inhale .lotus-petals--2 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.phase-inhale .lotus-petals--3 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.phase-inhale .lotus-petals--4 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* EXHALE: Petals fade from outer to inner (4→3→2→1) */
.phase-exhale .lotus-petals--4 {
  opacity: 0.1;
  transition-delay: 0s;
}

.phase-exhale .lotus-petals--3 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.phase-exhale .lotus-petals--2 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.phase-exhale .lotus-petals--1 {
  opacity: 0.3;
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* HOLD states: freeze transitions */
.phase-hold .lotus-petals {
  transition: none;
}

/* Fullscreen lotus icon styles */
.fullscreen-overlay.phase-inhale #fullscreenLotusIcon .lotus-petals--1 {
  opacity: 1;
  transition-delay: 0s;
}

.fullscreen-overlay.phase-inhale #fullscreenLotusIcon .lotus-petals--2 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.fullscreen-overlay.phase-inhale #fullscreenLotusIcon .lotus-petals--3 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.fullscreen-overlay.phase-inhale #fullscreenLotusIcon .lotus-petals--4 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* Fullscreen EXHALE: (4→3→2→1) */
.fullscreen-overlay.phase-exhale #fullscreenLotusIcon .lotus-petals--4 {
  opacity: 0.1;
  transition-delay: 0s;
}

.fullscreen-overlay.phase-exhale #fullscreenLotusIcon .lotus-petals--3 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.fullscreen-overlay.phase-exhale #fullscreenLotusIcon .lotus-petals--2 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.fullscreen-overlay.phase-exhale #fullscreenLotusIcon .lotus-petals--1 {
  opacity: 0.3;
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* Fullscreen HOLD states */
.fullscreen-overlay.phase-hold #fullscreenLotusIcon .lotus-petals {
  transition: none;
}

/* Heart icon - Tiny hearts pulse animation */
.heart-tiny-hearts {
  opacity: 0.4;
  animation: heart-pulse 3s ease-in-out infinite;
}

@keyframes heart-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* Heart layers - sequential breathing animation (like tree icon) */
.heart-layer {
  opacity: 0.1;
  transition: opacity var(--layer-transition) ease-in-out;
}

/* Layer 1 (inner heart) stays constant at 30% opacity */
.heart-layer--1 {
  opacity: 0.3;
  transition: none;
}

/* INHALE: Layers appear sequentially from inner to outer (2→3→4→5→6) */
.phase-inhale .heart-layer--1 {
  opacity: 0.3; /* Stays constant */
}

.phase-inhale .heart-layer--2 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.phase-inhale .heart-layer--3 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.phase-inhale .heart-layer--4 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 3);
}

.phase-inhale .heart-layer--5 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 4);
}

.phase-inhale .heart-layer--6 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 5);
}

/* EXHALE: Layers fade from outer to inner (6→5→4→3→2→1) */
.phase-exhale .heart-layer--6 {
  opacity: 0.1;
  transition-delay: 0s;
}

.phase-exhale .heart-layer--5 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.phase-exhale .heart-layer--4 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.phase-exhale .heart-layer--3 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 3);
}

.phase-exhale .heart-layer--2 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 4);
}

.phase-exhale .heart-layer--1 {
  opacity: 0.3; /* Inner heart stays constant */
}

/* HOLD states: freeze transitions */
.phase-hold .heart-layer {
  transition: none;
}

/* Fullscreen heart icon styles */
.fullscreen-overlay.phase-inhale #fullscreenHeartIcon .heart-layer--1 {
  opacity: 0.3; /* Stays constant */
}

.fullscreen-overlay.phase-inhale #fullscreenHeartIcon .heart-layer--2 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.fullscreen-overlay.phase-inhale #fullscreenHeartIcon .heart-layer--3 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.fullscreen-overlay.phase-inhale #fullscreenHeartIcon .heart-layer--4 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 3);
}

.fullscreen-overlay.phase-inhale #fullscreenHeartIcon .heart-layer--5 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 4);
}

.fullscreen-overlay.phase-inhale #fullscreenHeartIcon .heart-layer--6 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 5);
}

/* Fullscreen EXHALE: (6→5→4→3→2→1) */
.fullscreen-overlay.phase-exhale #fullscreenHeartIcon .heart-layer--6 {
  opacity: 0.1;
  transition-delay: 0s;
}

.fullscreen-overlay.phase-exhale #fullscreenHeartIcon .heart-layer--5 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.fullscreen-overlay.phase-exhale #fullscreenHeartIcon .heart-layer--4 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.fullscreen-overlay.phase-exhale #fullscreenHeartIcon .heart-layer--3 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 3);
}

.fullscreen-overlay.phase-exhale #fullscreenHeartIcon .heart-layer--2 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 4);
}

.fullscreen-overlay.phase-exhale #fullscreenHeartIcon .heart-layer--1 {
  opacity: 0.3; /* Inner heart stays constant */
}

/* Fullscreen HOLD states */
.fullscreen-overlay.phase-hold #fullscreenHeartIcon .heart-layer {
  transition: none;
}

/* Concentric circles breathing animations - Sequential ripple effect */
:root {
  --layer-count: 4;
  --layer-stagger: calc(var(--breath-transition-duration, 4s) / 5);
  --layer-transition: calc(var(--breath-transition-duration, 4s) / 3);
}

/* Base state: All layers except layer 1 are hidden */
.circle-layer {
  opacity: 0;
  transform: scale(0.8);
  transform-origin: center;
  transition: opacity var(--layer-transition) ease-out, 
              transform var(--layer-transition) ease-out;
}

/* Layer 1 (innermost) is always visible at rest */
.circle-layer--1 {
  opacity: 1;
  transform: scale(1);
}

/* Fill overlay starts hidden */
.circle-fill-overlay {
  opacity: 0;
  transform-origin: center;
  transition: opacity var(--layer-transition) ease-out;
}

/* INHALE: Rings appear sequentially from center outward */
.phase-inhale .circle-layer--1 {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0s;
}

.phase-inhale .circle-layer--2 {
  opacity: 1;
  transform: scale(1);
  transition-delay: calc(var(--layer-stagger) * 1);
}

.phase-inhale .circle-layer--3 {
  opacity: 1;
  transform: scale(1);
  transition-delay: calc(var(--layer-stagger) * 2);
}

.phase-inhale .circle-layer--4 {
  opacity: 1;
  transform: scale(1);
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* Fill overlay appears last at peak inhale */
.phase-inhale .circle-fill-overlay {
  opacity: 0.7;
  transition-delay: calc(var(--layer-stagger) * 4);
}

/* HOLD after inhale: Keep all visible */
.phase-hold-inhale .circle-layer {
  opacity: 1;
  transform: scale(1);
  transition: none; /* Stop animation during hold */
}

.phase-hold-inhale .circle-fill-overlay {
  opacity: 0.7;
  transition: none; /* Stop animation during hold */
}

/* EXHALE: Rings fade from outside inward */
.phase-exhale .circle-layer--4 {
  opacity: 0;
  transform: scale(0.8);
  transition-delay: 0s;
}

.phase-exhale .circle-layer--3 {
  opacity: 0;
  transform: scale(0.8);
  transition-delay: calc(var(--layer-stagger) * 1);
}

.phase-exhale .circle-layer--2 {
  opacity: 0;
  transform: scale(0.8);
  transition-delay: calc(var(--layer-stagger) * 2);
}

.phase-exhale .circle-layer--1 {
  opacity: 1;
  transform: scale(1);
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* Fill overlay fades first on exhale */
.phase-exhale .circle-fill-overlay {
  opacity: 0;
  transition-delay: 0s;
}

/* HOLD after exhale: Only center visible */
.phase-hold-exhale .circle-layer {
  opacity: 0;
  transform: scale(0.8);
  transition: none; /* Stop animation during hold */
}

.phase-hold-exhale .circle-layer--1 {
  opacity: 1;
  transform: scale(1);
  transition: none; /* Stop animation during hold */
}

.phase-hold-exhale .circle-fill-overlay {
  opacity: 0;
  transition: none; /* Stop animation during hold */
}

/* ========================================
   SUN ICON ANIMATIONS
   Sun core stays constant, ray layers animate
   ======================================== */

/* Sun core - always visible at 100% */
.icon-sun {
  opacity: 1;
}

/* Ray layers - base state (exhale/rest) */
.ray-layer {
  opacity: 0;
  transition: opacity var(--layer-transition) ease-in-out;
}

/* Ray layer 1 (small rays) always slightly visible */
.ray-layer--1 {
  opacity: 0.3;
}

/* INHALE: Rays appear outward (small → medium → large) */
.phase-inhale .ray-layer--1 {
  opacity: 1;
  transition-delay: 0s;
}

.phase-inhale .ray-layer--2 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.phase-inhale .ray-layer--3 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

/* HOLD after inhale: All rays visible, frozen */
.phase-hold-inhale .ray-layer {
  opacity: 1;
  transition: none;
}

/* EXHALE: Rays fade inward (large → medium → small) */
.phase-exhale .ray-layer--3 {
  opacity: 0;
  transition-delay: 0s;
}

.phase-exhale .ray-layer--2 {
  opacity: 0;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.phase-exhale .ray-layer--1 {
  opacity: 0.3;
  transition-delay: calc(var(--layer-stagger) * 2);
}

/* HOLD after exhale: Only small rays visible, frozen */
.phase-hold-exhale .ray-layer {
  opacity: 0;
  transition: none;
}

.phase-hold-exhale .ray-layer--1 {
  opacity: 0.3;
  transition: none;
}

/* Fullscreen sun icon styles */
#fullscreenSunIcon .icon-sun {
  opacity: 1;
}

#fullscreenSunIcon .ray-layer {
  opacity: 0;
  transition: opacity var(--layer-transition, 0.5s) ease-in-out;
}

/* Fullscreen sun hold states */
.fullscreen-overlay.phase-hold #fullscreenSunIcon .ray-layer {
  transition: none;
}

#fullscreenSunIcon .ray-layer--1 {
  opacity: 0.3;
}

.fullscreen-overlay.phase-inhale #fullscreenSunIcon .ray-layer {
  opacity: 1;
}

.fullscreen-overlay.phase-exhale #fullscreenSunIcon .ray-layer--2,
.fullscreen-overlay.phase-exhale #fullscreenSunIcon .ray-layer--3 {
  opacity: 0;
}

.fullscreen-overlay.phase-exhale #fullscreenSunIcon .ray-layer--1 {
  opacity: 0.3;
}

/* ===== YIN YANG ICON STYLES ===== */
/* Unique animation: Sun brightens on inhale, Moon brightens on exhale (opposite rhythm!) */

/* Base states */
.yinyang-circle {
  opacity: 1;
}

.yinyang-sun {
  opacity: 0.1;
  transition: opacity var(--breath-transition-duration, 4s) ease-in-out;
}

.yinyang-moon {
  opacity: 0.1;
  transition: opacity var(--breath-transition-duration, 4s) ease-in-out;
}

.yinyang-outer-rays {
  opacity: 0.1;
  transition: opacity var(--breath-transition-duration, 4s) ease-in-out;
}

/* INHALE: Sun brightens, moon dims */
.phase-inhale .yinyang-sun {
  opacity: 1;
}

.phase-inhale .yinyang-moon {
  opacity: 0.1;
}

.phase-inhale .yinyang-outer-rays {
  opacity: 0.4;
}

/* EXHALE: Moon brightens, sun dims */
.phase-exhale .yinyang-sun {
  opacity: 0.1;
}

.phase-exhale .yinyang-moon {
  opacity: 1;
}

.phase-exhale .yinyang-outer-rays {
  opacity: 0.1;
}

/* HOLD states: freeze transitions */
.phase-hold .yinyang-sun,
.phase-hold .yinyang-moon,
.phase-hold .yinyang-outer-rays {
  transition: none;
}

/* Fullscreen yin yang icon styles */
#fullscreenYinyangIcon .yinyang-circle {
  opacity: 1;
}

#fullscreenYinyangIcon .yinyang-sun {
  opacity: 0.1;
  transition: opacity var(--breath-transition-duration, 4s) ease-in-out;
}

#fullscreenYinyangIcon .yinyang-moon {
  opacity: 0.1;
  transition: opacity var(--breath-transition-duration, 4s) ease-in-out;
}

#fullscreenYinyangIcon .yinyang-outer-rays {
  opacity: 0.1;
  transition: opacity var(--breath-transition-duration, 4s) ease-in-out;
}

/* Fullscreen INHALE */
.fullscreen-overlay.phase-inhale #fullscreenYinyangIcon .yinyang-sun {
  opacity: 1;
}

.fullscreen-overlay.phase-inhale #fullscreenYinyangIcon .yinyang-moon {
  opacity: 0.1;
}

.fullscreen-overlay.phase-inhale #fullscreenYinyangIcon .yinyang-outer-rays {
  opacity: 0.4;
}

/* Fullscreen EXHALE */
.fullscreen-overlay.phase-exhale #fullscreenYinyangIcon .yinyang-sun {
  opacity: 0.1;
}

.fullscreen-overlay.phase-exhale #fullscreenYinyangIcon .yinyang-moon {
  opacity: 1;
}

.fullscreen-overlay.phase-exhale #fullscreenYinyangIcon .yinyang-outer-rays {
  opacity: 0.1;
}

/* Fullscreen HOLD states */
.fullscreen-overlay.phase-hold #fullscreenYinyangIcon .yinyang-sun,
.fullscreen-overlay.phase-hold #fullscreenYinyangIcon .yinyang-moon,
.fullscreen-overlay.phase-hold #fullscreenYinyangIcon .yinyang-outer-rays {
  transition: none;
}

/* ===== RAINBOW ICON STYLES ===== */
/* Sequential animation: Bows appear from inner to outer on inhale */

/* Stars - twinkling animation */
.rainbow-stars {
  opacity: 1;
  animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Rainbow bows - base state (exhale/rest) */
.rainbow-bow {
  opacity: 0.1;
  transition: opacity var(--layer-transition) ease-in-out;
}

/* Bow layer 1 (innermost) always slightly visible */
.rainbow-bow--1 {
  opacity: 0.3;
}

/* INHALE: Bows appear: bottom(1) → medium(3) → thin(2) → top(4) */
.phase-inhale .rainbow-bow {
  opacity: 1;
}

.phase-inhale .rainbow-bow--1 {
  transition-delay: 0s;
}

.phase-inhale .rainbow-bow--3 {
  transition-delay: calc(var(--layer-stagger) * 1);
}

.phase-inhale .rainbow-bow--2 {
  transition-delay: calc(var(--layer-stagger) * 2);
}

.phase-inhale .rainbow-bow--4 {
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* EXHALE: Bows fade: top(4) → thin(2) → medium(3) → bottom(1) */
.phase-exhale .rainbow-bow--4 {
  opacity: 0.1;
  transition-delay: 0s;
}

.phase-exhale .rainbow-bow--2 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.phase-exhale .rainbow-bow--3 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.phase-exhale .rainbow-bow--1 {
  opacity: 0.3;
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* HOLD states: freeze transitions */
.phase-hold .rainbow-bow {
  transition: none;
}

/* Fullscreen rainbow icon styles */
#fullscreenRainbowIcon .rainbow-stars {
  opacity: 1;
  animation: twinkle 2s ease-in-out infinite;
}

#fullscreenRainbowIcon .rainbow-bow {
  opacity: 0.1;
  transition: opacity var(--layer-transition, 0.5s) ease-in-out;
}

#fullscreenRainbowIcon .rainbow-bow--1 {
  opacity: 0.3;
}

/* Fullscreen INHALE: bottom(1) → medium(3) → thin(2) → top(4) */
.fullscreen-overlay.phase-inhale #fullscreenRainbowIcon .rainbow-bow {
  opacity: 1;
}

.fullscreen-overlay.phase-inhale #fullscreenRainbowIcon .rainbow-bow--1 {
  transition-delay: 0s;
}

.fullscreen-overlay.phase-inhale #fullscreenRainbowIcon .rainbow-bow--3 {
  transition-delay: calc(var(--layer-stagger) * 1);
}

.fullscreen-overlay.phase-inhale #fullscreenRainbowIcon .rainbow-bow--2 {
  transition-delay: calc(var(--layer-stagger) * 2);
}

.fullscreen-overlay.phase-inhale #fullscreenRainbowIcon .rainbow-bow--4 {
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* Fullscreen EXHALE: top(4) → thin(2) → medium(3) → bottom(1) */
.fullscreen-overlay.phase-exhale #fullscreenRainbowIcon .rainbow-bow--4 {
  opacity: 0.1;
  transition-delay: 0s;
}

.fullscreen-overlay.phase-exhale #fullscreenRainbowIcon .rainbow-bow--2 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.fullscreen-overlay.phase-exhale #fullscreenRainbowIcon .rainbow-bow--3 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.fullscreen-overlay.phase-exhale #fullscreenRainbowIcon .rainbow-bow--1 {
  opacity: 0.3;
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* Fullscreen HOLD states */
.fullscreen-overlay.phase-hold #fullscreenRainbowIcon .rainbow-bow {
  transition: none;
}

/* ===== TREE ICON ANIMATIONS ===== */
/* Tree trunk - constant at 100% opacity */
.tree-trunk {
  opacity: 1;
  transition: none;
}

/* Tree leaves - sequential breathing animation */
.tree-leaves {
  opacity: 0.1;
  transition: opacity var(--layer-transition) ease-in-out;
}

/* INHALE: Leaves appear sequentially from inner to outer (1→2→3→4) */
.phase-inhale .tree-leaves--1 {
  opacity: 1;
  transition-delay: 0s;
}

.phase-inhale .tree-leaves--2 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.phase-inhale .tree-leaves--3 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.phase-inhale .tree-leaves--4 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* EXHALE: Leaves fade from outer to inner (4→3→2→1) */
.phase-exhale .tree-leaves--4 {
  opacity: 0.1;
  transition-delay: 0s;
}

.phase-exhale .tree-leaves--3 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.phase-exhale .tree-leaves--2 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.phase-exhale .tree-leaves--1 {
  opacity: 0.3;
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* HOLD states: freeze transitions */
.phase-hold .tree-leaves {
  transition: none;
}

/* Fullscreen tree icon styles */
.fullscreen-overlay.phase-inhale #fullscreenTreeIcon .tree-leaves--1 {
  opacity: 1;
  transition-delay: 0s;
}

.fullscreen-overlay.phase-inhale #fullscreenTreeIcon .tree-leaves--2 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.fullscreen-overlay.phase-inhale #fullscreenTreeIcon .tree-leaves--3 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.fullscreen-overlay.phase-inhale #fullscreenTreeIcon .tree-leaves--4 {
  opacity: 1;
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* Fullscreen EXHALE: (4→3→2→1) */
.fullscreen-overlay.phase-exhale #fullscreenTreeIcon .tree-leaves--4 {
  opacity: 0.1;
  transition-delay: 0s;
}

.fullscreen-overlay.phase-exhale #fullscreenTreeIcon .tree-leaves--3 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 1);
}

.fullscreen-overlay.phase-exhale #fullscreenTreeIcon .tree-leaves--2 {
  opacity: 0.1;
  transition-delay: calc(var(--layer-stagger) * 2);
}

.fullscreen-overlay.phase-exhale #fullscreenTreeIcon .tree-leaves--1 {
  opacity: 0.3;
  transition-delay: calc(var(--layer-stagger) * 3);
}

/* Fullscreen HOLD states */
.fullscreen-overlay.phase-hold #fullscreenTreeIcon .tree-leaves {
  transition: none;
}

/* Legacy petal support for older lotus */
.phase-inhale .petal {
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.phase-exhale .petal {
  opacity: 0.1;
  transition: opacity 0.3s ease;
}

.phase-hold .petal {
  animation: gentle-pulse 3s ease-in-out infinite;
}

@keyframes gentle-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.4; }
}

/* Fullscreen mode styles */
.fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.fullscreen-overlay.hidden {
  display: none;
}

.fullscreen-lotus-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  padding-bottom: 120px; /* Space for stats bar */
}

/* Fullscreen breathing icons - same as main view */
.fullscreen-breathing-icon {
  width: 60vmin;
  height: 60vmin;
  max-width: 400px;
  max-height: 400px;
  filter: drop-shadow(0 0 30px var(--glow-color));
  display: none;
}

.fullscreen-breathing-icon.active {
  display: block;
}

/* Fullscreen icon-specific styles */
#fullscreenHeartIcon .icon-heart {
  opacity: 0.3;
  transition: opacity var(--breath-transition-duration, 4s) ease-in-out;
}

#fullscreenHeartIcon .heart-tiny-hearts {
  opacity: 0.4;
  animation: heart-pulse 3s ease-in-out infinite;
}

#fullscreenCirclesIcon .circle-layer {
  opacity: 0;
  transition: opacity var(--layer-transition, 0.5s) ease-in-out;
}

#fullscreenCirclesIcon .circle-layer--1 {
  opacity: 0.3;
}

#fullscreenCirclesIcon .circle-fill-overlay {
  opacity: 0;
  transition: opacity var(--breath-transition-duration, 4s) ease-in-out;
}

/* Fullscreen phase-specific animations */
.fullscreen-overlay.phase-inhale #fullscreenHeartIcon .icon-heart,
.fullscreen-overlay.phase-hold-in #fullscreenHeartIcon .icon-heart {
  opacity: 0.9;
}

.fullscreen-overlay.phase-inhale #fullscreenCirclesIcon .circle-layer {
  opacity: 1;
}

.fullscreen-overlay.phase-inhale #fullscreenCirclesIcon .circle-fill-overlay,
.fullscreen-overlay.phase-hold-in #fullscreenCirclesIcon .circle-fill-overlay {
  opacity: 0.7;
}

.fullscreen-overlay.phase-exhale #fullscreenHeartIcon .icon-heart,
.fullscreen-overlay.phase-hold-out #fullscreenHeartIcon .icon-heart {
  opacity: 0.3;
}

.fullscreen-overlay.phase-exhale #fullscreenCirclesIcon .circle-layer--2,
.fullscreen-overlay.phase-exhale #fullscreenCirclesIcon .circle-layer--3,
.fullscreen-overlay.phase-exhale #fullscreenCirclesIcon .circle-layer--4 {
  opacity: 0;
}

.fullscreen-overlay.phase-exhale #fullscreenCirclesIcon .circle-fill-overlay,
.fullscreen-overlay.phase-hold-out #fullscreenCirclesIcon .circle-fill-overlay {
  opacity: 0;
}

.fullscreen-caption {
  font-size: 3rem;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  text-align: center;
  color: var(--text-accent);
  margin: 2rem 0;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 4px 16px var(--glow-color);
}

.fullscreen-controls {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
}

.fullscreen-btn {
  padding: 1rem 2rem;
  background: var(--button-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 56px;
  min-width: 120px;
}

.fullscreen-btn:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
}

.fullscreen-btn:active {
  background: var(--button-active);
  transform: translateY(0);
}

/* Fullscreen Start button should use primary styling */
#fullscreenStartPauseBtn {
  background: var(--accent-color);
  color: var(--button-text-color, #ffffff) !important;
  font-weight: 600;
  box-shadow: 0 4px 12px var(--glow-color);
}

#fullscreenStartPauseBtn:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px var(--glow-color);
}

.exit-btn {
  background: #2c2c2c;
  color: white;
}

.exit-btn:hover {
  background: #1a1a1a;
}

/* Fullscreen progress ring */
#fullscreenProgressRing {
  stroke-dasharray: 565.48;
  stroke-dashoffset: 565.48;
  transition: stroke-dashoffset 0.1s linear;
  opacity: 0.8;
}

/* Fullscreen stats bar */
.fullscreen-stats {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 12px 12px 0 0;
  margin: 0 1rem;
  color: var(--text-color);
}

.fullscreen-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
}

.fullscreen-stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.8;
}

.fullscreen-stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-color);
}

/* Disclaimer footer */
.disclaimer-footer {
  text-align: center;
  padding: 1.5rem 2rem;
  margin-top: 1rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.disclaimer-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  opacity: 0.8;
}

.disclaimer-footer .help-line {
  margin-top: 0.5rem;
}

.disclaimer-footer .help-line a {
  color: var(--primary-color);
  text-decoration: none;
}

.disclaimer-footer .help-line a:hover {
  text-decoration: underline;
}

/* Banner container - matches main section width */
.banner-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

/* Banner row */
.banner-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

/* Full width banner layout */
.banner-row.full-width {
  grid-template-columns: 1fr;
  max-width: 100%;
}

.banner-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.banner-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.banner-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .petal {
    transition: none;
    transform: none !important;
    animation: none !important;
  }
  
  #lotus {
    filter: none !important;
  }
  
  button:hover {
    transform: none;
  }
}

/* Responsive design */
/* Tablet and smaller desktop */
@media (max-width: 1024px) {
  .app-container {
    padding: 1.5rem;
    gap: 1.5rem;
    max-width: 900px;
  }
  
  .controls-panel {
    padding: 1.25rem;
  }
}

/* Tablet */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    padding: 1rem;
    gap: 1.5rem;
    max-width: 600px;
  }
  
  .controls-panel {
    flex: none;
    width: 100%;
    padding: 1.25rem;
  }
  
  /* Two-column layouts become single column */
  .top-controls {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .action-buttons {
    grid-template-columns: 1fr;
  }
  
  /* Duration inputs go to 2x2 grid */
  .duration-inputs {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  
  /* Three-column layouts become single column */
  .two-column-row,
  .three-column-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Icon-stats row becomes 2x2 grid on tablet */
  .icon-stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  
  .session-stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .audio-controls {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .banner-row {
    grid-template-columns: 1fr;
  }
  
  .lotus-caption {
    font-size: 1.5rem;
  }
  
  /* Stack stats panel below icon on mobile */
  .main-stats-panel {
    position: static;
    transform: none;
    flex-direction: row;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    min-width: auto;
    margin-top: 1rem;
  }
  
  .breathing-area-wrapper {
    flex-direction: column;
  }
  
  #lotus {
    max-width: 250px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .app-container {
    padding: 1rem;
    gap: 1.25rem;
  }
  
  .controls-panel {
    padding: 1rem;
    border-radius: 8px;
  }
  
  /* All grids become single column on mobile */
  .top-controls {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .duration-inputs {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .session-stats {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    font-size: 0.875rem;
  }
  
  .action-buttons {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .banner-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .two-column-row,
  .three-column-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Icon-stats row stacks on mobile */
  .icon-stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
  }
  
  .inline-stat-label {
    font-size: 0.7rem;
  }
  
  .inline-stat-value {
    font-size: 1rem;
  }
  
  .audio-controls {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .control-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .custom-pattern-controls {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  /* Stack intention input and button on mobile */
  .intention-input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .intention-input-row .inspire-btn {
    width: 100%;
  }
  
  /* Adjust typography and spacing for mobile */
  .lotus-caption {
    font-size: 1.5rem;
  }
  
  #lotus {
    max-width: 200px;
  }
  
  button {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  select, input[type="number"] {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  .help-text {
    font-size: 0.6rem;
  }
  
  /* Fullscreen adjustments */
  .fullscreen-caption {
    font-size: 2rem;
  }
  
  .fullscreen-controls {
    flex-direction: column;
    gap: 1rem;
  }
  
  .fullscreen-stats {
    margin: 0 0.5rem;
    padding: 0.75rem 1rem;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .fullscreen-lotus-container {
    padding-bottom: 200px; /* More space on mobile for larger stats bar */
  }
  
  .fullscreen-stat-item {
    flex-direction: row;
    justify-content: space-between;
    gap: 0.5rem;
  }
  
  .fullscreen-stat-label {
    text-align: left;
  }
  
  .fullscreen-stat-value {
    text-align: right;
  }
  
  .color-options {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  /* Make sure buttons are touch-friendly */
  .pattern-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    min-height: 36px;
  }
}

/* Very small mobile screens */
@media (max-width: 360px) {
  .app-container {
    padding: 0.75rem;
    gap: 1rem;
  }
  
  .controls-panel {
    padding: 0.75rem;
  }
  
  #lotus {
    max-width: 180px;
  }
  
  .lotus-caption {
    font-size: 1.35rem;
  }
  
  button {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .fullscreen-stats {
    margin: 0 0.25rem;
    padding: 0.5rem 0.75rem;
  }
  
  .fullscreen-lotus-container {
    padding-bottom: 180px; /* Adjust for very small mobile screens */
  }
  
  .fullscreen-stat-label {
    font-size: 0.7rem;
  }
  
  .fullscreen-stat-value {
    font-size: 0.85rem;
  }
  
  .preview-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    min-width: 40px;
  }
}

/* Animation states */
.paused {
  animation-play-state: paused;
}

.breathing-active #lotus {
  filter: drop-shadow(0 0 25px var(--glow-color));
}

/* Error states */
.error-state {
  border-color: var(--warning-color) !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2) !important;
}

.error-message {
  color: var(--warning-color);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Loading state */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ========================================
   AUTH BAR STYLES
   ======================================== */

/* Session Resume Banner */
.session-resume-banner {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--controls-bg) 100%);
  border-bottom: 2px solid var(--primary-color);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  font-family: 'Caveat', cursive;
}

.resume-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.resume-text {
  font-size: 1.3rem;
  color: var(--text-color);
}

.resume-details {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.resume-actions {
  display: flex;
  gap: 0.5rem;
}

.resume-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.resume-btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.dismiss-resume-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  cursor: pointer;
}

.dismiss-resume-btn:hover {
  background: var(--bg-secondary);
}

/* Favorite star button */
.pattern-favorite {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
}

.pattern-favorite:hover {
  opacity: 0.7;
  transform: scale(1.1);
}

.pattern-favorite.is-favorite {
  opacity: 1;
}

/* Favorites section */
.favorites-section {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border-color);
}

.favorites-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.auth-bar {
  background: var(--controls-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1rem 0.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Caveat', cursive;
  min-height: 50px;
  position: relative;
  transition: padding 0.3s ease-out, opacity 0.3s ease-out, border-bottom 0.3s ease-out;
}

.auth-bar.dismissed {
  max-height: 8px;
  padding: 0 1rem;
  opacity: 0;
  border-bottom: none;
  min-height: 8px;
  cursor: pointer;
  overflow: hidden;
}

.auth-bar-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.auth-dismiss-x {
  position: absolute;
  right: 0.8rem;
  top: 0;
  bottom: 0;
  margin: auto;
  height: 24px;
  width: 24px;
  background: transparent;
  border: none;
  color: var(--text-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
}

.auth-dismiss-x:hover {
  opacity: 1;
}

.auth-form {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.auth-title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.auth-cta {
  color: var(--text-accent);
  font-size: 1.3rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
  margin-bottom: 2px;
}

.auth-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.auth-note {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.7;
  line-height: 1.2;
}

.auth-input {
  padding: 0.4rem 0.8rem;
  border: 2px solid var(--input-border);
  border-radius: 20px;
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  background: var(--input-bg);
  color: var(--text-color);
  outline: none;
  transition: border-color 0.2s ease;
}

.auth-input:focus {
  border-color: var(--primary-color);
}

.auth-name {
  width: 140px;
}

.auth-email {
  width: 200px;
}

.auth-submit-btn {
  padding: 0.4rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 20px;
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

.auth-confirmation {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 1.5rem;
  background: rgba(0, 126, 2, 0.1);
  border-radius: 20px;
  border: 2px solid var(--primary-color);
}

.auth-confirmation.hidden {
  display: none;
}

.auth-confirmation-msg {
  color: var(--primary-color);
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  font-weight: 600;
  white-space: nowrap;
}

.auth-confirmation-msg a {
  color: var(--primary-color);
  text-decoration: underline;
}

.auth-submit-btn:hover {
  background: white;
  color: var(--text-accent);
}

.auth-submit-btn:active {
  transform: scale(0.98);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-success,
.auth-logged-in,
.auth-error {
  align-items: center;
  gap: 0.8rem;
  justify-content: center;
}

.auth-logged-in:not(.hidden),
.auth-error:not(.hidden) {
  display: flex;
}

.auth-success-message {
  color: var(--text-accent);
  font-size: 1.2rem;
  font-weight: 600;
}

.auth-welcome {
  color: var(--text-accent);
  font-size: 1.3rem;
  font-weight: 600;
}

.auth-error-message {
  color: var(--warning-color);
  font-size: 1.1rem;
}

.auth-dismiss-btn,
.auth-logout-btn {
  padding: 0.3rem 0.8rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--input-border);
  border-radius: 15px;
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.auth-dismiss-btn:hover,
.auth-logout-btn:hover {
  background: var(--button-hover);
}

/* Mobile responsive auth bar */
@media (max-width: 768px) {
  .auth-bar {
    padding: calc(2rem + env(safe-area-inset-top, 0px)) 1rem 1.2rem;
    flex-direction: column;
    align-items: stretch;
  }
  
  .auth-bar-content {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  
  .auth-form {
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
  }
  
  .auth-cta {
    font-size: 1.1rem;
    text-align: center;
  }
  
  .auth-inputs {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .auth-input {
    font-size: 1rem;
    padding: 0.6rem 0.8rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .auth-name {
    width: 100%;
  }
  
  .auth-email {
    width: 100%;
  }
  
  .auth-submit-btn {
    font-size: 1.1rem;
    padding: 0.7rem 1rem;
    width: 100%;
    display: block;
  }
  
  .auth-dismiss-x {
    position: absolute;
    top: calc(0.8rem + env(safe-area-inset-top, 0px));
    right: 0.8rem;
    bottom: auto;
  }
  
  /* Reposition main stats under the icon on mobile */
  .main-stats-panel {
    position: static;
    transform: none;
    flex-direction: row;
    justify-content: space-around;
    gap: 1rem;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    width: 100%;
    min-width: auto;
    box-sizing: border-box;
  }
  
  .main-stat-item {
    flex-direction: column;
  }
  
  .main-stat-value {
    font-size: 1rem;
  }
  
  .main-stat-label {
    font-size: 0.6rem;
  }
  
  /* Hide desktop inline lifetime stats on mobile */
  .icon-stats-row .inline-stat {
    display: none !important;
  }
  
  /* Show mobile lifetime stats */
  .mobile-lifetime-stats {
    display: grid;
  }
  
  /* Make icon selector full width */
  .icon-stats-row {
    display: flex;
    flex-direction: column;
  }
  
  .icon-selector-cell {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}
