@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&family=Sora:wght@200;300;400&display=swap');

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

:root {
  --cream: #F2EDE3; --oat: #E8E1D4; --charcoal: #1E1B18;
  --stone: #7A7368; --plum: #6D6278; --plum-light: #B0A8BF;
  --plum-dark: #22202A; --bg: #0C0B0A;
  --accent-mood: #B0A8BF;
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Sora', sans-serif;
}

html, body {
  height: 100%; overflow: hidden; background: var(--bg);
  color: var(--cream); font-family: var(--font-body);
  font-weight: 200; -webkit-font-smoothing: antialiased;
}

#app { position: relative; width: 100%; height: 100%; opacity: 0; transition: opacity 1.5s ease; }
#app.loaded { opacity: 1; }

#orb-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; cursor: pointer; transition: opacity 1.2s ease; }
body.instructions-showing #orb-canvas { opacity: 0.12; }
body.instructions-showing #progress-ring { opacity: 0.12; transition: opacity 1.2s ease; }

/* Progress ring is visible as a faint frame during idle / mood selection,
   then brightens when a session begins. */
#progress-ring { opacity: 0.15; transition: opacity 1s ease; z-index: 5; }
body.orb-session-active #progress-ring { opacity: 0.6; }

/* ─── Identity ────────────────────────────────────────────────────── */
#identity {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  text-align: center; padding: 48px 24px 12px;
  transition: opacity 1s ease, transform 1s ease; pointer-events: none;
}
#identity { opacity: 0.6; }
#identity.minimal { opacity: 0.15; transform: translateY(-20px); }
#identity .name { font-family: var(--font-display); font-weight: 300; font-size: 24px; letter-spacing: 0.08em; text-shadow: 0 0 20px rgba(0,0,0,0.3); }

/* ─── Mood Selector ───────────────────────────────────────────────── */
#mood-selector {
  position: fixed; top: 116px; left: 50%; transform: translateX(-50%);
  z-index: 10; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  width: calc(100% - 32px); max-width: 720px; padding: 0 4px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#mood-selector.hidden-in-session { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(-10px); }

.mood-card {
  padding: 16px 12px 14px; border-radius: 14px; cursor: pointer;
  background: rgba(12,11,10,0.65); border: 1px solid rgba(255,255,255,0.1);
  text-align: center; transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
  -webkit-tap-highlight-color: transparent; min-height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.mood-card::before {
  content: ''; position: absolute; inset: 0; border-radius: 14px;
  background: radial-gradient(ellipse at center bottom, var(--accent-mood), transparent 70%);
  opacity: 0; transition: opacity 0.4s ease;
}
.mood-card:hover { background: rgba(12,11,10,0.75); border-color: rgba(255,255,255,0.18); transform: translateY(-1px); }
.mood-card:hover::before { opacity: 0.1; }
.mood-card:active { transform: scale(0.97); transition-duration: 0.1s; }
.mood-card.selected {
  background: rgba(12,11,10,0.7); border-color: var(--accent-mood);
  box-shadow: 0 0 24px -4px var(--accent-mood), inset 0 0 16px -6px var(--accent-mood);
}
.mood-card.selected::before { opacity: 0.15; }
.mood-card.selected::after {
  content: ''; display: block; width: 24px; height: 2px; margin: 6px auto 0;
  background: var(--accent-mood); border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-mood);
}
.mood-name {
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-size: 22px; display: block; line-height: 1.2; position: relative; z-index: 1;
  color: var(--cream); text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}
.mood-sub {
  font-size: 12px; font-weight: 200; color: rgba(242,237,227,0.85);
  display: block; margin-top: 3px; letter-spacing: 0.03em; position: relative; z-index: 1;
}

/* ─── Session Layer ───────────────────────────────────────────────── */
#session-layer {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10; pointer-events: none;
  opacity: 0; transition: opacity 0.8s ease;
}
#session-layer.active { opacity: 1; }

