/* ============================================
   ECOS — CSS redesenhado | Mobile-first
   ============================================ */

:root {
  --ec-black:  #0d0d0d;
  --ec-cream:  #F8F6F2;
  --ec-gold:   #B89B5E;
  --ec-gray:   rgba(248,246,242,0.35);
  --font-s:    'Cormorant Garamond', Georgia, serif;
  --font-u:    'Jost', sans-serif;
  --tr:        0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Dinâmicas */
  --em-color:  #B89B5E;
  --em-glow:   rgba(184,155,94,0.4);
  --em-dark:   #0d0d0d;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-u);
  font-weight: 300;
  background: var(--ec-black);
  color: var(--ec-cream);
  -webkit-font-smoothing: antialiased;
  transition: background 1.2s ease;
}

/* ── CANVAS ── */
#ecosCanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* ── HEADER ── */
.ec-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(248,246,242,0.06);
}

.ec-back {
  display: flex; align-items: center;
  color: var(--ec-gray); text-decoration: none;
  width: 40px; height: 40px; justify-content: center;
  transition: color var(--tr);
}
.ec-back:hover { color: var(--ec-gold); }

.ec-logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-s);
  font-size: 1.4rem; font-weight: 300;
  letter-spacing: 0.15em; color: var(--ec-cream);
}
.ec-logo-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--em-color);
  box-shadow: 0 0 8px var(--em-glow);
  transition: background 1s ease, box-shadow 1s ease;
}

.ec-icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  color: var(--ec-gray); cursor: pointer;
  transition: color var(--tr);
  font-size: 1rem;
}
.ec-icon-btn:hover { color: var(--ec-gold); }

/* ── SCREENS ── */
.ec-screen {
  position: fixed; inset: 0;
  padding-top: 56px;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 10;
  transition: opacity 0.5s ease;
}
.ec-screen.active { display: flex; }
.ec-screen.fading { opacity: 0; pointer-events: none; }

/* ── SCREEN 1: BOAS-VINDAS ── */
.ec-welcome-content {
  display: flex; flex-direction: column;
  align-items: center; gap: 1rem;
  text-align: center; padding: 2rem;
  z-index: 1;
  animation: fadeUp 0.8s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ec-welcome-symbol {
  font-family: var(--font-s);
  font-size: 4rem; color: var(--ec-gold);
  animation: breathe-symbol 4s ease-in-out infinite;
  line-height: 1;
}
@keyframes breathe-symbol {
  0%,100% { transform: scale(1); opacity: 0.7; }
  50%      { transform: scale(1.12); opacity: 1; }
}

.ec-welcome-title {
  font-family: var(--font-s);
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 300; letter-spacing: 0.18em;
  color: var(--ec-cream); line-height: 1;
}

.ec-welcome-sub {
  font-family: var(--font-s);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-style: italic; color: rgba(248,246,242,0.6);
}

.ec-welcome-hint {
  font-size: 0.75rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(248,246,242,0.3);
}

.ec-start-btn {
  margin-top: 0.5rem;
  padding: 1rem 3rem;
  background: transparent;
  border: 1px solid var(--ec-gold);
  color: var(--ec-gold);
  font-family: var(--font-u);
  font-size: 0.82rem; letter-spacing: 0.18em;
  text-transform: uppercase; cursor: pointer;
  transition: all var(--tr);
}
.ec-start-btn:hover {
  background: var(--ec-gold); color: var(--ec-black);
}

.ec-sound-hint {
  font-size: 0.7rem; color: rgba(248,246,242,0.2);
}

/* ── SCREEN 2: EMOÇÕES ── */
#screenEmotions {
  padding: 56px 1rem 1rem;
  overflow-y: auto;
  justify-content: flex-start;
}

.ec-emotions-header {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
  flex-shrink: 0;
}
.ec-emotions-header h2 {
  font-family: var(--font-s);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 300; color: var(--ec-cream);
  margin-bottom: 0.35rem;
}
.ec-emotions-header p {
  font-size: 0.8rem; color: rgba(248,246,242,0.4);
  letter-spacing: 0.04em;
}

.ec-emotions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  width: 100%; max-width: 600px;
  padding: 0.5rem;
}

.ec-emotion-card {
  position: relative; overflow: hidden;
  border-radius: 12px;
  padding: 1.5rem 1rem;
  display: flex; flex-direction: column;
  align-items: center; gap: 0.6rem;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.ec-emotion-card:hover,
.ec-emotion-card:focus-visible {
  transform: scale(1.03);
  border-color: var(--e-color);
  box-shadow: 0 8px 32px var(--e-glow);
  outline: none;
}
.ec-emotion-card:active { transform: scale(0.97); }

.ec-emotion-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 30%, var(--e-color) 0%, transparent 70%);
  opacity: 0.07;
  transition: opacity 0.3s ease;
}
.ec-emotion-card:hover::before { opacity: 0.14; }

