:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --text: rgba(19, 43, 67, .9);
  --soft: rgba(255,255,255,.52);
  --soft-strong: rgba(255,255,255,.78);
  --panel: rgba(255,255,255,.40);
  --panel-border: rgba(255,255,255,.66);
  --bg-a: #d9f4ff;
  --bg-b: #d1dcff;
  --bg-c: #e0fbff;
  --bg-d: #f5f0ff;
  --bubble-accent: rgba(110, 203, 255, .45);
}

html[data-skin="ocean"] {
  --bg-a: #ddf7ff;
  --bg-b: #cfe2ff;
  --bg-c: #d8fbff;
  --bg-d: #edf5ff;
  --bubble-accent: rgba(114, 203, 255, .45);
}

html[data-skin="rose"] {
  --bg-a: #fce7ff;
  --bg-b: #d9d2ff;
  --bg-c: #dffff3;
  --bg-d: #ffe8f3;
  --bubble-accent: rgba(218, 137, 255, .38);
}

html[data-skin="mint"] {
  --bg-a: #ddfff5;
  --bg-b: #d2efff;
  --bg-c: #e2fff1;
  --bg-d: #eaf9ff;
  --bubble-accent: rgba(123, 233, 197, .40);
}

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

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  font-family: ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 30% 18%, rgba(255,255,255,.78) 0%, transparent 26%),
              radial-gradient(circle at 75% 25%, var(--bg-c) 0%, transparent 30%),
              linear-gradient(160deg, var(--bg-a) 0%, var(--bg-b) 45%, var(--bg-d) 100%);
}

#app {
  position: fixed;
  inset: 0;
  min-height: 100svh;
  overflow: hidden;
}

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

.panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(90vw, 430px);
  transform: translate(-50%, -50%);
  padding: 28px 20px 22px;
  border-radius: 30px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 70px rgba(60, 91, 140, .15);
  backdrop-filter: blur(18px);
}

.logoBubble {
  width: 86px;
  height: 86px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.95) 0 10%, transparent 11%),
              radial-gradient(circle at 35% 35%, rgba(255,255,255,.68), var(--bubble-accent) 42%, rgba(255,255,255,.55));
  box-shadow: inset -14px -18px 32px rgba(95, 143, 205, .14), 0 14px 35px rgba(72, 113, 168, .18);
  animation: floatLogo 5.5s ease-in-out infinite;
}

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

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 12vw, 4rem);
  letter-spacing: -0.06em;
}

p {
  margin: 12px auto 18px;
  font-size: 1.04rem;
  line-height: 1.42;
  max-width: 26ch;
}

small {
  display: block;
  margin-top: 14px;
  opacity: .68;
}

button {
  border: 0;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.choiceBlock {
  text-align: left;
  margin: 14px 0;
}

.choiceTitle {
  display: block;
  font-size: .84rem;
  font-weight: 750;
  opacity: .78;
  margin-bottom: 8px;
}

.choiceRow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.choiceBtn,
.primaryBtn,
.chipBtn {
  min-height: 46px;
  border-radius: 999px;
  background: var(--soft-strong);
  box-shadow: 0 8px 26px rgba(49, 84, 132, .10);
  border: 1px solid rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
}

.choiceBtn {
  padding: 0 14px;
  font-size: .95rem;
  font-weight: 700;
}

.choiceBtn.active {
  background: rgba(255,255,255,.95);
  box-shadow: 0 8px 26px rgba(49, 84, 132, .16), inset 0 0 0 1px rgba(120, 190, 255, .32);
}

.primaryBtn {
  width: 100%;
  padding: 15px 20px;
  font-weight: 800;
  font-size: 1.06rem;
  margin-top: 8px;
}

.hud {
  position: absolute;
  top: calc(var(--safe-top) + 12px);
  left: 12px;
  right: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255,255,255,.24);
  border: 1px solid rgba(255,255,255,.42);
  backdrop-filter: blur(16px);
}

.hudInfo {
  min-width: 110px;
}

.hud .label {
  display: block;
  font-size: .72rem;
  opacity: .72;
  line-height: 1.1;
}

.hud strong {
  display: block;
  font-size: 1.28rem;
}

.hudActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chipBtn {
  padding: 0 14px;
  font-weight: 780;
  font-size: .92rem;
}

.breathGuide {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 24px);
  transform: translateX(-50%);
  padding: 13px 20px;
  min-width: 150px;
  text-align: center;
  border-radius: 999px;
  background: rgba(255,255,255,.46);
  border: 1px solid rgba(255,255,255,.64);
  box-shadow: 0 14px 42px rgba(64, 92, 135, .14);
  backdrop-filter: blur(15px);
  font-weight: 800;
}

.breathGuide.breathePulse {
  animation: breathePulse 6s ease-in-out infinite;
}

@keyframes breathePulse {
  0%, 100% { transform: translateX(-50%) scale(.96); }
  45% { transform: translateX(-50%) scale(1.08); }
  70% { transform: translateX(-50%) scale(1.08); }
}

.calmPhrase {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.46);
  border: 1px solid rgba(255,255,255,.62);
  backdrop-filter: blur(12px);
  font-weight: 750;
  opacity: 0;
  animation: phrase 2.8s ease forwards;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes phrase {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(.96); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(.98); }
}

.hidden { display: none; }

@media (max-width: 520px) {
  .hud {
    flex-direction: column;
    align-items: stretch;
  }

  .hudActions {
    justify-content: flex-start;
  }

  .chipBtn {
    flex: 1 1 auto;
    min-height: 44px;
  }
}

@media (max-width: 380px) {
  .panel {
    padding: 24px 16px 18px;
  }

  .choiceBtn {
    flex: 1 1 calc(50% - 8px);
  }
}