/* Ring sits at the ORB'S MAX diameter — orb fills into it from within.
   Orb max world radius = 1.35 at cam dist 3.5 focal 1.8 → ~69% of viewport.
   Ring at 78vh/vw guarantees it sits just outside max orb, on any screen.
   Vertical position matches the shader's uv.y shift (0.18 NDC on landscape). */
#progress-ring {
  position: absolute; top: 59%; left: 50%;
  transform: translate(-50%, -50%);
  width: 82vmin; height: 82vmin;
  pointer-events: none;
}
#progress-ring circle { fill: none; stroke-width: 2.5; }
.ring-bg { stroke: rgba(176,168,191,0.15); }
.ring-fill {
  stroke: var(--accent-mood); opacity: 0.85; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: center; transition: stroke 0.8s ease;
  filter: drop-shadow(0 0 8px var(--accent-mood));
}

/* Phase label: minimal peripheral text in bottom third, no pill chrome. */
#phase-label {
  position: absolute; top: 78%; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-size: 28px; line-height: 1.2; color: var(--cream); opacity: 0;
  transition: opacity 0.5s ease;
  text-align: center; max-width: calc(100vw - 48px); pointer-events: none;
  letter-spacing: 0.04em;
  /* Dark halo so cream text stays legible against every mood palette
     (Peace, Primal, Sage, Spirit, Ocean, Ember) regardless of orb glow. */
  text-shadow: 0 0 12px rgba(0,0,0,0.7), 0 2px 18px rgba(0,0,0,0.85), 0 0 40px rgba(0,0,0,0.55);
}
#session-layer.active #phase-label { opacity: 0.85; }
#session-layer.active #phase-label:empty { opacity: 0; }
#phase-label.phase-enter { animation: phaseEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes phaseEnter {
  0% { opacity: 0; transform: translateX(-50%) translateY(4px); }
  100% { opacity: 0.85; transform: translateX(-50%); }
}
/* Body scan: one cue per full breath cycle (inhale 4s + exhale 6s = 10s).
   Fades in at cycle start, holds through both phases, fades out before
   the next cycle begins. Pure CSS animation triggered on cycleStart. */
#phase-label.body-cycle { animation: bodyCycle 10s ease forwards; }
@keyframes bodyCycle {
  0%   { opacity: 0; transform: translateX(-50%) translateY(4px); }
  10%  { opacity: 0.85; transform: translateX(-50%); }
  82%  { opacity: 0.85; transform: translateX(-50%); }
  100% { opacity: 0; transform: translateX(-50%); }
}

/* Mode explainer: soft whisper-line shown when a technique is tapped.
   Positioned high above the orb, fades in at 0.6 opacity, fades out
   after 3s via a JS class toggle. Not a modal, not a tooltip. */
#mode-explainer {
  position: fixed; top: 38%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-size: 15px; line-height: 1.5; color: var(--cream);
  text-align: center; max-width: min(420px, calc(100vw - 48px));
  letter-spacing: 0.02em; pointer-events: none; z-index: 15;
  opacity: 0; transition: opacity 0.8s ease;
  text-shadow: 0 0 12px rgba(0,0,0,0.7), 0 1px 8px rgba(0,0,0,0.6);
}
#mode-explainer.visible { opacity: 0.6; }

/* Sub-label removed — phase label alone, no competing secondary text. */
#phase-sub { display: none; }

/* Countdown sits at orb center. Position matches shader's orbShift exactly:
   landscape uv.y=0.18 → screen y=59%, portrait uv.y=0.05 → 52.5% (mobile override).
   Large, ambient, with strong shadow so it reads over any mood's visuals. */