.ec-emotion-symbol {
  font-size: 2rem; line-height: 1;
  color: var(--e-color);
  filter: drop-shadow(0 0 8px var(--e-glow));
  z-index: 1; position: relative;
}
.ec-emotion-label {
  font-size: 0.88rem; font-weight: 400;
  color: rgba(248,246,242,0.85);
  letter-spacing: 0.06em;
  z-index: 1; position: relative;
}
.ec-emotion-sub {
  font-size: 0.68rem; color: rgba(248,246,242,0.35);
  line-height: 1.4;
  z-index: 1; position: relative;
}

/* ── SCREEN 3: EXPERIÊNCIA ── */
#screenExperience {
  justify-content: center;
}

.ec-experience-center {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.5rem; text-align: center;
  padding: 1rem 2rem 120px;
  z-index: 1; width: 100%;
}

/* Orbe emocional */
.ec-emotion-orb {
  position: relative;
  width: clamp(140px, 30vw, 220px);
  height: clamp(140px, 30vw, 220px);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

.orb-symbol {
  font-size: clamp(3rem, 7vw, 5rem);
  color: var(--em-color);
  filter: drop-shadow(0 0 20px var(--em-glow));
  z-index: 1; position: relative;
  animation: float-orb 5s ease-in-out infinite;
  transition: color 1s ease, filter 1s ease;
}
@keyframes float-orb {
  0%,100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-10px) scale(1.05); }
}

.orb-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid var(--em-color);
  opacity: 0.2;
  transition: border-color 1s ease;
  animation: pulse-ring 3s ease-out infinite;
}
.orb-ring-1 { width: 100%; height: 100%; animation-delay: 0s; }
.orb-ring-2 { width: 130%; height: 130%; animation-delay: 0.5s; }
.orb-ring-3 { width: 165%; height: 165%; animation-delay: 1s; }

@keyframes pulse-ring {
  0%   { transform: scale(0.9); opacity: 0.3; }
  50%  { transform: scale(1);   opacity: 0.12; }
  100% { transform: scale(1.1); opacity: 0; }
}

.ec-emotion-name {
  font-family: var(--font-s);
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 300; color: var(--em-color);
  text-shadow: 0 0 40px var(--em-glow);
  transition: color 1s ease, text-shadow 1s ease;
  letter-spacing: 0.05em;
}

.ec-emotion-desc {
  font-size: clamp(0.82rem, 2vw, 0.95rem);
  color: rgba(248,246,242,0.5);
  max-width: 320px; line-height: 1.75;
  font-style: italic; font-family: var(--font-s);
}

/* ── RESPIRAÇÃO OVERLAY ── */
.ec-breath-overlay {
  position: absolute;
  inset: 56px 0 80px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.5rem; z-index: 20;
  background: rgba(13,13,13,0.6);
  backdrop-filter: blur(8px);
}
.ec-breath-overlay[hidden] { display: none; }

.ec-breath-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 2px solid var(--em-color);
  box-shadow: 0 0 30px var(--em-glow), inset 0 0 30px rgba(0,0,0,0.5);
  transition: transform 4s ease-in-out, box-shadow 4s ease-in-out;
}
.ec-breath-circle.expand {
  transform: scale(2.2);
  box-shadow: 0 0 80px var(--em-glow), inset 0 0 30px rgba(0,0,0,0.3);
}

.ec-breath-label {
  font-family: var(--font-s);
  font-size: 1.4rem; font-style: italic;
  color: rgba(248,246,242,0.7);
  min-height: 2rem;
}
.ec-breath-count {
  font-family: var(--font-s);
  font-size: 3rem; font-weight: 300;
  color: var(--em-color);
  min-height: 3.5rem;
  transition: color 1s ease;
}

/* ── BARRA DE CONTROLOS ── */
.ec-controls-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  display: flex; align-items: center;
  justify-content: space-around;
  padding: 0 1.5rem;
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(248,246,242,0.07);
  z-index: 50;
}

.ec-control-group {
  display: flex; flex-direction: column;
  align-items: center; gap: 0.25rem;
  flex: 1;
}
.ec-control-label {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.65rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ec-gray);
}

.ec-slider {
  -webkit-appearance: none;
  width: 100%; height: 2px;
  background: rgba(255,255,255,0.1);
  outline: none; cursor: pointer;
}
.ec-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--em-color);
  box-shadow: 0 0 8px var(--em-glow);
  cursor: pointer; transition: transform 0.2s ease;
  transition: background 1s ease, box-shadow 1s ease;
}
.ec-slider:hover::-webkit-slider-thumb { transform: scale(1.3); }

.ec-control-btn {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%; color: var(--ec-gray);
  cursor: pointer; transition: all var(--tr);
  flex-shrink: 0;
}
.ec-control-btn:hover,
.ec-control-btn[aria-pressed="true"] {
  border-color: var(--em-color);
  color: var(--em-color);
  background: rgba(var(--em-color-rgb, 184,155,94), 0.1);
}
.ec-btn-change {
  border-color: rgba(248,246,242,0.2);
  color: rgba(248,246,242,0.6);
}
.ec-btn-change:hover {
  border-color: var(--ec-gold);
  color: var(--ec-gold);
}