#countdown {
  position: absolute; top: 59%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(96px, 18vmin, 180px);
  line-height: 1; color: #ffffff; opacity: 0;
  transition: opacity 0.3s ease; pointer-events: none; white-space: nowrap;
  text-shadow: 0 0 28px rgba(0,0,0,0.95), 0 2px 40px rgba(0,0,0,0.9), 0 0 80px rgba(0,0,0,0.8);
}
#session-layer.active #countdown { opacity: 0.55; }
#countdown.countdown-pulse { animation: countdownPulse 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes countdownPulse {
  0% { transform: translate(-50%, -50%) scale(1.25); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.55; }
}

/* cycle-counter removed — #countdown now serves as the single focal number */
#cycle-counter { display: none; }

/* ─── Pre-session cue (single line, fades in/out) ─────────────────── */
#presession-cue {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15; pointer-events: none; text-align: center;
  max-width: calc(100vw - 48px);
  opacity: 0; transition: opacity 1.5s ease;
}
#presession-cue.visible { opacity: 1; }
#presession-cue.fading-out { opacity: 0; transition: opacity 1s ease; }
#presession-cue p {
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-size: 28px; line-height: 1.4; color: var(--cream);
  text-shadow: 0 2px 16px rgba(0,0,0,0.8), 0 0 40px rgba(0,0,0,0.5);
  letter-spacing: 0.02em;
}
@media (max-width: 480px) { #presession-cue p { font-size: 22px; } }

/* Portrait alignment: shader uses orbShift=0.05 when height>width, putting
   the orb at 52.5% from top. Ring, countdown, and orb-count must match.
   This orientation query mirrors the shader's uResolution.y>uResolution.x check
   so the ring stays centered on the orb on tablets and large phones too. */
@media (orientation: portrait) {
  #progress-ring { top: 52.5%; }
  #countdown { top: 52.5%; }
  #orb-count { top: 52.5%; }
}

/* ─── Idle Prompt ─────────────────────────────────────────────────── */
#idle-prompt {
  position: fixed; top: 92px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-body); font-weight: 200;
  font-size: 12px; color: var(--stone); z-index: 10; pointer-events: none;
  letter-spacing: 0.14em;
  transition: opacity 0.6s ease;
}
#idle-prompt.hidden { opacity: 0; }
@keyframes idlePulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.7; } }

/* ─── Instruction Overlay ─────────────────────────────────────────── */
#instruction-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,11,10,0.7); backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none; transition: opacity 1.2s ease;
}
#instruction-overlay.visible { opacity: 1; pointer-events: auto; cursor: pointer; }
#instruction-overlay.dissolving { opacity: 0; pointer-events: none; transition: opacity 1.8s ease; }

.instruction-inner {
  max-width: 420px; text-align: center; padding: 40px 32px;
}
.instruction-text {
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-size: 22px; line-height: 1.9; color: var(--cream); opacity: 0.95;
  text-align: left; display: inline-block;
  text-shadow: 0 1px 12px rgba(0,0,0,0.6);
}
.instruction-text .bullet-line {
  display: block; position: relative; padding-left: 22px;
}
.instruction-text .bullet-line::before {
  content: '·'; position: absolute; left: 6px; top: -2px;
  color: var(--accent-mood); font-size: 28px; line-height: 1; opacity: 0.8;
}
.instruction-cta {
  display: inline-block; margin-top: 28px; font-size: 13px; font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-mood);
  opacity: 0.8; animation: idlePulse 2s ease-in-out infinite;
  padding: 14px 32px; border: 1px solid rgba(176,168,191,0.2); border-radius: 28px;
  transition: opacity 0.3s ease, border-color 0.3s ease;
  background: transparent; font-family: var(--font-body); cursor: pointer;
  min-height: 44px; min-width: 44px;
}
.instruction-cta:hover { border-color: var(--accent-mood); opacity: 1; }
.instruction-cta:active { transform: scale(0.97); }
.instruction-cta:focus-visible { outline: 2px solid var(--accent-mood); outline-offset: 2px; }

/* ─── Tap Ripple ──────────────────────────────────────────────────── */
.tap-ripple {
  position: fixed; width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%; border: 1px solid var(--accent-mood); opacity: 0.5;
  pointer-events: none; z-index: 50;
  animation: rippleExpand 0.6s ease-out forwards;
}
@keyframes rippleExpand {
  0% { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(4); opacity: 0; }
}

/* ─── Ready Panel (mood selected, technique loaded) ──────────────── */
#ready-panel {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  padding: 24px 24px 44px; text-align: center;
  background: linear-gradient(transparent, rgba(12,11,10,0.95) 30%);
  opacity: 0; pointer-events: none; transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.16,1,0.3,1);
}
#ready-panel.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
#ready-panel.fading { opacity: 0; transform: translateY(-10px); transition-duration: 0.8s; }

.ready-inner { max-width: 400px; margin: 0 auto; }
.ready-technique {
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-size: 24px; color: var(--cream); margin-bottom: 4px;
}
.ready-detail {
  font-weight: 200; font-size: 13px; color: var(--plum-light); opacity: 0.7;
  margin-bottom: 20px; letter-spacing: 0.05em;
}
#ready-begin {
  padding: 16px 52px; border-radius: 32px;
  border: 1px solid rgba(176,168,191,0.25); background: rgba(109,98,120,0.12);
  color: var(--cream); font-family: var(--font-body); font-weight: 300;
  font-size: 16px; letter-spacing: 0.12em; cursor: pointer;
  transition: all 0.3s ease;
}
#ready-begin:hover {
  background: rgba(109,98,120,0.25); border-color: var(--accent-mood);
  box-shadow: 0 0 20px -4px var(--accent-mood);
}
#ready-begin:active { transform: scale(0.97); }

/* ─── Technique Selector ──────────────────────────────────────────── */
#technique-selector {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  padding: 20px 20px 40px;
  background: linear-gradient(rgba(12,11,10,0.6), rgba(12,11,10,0.98) 20%);
  transform: translateY(100%); transition: transform 0.55s cubic-bezier(0.16,1,0.3,1);
  max-height: 80vh; overflow-y: auto;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
#technique-selector.visible { transform: translateY(0); }

#tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 520px; margin: 0 auto; }

.tech-card {
  position: relative; padding: 18px 16px; background: rgba(109,98,120,0.06);
  border: 1px solid rgba(176,168,191,0.1); border-radius: 14px;
  cursor: pointer; transition: all 0.25s ease; -webkit-tap-highlight-color: transparent;
}
.tech-card:hover { background: rgba(109,98,120,0.14); border-color: rgba(176,168,191,0.25); transform: translateY(-1px); }
.tech-card:active { transform: scale(0.98) translateY(0); transition-duration: 0.1s; }
.tech-card-tag { font-weight: 300; font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent-mood); opacity: 0.85; }
.tech-card-name { font-family: var(--font-display); font-style: italic; font-weight: 300; font-size: 22px; margin: 6px 0 5px; line-height: 1.15; }
.tech-card-desc { font-weight: 200; font-size: 12px; color: var(--plum-light); line-height: 1.6; opacity: 0.7; }
.tech-card-warn { position: absolute; top: 12px; right: 14px; font-size: 13px; opacity: 0.5; }

/* ─── Presession Frosted Card ─────────────────────────────────────── */
/* Bottom-sheet card: slides up after technique tap, holds summary +
   Begin CTA. Customize button expands the inline stepper. touch-action:
   pan-y lets the swipe-down handler work without page scroll. */
#presession-card {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  padding: 12px 24px 28px;
  background: rgba(255,255,255,0.045);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 48px rgba(0,0,0,0.35);
  transform: translateY(110%);
  transition: transform 300ms cubic-bezier(0.16,1,0.3,1);
  max-height: 42vh;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none; touch-action: pan-y;
}
#presession-card.visible { transform: translateY(0); pointer-events: auto; }
#presession-card.dragging { transition: none; }