/* ── DRAWER DE DEFINIÇÕES ── */
.ec-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200; backdrop-filter: blur(4px);
}
.ec-drawer-overlay[hidden] { display: none; }

.ec-settings-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-height: 75vh;
  z-index: 201;
  background: #161616;
  border-top: 1px solid rgba(184,155,94,0.15);
  border-radius: 16px 16px 0 0;
  overflow-y: auto;
  transform: translateY(0);
  animation: slideUp 0.35s ease;
}
.ec-settings-drawer[hidden] { display: none; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.ec-settings-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky; top: 0;
  background: #161616; z-index: 1;
}
.ec-settings-header h3 {
  font-family: var(--font-s);
  font-size: 1.3rem; font-weight: 300;
  color: var(--ec-cream);
}

.ec-settings-content {
  padding: 1.25rem 1.5rem 2rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}

.ec-setting-group {
  display: flex; flex-direction: column; gap: 0.6rem;
}
.ec-setting-label {
  font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ec-gold);
}

.ec-setting-options {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.ec-option-btn {
  padding: 0.45rem 0.9rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(248,246,242,0.5);
  font-family: var(--font-u); font-size: 0.72rem;
  letter-spacing: 0.08em; cursor: pointer;
  border-radius: 4px; transition: all var(--tr);
}
.ec-option-btn:hover { border-color: var(--ec-gold); color: var(--ec-cream); }
.ec-option-btn.active {
  background: rgba(184,155,94,0.15);
  border-color: var(--ec-gold); color: var(--ec-gold);
}

.ec-history { display: flex; flex-direction: column; gap: 0.35rem; }
.ec-history-empty {
  font-size: 0.75rem; color: rgba(248,246,242,0.25);
  font-style: italic; text-align: center; padding: 0.5rem;
}
.ec-history-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  font-size: 0.75rem; color: rgba(248,246,242,0.6);
}
.ec-history-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--e-color, var(--ec-gold));
  flex-shrink: 0;
}
.ec-history-time { margin-left: auto; font-size: 0.65rem; color: rgba(248,246,242,0.25); }

.ec-secondary-btn {
  padding: 0.65rem 1.25rem;
  background: transparent;
  border: 1px solid rgba(248,246,242,0.15);
  color: rgba(248,246,242,0.5);
  font-family: var(--font-u); font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; border-radius: 4px;
  transition: all var(--tr); width: 100%;
}
.ec-secondary-btn:hover { border-color: var(--ec-gold); color: var(--ec-gold); }

/* ── MODO GUIADO ── */
.ec-guided-overlay {
  position: fixed; inset: 0;
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,13,13,0.95);
  backdrop-filter: blur(20px);
  animation: fadeIn 0.5s ease;
}
.ec-guided-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.ec-guided-content {
  display: flex; flex-direction: column;
  align-items: center; gap: 1.5rem;
  text-align: center; padding: 2rem;
  max-width: 380px; width: 100%;
}

.ec-guided-orb {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, var(--em-color) 0%, transparent 70%);
  animation: guided-breathe 8s ease-in-out infinite;
  box-shadow: 0 0 60px var(--em-glow);
}
@keyframes guided-breathe {
  0%,100% { transform: scale(0.8); opacity: 0.6; }
  40%     { transform: scale(1.4); opacity: 1; }
  60%     { transform: scale(1.4); opacity: 1; }
}

.ec-guided-title {
  font-family: var(--font-s);
  font-size: 1.8rem; font-weight: 300;
  color: var(--ec-cream);
}
.ec-guided-sub {
  font-size: 0.9rem; color: rgba(248,246,242,0.5);
  line-height: 1.7;
}

.ec-guided-progress {
  width: 100%; height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px; overflow: hidden;
}
.ec-guided-bar {
  height: 100%;
  background: var(--em-color);
  width: 0%;
  transition: width 0.5s ease;
  border-radius: 2px;
}

/* ── DESKTOP ── */
@media (min-width: 768px) {
  .ec-emotions-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 800px;
    gap: 1rem;
  }

  .ec-emotion-card { padding: 2rem 1.25rem; }
  .ec-emotion-symbol { font-size: 2.5rem; }
  .ec-emotion-label { font-size: 0.95rem; }

  .ec-controls-bar {
    width: 500px; left: 50%;
    transform: translateX(-50%);
    border-radius: 40px 40px 0 0;
    border: 1px solid rgba(248,246,242,0.07);
  }

  .ec-settings-drawer {
    width: 420px; left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }
  .ec-settings-drawer[hidden] { display: none; }

  .ec-experience-center { padding-bottom: 100px; }

  .orb-symbol { font-size: 5rem; }
  .ec-emotion-orb {
    width: 220px; height: 220px;
  }
}

@media (min-width: 1200px) {
  .ec-emotions-grid {
    grid-template-columns: repeat(5, 1fr);
    max-width: 900px;
  }
}