.psc-handle {
  width: 40px; height: 4px;
  background: rgba(255,255,255,0.2); border-radius: 2px; margin-bottom: 4px;
}
.psc-mood { text-align: center; }
.psc-mood-name { font-family: var(--font-display); font-style: italic; font-weight: 300; font-size: 20px; color: var(--accent-mood); }
.psc-mood-sub { font-weight: 200; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--plum-light); opacity: 0.7; margin-top: 2px; }
.psc-tech { font-family: var(--font-display); font-weight: 300; font-size: 26px; line-height: 1.1; text-align: center; margin-top: 2px; }

/* Cycle counter floating at orb center. Position matches shader's orbShift
   exactly — landscape uses uv.y=0.18 shift → screen y=59%, portrait uses
   0.05 shift → 52.5%. Visible only while presession card is open. */
#orb-count {
  position: fixed; left: 50%; top: 59%;
  transform: translate(-50%, -50%) scale(0.96);
  z-index: 15; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  opacity: 0; transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16,1,0.3,1);
  text-align: center;
}
#orb-count.visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#orb-count #stp-value { font-family: var(--font-display); font-weight: 300; font-size: 72px; line-height: 1; color: var(--cream); text-shadow: 0 2px 24px rgba(0,0,0,0.4); }
#orb-count #stp-label { font-weight: 200; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--plum-light); opacity: 0.85; }
@media (max-width: 768px) { #orb-count #stp-value { font-size: 64px; } }

#stp-value { font-family: var(--font-display); font-weight: 300; font-size: 38px; min-width: 40px; text-align: center; }
#stp-label { font-weight: 200; font-size: 14px; color: var(--plum-light); opacity: 0.7; }

#psc-customize {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 300; font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--plum-light);
  opacity: 0.7; padding: 6px 12px; min-height: 32px;
  transition: opacity 0.2s ease;
}
#psc-customize:hover { opacity: 1; }

#psc-stepper {
  display: none; align-items: center; justify-content: center; gap: 20px;
  padding: 4px 0 2px;
}
#psc-stepper.expanded { display: flex; }
#psc-stepper button {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 50%;
  border: 1px solid rgba(176,168,191,0.1); background: rgba(109,98,120,0.06);
  color: var(--plum-light); font-size: 20px; cursor: pointer;
  transition: all 0.2s ease; display: flex; align-items: center; justify-content: center;
}
#psc-stepper button:hover { border-color: rgba(176,168,191,0.35); background: rgba(109,98,120,0.15); transform: scale(1.05); }
#psc-stepper button:active { transform: scale(0.95); transition-duration: 0.1s; }

#start-btn {
  padding: 14px 40px; border-radius: 9999px !important; width: auto !important; height: auto !important;
  border: 1px solid rgba(176,168,191,0.1) !important; background: rgba(109,98,120,0.12) !important;
  color: var(--cream) !important; font-family: var(--font-body) !important;
  font-weight: 300 !important; font-size: 15px !important; letter-spacing: 0.1em;
}
#start-btn:hover { background: rgba(109,98,120,0.25) !important; border-color: var(--accent-mood) !important; box-shadow: 0 0 16px -4px var(--accent-mood); }
#start-btn:active { transform: scale(0.97); transition-duration: 0.1s; }

/* ─── Back Button ─────────────────────────────────────────────────── */
#back-btn {
  position: fixed; top: 20px; left: 20px; z-index: 22;
  padding: 10px 20px; border-radius: 9999px;
  border: 1px solid rgba(176,168,191,0.1); background: rgba(12,11,10,0.4);
  color: var(--plum-light); font-family: var(--font-body); font-weight: 300;
  font-size: 14px; letter-spacing: 0.05em; cursor: pointer;
  opacity: 0; pointer-events: none; transition: all 0.4s ease;
  backdrop-filter: blur(8px);
}
#back-btn.visible { opacity: 1; pointer-events: auto; }
#back-btn:hover { border-color: rgba(176,168,191,0.3); color: var(--cream); background: rgba(109,98,120,0.15); }
#back-btn:active { transform: scale(0.96); transition-duration: 0.1s; }

/* ─── Session Controls ────────────────────────────────────────────── */
#session-controls {
  position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%);
  z-index: 20; display: flex; gap: 12px;
  opacity: 0; pointer-events: none; transition: opacity 0.6s ease;
}
#session-controls.visible { opacity: 1; pointer-events: auto; }
#session-controls.auto-hidden { opacity: 0.15; pointer-events: none; transition: opacity 1.5s ease; }

#session-controls button {
  padding: 12px 28px; background: rgba(12,11,10,0.4);
  border: 1px solid rgba(176,168,191,0.1); border-radius: 9999px;
  color: var(--plum-light); font-family: var(--font-body); font-weight: 300;
  font-size: 14px; letter-spacing: 0.1em; cursor: pointer; transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}
#session-controls button:hover { border-color: rgba(176,168,191,0.3); color: var(--cream); background: rgba(109,98,120,0.15); }
#session-controls button:active { transform: scale(0.96); transition-duration: 0.1s; }

/* ─── Session Summary (full overlay) ─────────────────────────────── */
#session-summary {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,11,10,0.75); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  opacity: 0; pointer-events: none; transition: opacity 1.2s ease;
}
#session-summary.visible { opacity: 1; pointer-events: auto; }

.summary-inner { max-width: 400px; text-align: center; padding: 40px 32px; }
.summary-text {
  font-family: var(--font-display); font-weight: 300; font-style: italic;
  font-size: 36px; color: var(--cream); margin-bottom: 14px; line-height: 1.2;
}
.summary-detail {
  font-weight: 200; font-size: 15px; color: var(--plum-light);
  letter-spacing: 0.04em; margin-bottom: 32px; line-height: 1.7; opacity: 0.8;
}

#summary-done {
  display: inline-block; padding: 14px 44px; border-radius: 28px;
  border: 1px solid rgba(176,168,191,0.25); background: rgba(109,98,120,0.1);
  color: var(--cream); font-family: var(--font-body); font-weight: 300;
  font-size: 15px; letter-spacing: 0.1em; cursor: pointer; transition: all 0.3s ease;
}
#summary-done:hover {
  border-color: var(--accent-mood); background: rgba(109,98,120,0.2);
  box-shadow: 0 0 20px -4px var(--accent-mood);
}
#summary-done:active { transform: scale(0.97); transition-duration: 0.1s; }


/* ─── Mute toggle (minimal, top-right — clears the chat bubble) ────── */
#mute-btn {
  position: fixed; top: 68px; right: 16px; z-index: 22;
  width: 44px; height: 44px; padding: 0;
  background: rgba(12,11,10,0.4); border: 1px solid rgba(176,168,191,0.12);
  border-radius: 50%; color: var(--stone); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.55; transition: opacity 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
#mute-btn:hover { opacity: 0.9; color: var(--plum-light); border-color: rgba(176,168,191,0.25); }
#mute-btn:active { transform: scale(0.92); }
#mute-btn .mute-icon-off { display: none; }
#mute-btn.muted .mute-icon-on { display: none; }
#mute-btn.muted .mute-icon-off { display: block; }
#mute-btn.muted { color: var(--plum-light); opacity: 0.7; }

/* ─── Settings ────────────────────────────────────────────────────── */
#settings-toggle {
  position: fixed; top: 20px; right: 20px; z-index: 25;
  width: 36px; height: 36px; background: transparent; border: none;
  color: var(--stone); font-size: 18px; cursor: pointer; opacity: 0.3; transition: opacity 0.3s;
}
#settings-toggle:hover { opacity: 0.7; }
#settings-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 280px; z-index: 24;
  background: rgba(12,11,10,0.95); border-left: 1px solid rgba(176,168,191,0.08);
  padding: 72px 24px 24px; transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
#settings-panel.visible { transform: translateX(0); }
#settings-panel h3 { font-weight: 300; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--stone); margin-bottom: 16px; }
#settings-panel p { font-size: 13px; color: var(--stone); line-height: 1.8; }

/* ─── Debug ───────────────────────────────────────────────────────── */
#debug-panel {
  position: fixed; top: 20px; left: 20px; z-index: 30; width: 260px;
  background: rgba(12,11,10,0.92); border: 1px solid rgba(176,168,191,0.1);
  border-radius: 12px; padding: 20px; opacity: 0; pointer-events: none;
  transition: all 0.3s ease; backdrop-filter: blur(12px);
}
#debug-panel.visible { opacity: 1; pointer-events: auto; }
#debug-panel h3 { font-weight: 300; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--stone); margin-bottom: 16px; }
#debug-panel label { display: flex; align-items: center; justify-content: space-between; font-weight: 200; font-size: 11px; color: var(--plum-light); margin-bottom: 10px; }
#debug-panel input[type="range"] { width: 140px; accent-color: var(--plum); height: 2px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(176,168,191,0.06); }
.presets button {
  padding: 5px 10px; background: rgba(109,98,120,0.1);
  border: 1px solid rgba(176,168,191,0.1); border-radius: 6px;
  color: var(--plum-light); font-family: var(--font-body); font-weight: 200;
  font-size: 10px; cursor: pointer; transition: all 0.2s ease;
}
.presets button:hover { background: rgba(109,98,120,0.2); border-color: rgba(176,168,191,0.2); }
#debug-hint { position: fixed; bottom: 12px; right: 16px; z-index: 5; font-weight: 200; font-size: 10px; color: rgba(122,115,104,0.2); letter-spacing: 0.05em; }

/* ─── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #identity { padding: 32px 16px 0; }
  #identity .name { font-size: 20px; }
  #idle-prompt { top: 64px; }
  #mood-selector { top: 84px; gap: 6px; grid-template-columns: repeat(3, 1fr); width: calc(100% - 16px); }
  .mood-card { padding: 10px 4px 8px; min-height: 48px; }
  .mood-name { font-size: 17px; }
  .mood-sub { font-size: 9px; }
  .mood-card.selected::after { margin-top: 4px; }
  #progress-ring { top: 52.5%; width: 82vmin; height: 82vmin; max-width: 400px; max-height: 400px; }
  #phase-label { top: 80%; font-size: 22px; max-width: calc(100vw - 40px); }
  #countdown { top: 52.5%; font-size: clamp(80px, 22vmin, 140px); }

  #debug-panel { width: 220px; left: 12px; top: 12px; }
  #tech-grid { grid-template-columns: 1fr; }
  .tech-card { padding: 16px 14px; min-height: 48px; }
  .tech-card-name { font-size: 20px; }
  .tech-card-desc { font-size: 12px; }
  #back-btn { padding: 10px 18px; font-size: 13px; min-height: 44px; }
  #session-controls button { padding: 14px 24px; font-size: 13px; min-height: 48px; }
  #start-btn { padding: 12px 32px !important; font-size: 14px !important; min-height: 48px !important; }
  #ready-begin { min-height: 48px; }
  #ready-panel { padding: 20px 16px 36px; }
}

@media (max-width: 375px) {
  #identity { padding: 28px 12px 0; }
  #identity .name { font-size: 18px; }
  #idle-prompt { top: 56px; font-size: 10px; }
  #mood-selector { top: 74px; grid-template-columns: repeat(3, 1fr); gap: 4px; width: calc(100% - 12px); }
  .mood-card { min-height: 44px; padding: 8px 3px 6px; }
  .mood-name { font-size: 15px; }
  .mood-sub { font-size: 8px; }
  #phase-label { top: 80%; font-size: 20px; }
  #countdown { top: 52.5%; font-size: clamp(72px, 22vmin, 128px); }
}
