/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at 50% 38%, #FFF5E6 0%, #FFF1DC 55%, #FFECD2 100%);
  color: #3D3D3D;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.8s ease, filter 0.8s ease;
}

button {
  font-family: inherit;
}

/* ===== App Container ===== */
#app {
  width: 100%;
  max-width: 480px;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ===== Screens ===== */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.screen.active {
  display: flex;
}

/* ===== Sound toggle ===== */
.sound-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 110;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(184, 224, 210, 0.9);
  background: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(61, 61, 61, 0.12);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-appearance: none;
  appearance: none;
}

.sound-toggle:active {
  transform: scale(0.88);
}

/* ===== Urge Select (first screen) ===== */
#urge-select {
  z-index: 3;
  position: relative;
}

/* Hero background germ canvas */
#germ-canvas-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Hero mascot */
.hero-mascot {
  width: min(104px, 24vw);
  height: auto;
  display: block;
  margin: 0 auto 6px;
  position: relative;
  z-index: 2;
  animation: mascot-bob 3.4s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(232,137,158,0.28));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.hero-mascot.squish {
  transform: scale(1.12, 0.9);
}

@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mascot { animation: none; }
}

/* iPhone SE fit: shrink mascot + wordmark */
@media (max-height: 700px) {
  .hero-mascot { width: min(88px, 22vw); }
}

.site-wordmark {
  width: min(300px, 82vw);
  height: auto;
  display: block;
  margin: 0 auto 4px;
  position: relative;
  z-index: 2;
  image-rendering: -webkit-optimize-contrast;
}

.urge-title {
  font-size: 36px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 8px;
  color: #3D3D3D;
  letter-spacing: -0.5px;
}

.urge-tagline {
  font-size: 16px;
  color: #8A7A66;
  font-style: italic;
  margin-bottom: 36px;
  position: relative;
  z-index: 2;
}

/* Landing footer */
.landing-footer {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #8A7A66;
  z-index: 2;
}
.landing-footer-link {
  color: #8A7A66;
  text-decoration: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.landing-footer-link:hover {
  text-decoration: underline;
}
.landing-footer-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}
.landing-footer-dot {
  opacity: 0.5;
}

.urge-cards {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
}

.urge-card {
  flex: 1 1 200px;
  min-width: 200px;
  max-width: 215px;
  background: #FFFFFF;
  border-radius: 24px;
  border: 2px solid;
  padding: 26px 18px 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 26px rgba(61, 61, 61, 0.10), 0 2px 6px rgba(61, 61, 61, 0.05);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
}

.urge-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(61, 61, 61, 0.16), 0 4px 10px rgba(61, 61, 61, 0.06);
}

.urge-card:active {
  transform: scale(0.96);
}

.urge-card.germs {
  border-color: #B8E0D2;
}

.urge-card.stuffy {
  border-color: #B8D4E8;
}

.urge-mini-bottle {
  width: 44px;
  height: 60px;
}

.urge-emoji {
  font-size: 52px;
  line-height: 1;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.urge-label {
  font-size: 20px;
  font-weight: 800;
  color: #3D3D3D;
}

.urge-sub {
  font-size: 13px;
  color: #8A7A66;
  font-style: italic;
  line-height: 1.45;
}

@media (max-width: 470px) {
  .urge-cards {
    flex-direction: column;
    align-items: center;
  }
  .urge-card {
    flex: none;
    width: 100%;
    max-width: 320px;
    min-width: 0;
  }
}

/* ===== Tunnel vignette (stuffy claustrophobia) ===== */
/* Register the tunnel radii so they can transition smoothly (graceful
   degradation: browsers without @property just step between values). */
@property --tunnel-rx {
  syntax: '<length-percentage>';
  inherits: false;
  initial-value: 3000px;
}

@property --tunnel-ry {
  syntax: '<length-percentage>';
  inherits: false;
  initial-value: 3000px;
}

#tunnel-vignette {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  --tunnel-rx: 200vw;
  --tunnel-ry: 200vh;
  background: radial-gradient(
    ellipse var(--tunnel-rx) var(--tunnel-ry) at center,
    transparent 0%,
    transparent 40%,
    rgba(15, 12, 28, 0.4) 70%,
    rgba(15, 12, 28, 0.92) 100%
  );
  transition: --tunnel-rx 0.8s ease, --tunnel-ry 0.8s ease, opacity 0.6s ease;
  opacity: 0;
}

/* Breathing pulse — like pressure in your skull */
body.stuffy-mode #tunnel-vignette {
  animation: stuffyPulse 3s ease-in-out infinite;
}

/* Edge blur ring — focus shrinks to a point, centre stays sharp */
#blur-ring {
  position: fixed;
  inset: 0;
  z-index: 98;
  pointer-events: none;
  opacity: 0;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  /* Mask: opaque at edges, transparent in centre */
  -webkit-mask-image: radial-gradient(ellipse 45% 45% at center, transparent 0%, transparent 50%, black 80%);
  mask-image: radial-gradient(ellipse 45% 45% at center, transparent 0%, transparent 50%, black 80%);
  transition: opacity 0.8s ease, backdrop-filter 0.8s ease;
}

/* White flash when the spray floods clarity back */
#clarity-flash {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  background: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ===== Nasty Bug DANGER alert (germ mode) ===== */
#danger-overlay {
  position: fixed; inset: 0; z-index: 500; pointer-events: none;
  background: rgba(180, 0, 0, 0);
  transition: background 0.1s;
}
#danger-overlay.active {
  animation: dangerFlash 0.15s ease-in-out 4;
}
@keyframes dangerFlash {
  0%, 100% { background: rgba(180, 0, 0, 0); }
  50% { background: rgba(180, 0, 0, 0.35); }
}
#danger-text {
  position: fixed; top: 20%; left: 50%; transform: translateX(-50%);
  z-index: 501; pointer-events: none; text-align: center;
  opacity: 0; transition: opacity 0.2s;
}
#danger-text.active { opacity: 1; animation: dangerShake 0.08s ease-in-out infinite; }
@keyframes dangerShake {
  0%, 100% { transform: translateX(-50%) translateX(0); }
  25% { transform: translateX(-50%) translateX(-3px); }
  75% { transform: translateX(-50%) translateX(3px); }
}
.danger-label {
  font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 36px;
  color: #FF0000; text-shadow: 0 0 20px rgba(255,0,0,0.8);
  letter-spacing: 4px;
}
.danger-name {
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 18px;
  color: #FFE0E0; margin-top: 4px;
  text-shadow: 0 1px 6px rgba(80, 0, 0, 0.8);
}
.danger-boss-label {
  font-size: 14px; color: #FFB0B0; letter-spacing: 2px; text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(80, 0, 0, 0.8);
}
.danger-delta {
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px;
  color: #FFC9C9; margin-top: 3px;
  text-shadow: 0 1px 6px rgba(80, 0, 0, 0.8);
}

/* ===== Nasty bug encounter log (complete screen) ===== */
#nasty-bug-log {
  display: none;
  width: 100%;
  background: #FFF6F4;
  border: 2px solid #F0B8B8;
  border-radius: 14px;
  padding: 10px 14px 8px;
  margin: 0 0 8px;
  text-align: left;
}
.nasty-log-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #B04040;
  margin-bottom: 6px;
}
.nasty-log-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  padding: 3px 0;
  border-top: 1px dashed rgba(176, 64, 64, 0.18);
}
.nasty-log-row:first-of-type {
  border-top: none;
}
.nasty-log-name {
  font-weight: 700;
  color: #3D3D3D;
}
.nasty-log-delta {
  font-weight: 800;
  color: #FF6B6B;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
}
.nasty-boss-badge {
  font-size: 10px;
  font-weight: 900;
  color: #FFF;
  background: #B00000;
  border-radius: 999px;
  padding: 2px 9px;
  letter-spacing: 1px;
  animation: bossBadgePulse 1.2s ease-in-out infinite;
}
@keyframes bossBadgePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(176, 0, 0, 0.4); }
  50% { transform: scale(1.07); box-shadow: 0 0 10px 2px rgba(176, 0, 0, 0.35); }
}

/* Subtle shake at peak stuffiness */
body.stuffy-mode #app.stuffy-shaking {
  animation: stuffyShake 0.4s ease-in-out infinite;
}

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

@keyframes stuffyShake {
  0%, 100% { transform: translateX(0) translateY(0); }
  20% { transform: translateX(-1px) translateY(0.5px); }
  40% { transform: translateX(1px) translateY(-0.5px); }
  60% { transform: translateX(-0.5px) translateY(1px); }
  80% { transform: translateX(0.5px) translateY(-0.5px); }
}

/* ===== Stuffy mode palette ===== */
body.stuffy-mode {
  background: #C8D8E8;
}

body.stuffy-mode.cleared {
  background: #E8F4FD;
}

#app.stuffy-mode {
  color: #3A4A5A;
}

#app.stuffy-mode #mode-select h1 {
  color: #3A4A5A;
}

#app.stuffy-mode #mode-select .subtitle {
  color: #64788C;
}

#app.stuffy-mode .mode-btn {
  border-color: #B8D4E8;
  background: #F7FBFE;
  color: #3A4A5A;
}

#app.stuffy-mode .mode-btn.primary {
  background: linear-gradient(135deg, #C8DFF0, #A8CCE4);
  border-color: #9CBFDA;
  color: #2A4A6A;
}

#app.stuffy-mode .mode-btn.share-btn {
  background: linear-gradient(135deg, #5A9BD4, #7FB6E8);
  border-color: transparent;
  color: #FFF;
  box-shadow: 0 8px 22px rgba(90, 155, 212, 0.35);
}

/* ===== Mode Select ===== */
#mode-select {
  z-index: 2;
}

#germ-canvas-idle {
  z-index: 0;
}

.mode-select-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.title-germ {
  font-size: 56px;
  margin-bottom: 8px;
  animation: floaty 3s ease-in-out infinite;
}

#mode-select h1 {
  font-size: 34px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 10px;
  color: #3D3D3D;
  letter-spacing: -0.5px;
}

#mode-select .subtitle {
  font-size: 16px;
  color: #8A7A66;
  margin-bottom: 40px;
  font-style: italic;
}

.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 280px;
}

.mode-btn {
  padding: 16px 28px;
  border: 2px solid #B8E0D2;
  border-radius: 999px;
  background: #FFFDF9;
  color: #3D3D3D;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(61, 61, 61, 0.08), 0 2px 4px rgba(61, 61, 61, 0.05);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.mode-btn:hover {
  box-shadow: 0 8px 22px rgba(61, 61, 61, 0.12), 0 2px 6px rgba(61, 61, 61, 0.06);
}

.mode-btn:active {
  transform: scale(0.95);
}

.mode-btn.primary {
  background: linear-gradient(135deg, #C4E7DA, #A8D5C4);
  border-color: #9CCBB8;
  color: #2A5A4A;
}

.mode-btn.primary:hover {
  animation: wobble 0.8s ease-in-out infinite;
}

/* ===== Share button (gradient, bouncy) ===== */
.mode-btn.share-btn {
  background: linear-gradient(135deg, #FF6B6B, #FF8FAB);
  border-color: transparent;
  color: #FFF;
  box-shadow: 0 8px 22px rgba(255, 107, 107, 0.35);
}

.mode-btn.share-btn:hover {
  box-shadow: 0 10px 26px rgba(255, 107, 107, 0.45);
}

.mode-btn.share-btn:active {
  transform: scale(0.9);
}

.share-alt {
  font-size: 12px;
  color: #A99;
  margin: -2px 0 2px;
}

/* ===== Story Screen ===== */
#story-screen {
  justify-content: flex-start;
  padding-top: 72px;
}

.scene-pill {
  position: absolute;
  top: 16px;
  left: 20px;
  z-index: 5;
  font-size: 12px;
  font-weight: 700;
  color: #8A7A66;
  background: rgba(255, 253, 249, 0.9);
  border: 1.5px solid #EBD9BE;
  border-radius: 999px;
  padding: 5px 12px;
  letter-spacing: 0.3px;
}

.scene-text {
  font-size: 21px;
  font-style: italic;
  font-weight: 600;
  line-height: 1.5;
  max-width: 340px;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 8;
}

.scene-text.visible {
  opacity: 1;
  transform: translateX(0);
}

.scene-btn {
  padding: 14px 30px;
  border: 2px solid #FF6B6B;
  border-radius: 999px;
  background: #FFFDF9;
  color: #FF6B6B;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(255, 107, 107, 0.18);
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.35s ease 0.08s, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.08s;
  -webkit-appearance: none;
  appearance: none;
  margin-bottom: 20px;
  position: relative;
  z-index: 8;
}

.scene-btn.visible {
  opacity: 1;
  transform: translateX(0);
}

.scene-btn:active {
  transform: scale(0.95);
}

.scene-btn.done {
  background: #B8E0D2;
  border-color: #9CCBB8;
  color: #2A5A4A;
  transform: scale(1.05);
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.12s;
}

/* ===== Germ Counter ===== */
.germ-counter {
  font-size: 48px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #FF6B6B;
  margin-bottom: 4px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  text-shadow: 0 0 20px rgba(255, 107, 107, 0);
  transition: text-shadow 0.6s ease;
  position: relative;
  z-index: 4;
}

.counter-label {
  font-size: 13px;
  font-weight: 700;
  color: #A9998A;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
  position: relative;
  z-index: 4;
}

/* ===== Canvas ===== */
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

/* Germs always above bottle */
#germ-canvas-quick { z-index: 2; }
#germ-canvas { z-index: 2; }
#sparkle-canvas { z-index: 5; }

/* ===== Squeeze Screen ===== */
#squeeze-screen {
  justify-content: center;
  padding-top: 0;
  z-index: 2;
}

#squeeze-screen .germ-counter {
  margin-top: 20px;
}

.bottle-container {
  margin-top: 16px;
  margin-bottom: 16px;
  z-index: 3;
  cursor: pointer;
  border-radius: 50%;
  animation: glowPulse 2.6s ease-in-out infinite;
}

.bottle-container:hover #bottle {
  animation: wobble 1s ease-in-out infinite;
}

#bottle {
  width: 230px;
  height: 322px;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(61, 61, 61, 0.12));
}

#pump-head {
  transition: transform 0.08s ease-out;
  cursor: pointer;
}

#pump-head.pressed {
  transform: translateY(8px);
}

.squeeze-hint {
  font-size: 15px;
  font-weight: 600;
  color: #A9998A;
  margin-bottom: 30px;
  font-style: italic;
  z-index: 3;
  animation: hintFadeIn 2.5s ease both;
}

/* ===== Bottle pulse for story scene 10 ===== */
.bottle-pulse {
  animation: heartbeat 1s ease-in-out infinite, glowPulse 1.8s ease-in-out infinite;
}

/* ===== Completion Screen ===== */
#complete-screen {
  background: radial-gradient(circle at 50% 38%, #FFF5E6 0%, #FFF1DC 55%, #FFECD2 100%);
  z-index: 10;
  overflow: hidden;
}

/* Embed CTA link on completion screens */
.embed-cta-link {
  font-size: 13px;
  font-weight: 700;
  color: #8A7A66;
  text-decoration: none;
  margin-top: 14px;
  text-align: center;
}
.embed-cta-link:hover {
  text-decoration: underline;
}

.confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 11;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiBurst 1s cubic-bezier(0.12, 0.8, 0.32, 1) forwards;
}

.complete-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 12;
  width: 100%;
  max-width: 320px;
}

.checkmark-svg {
  width: 72px;
  height: 72px;
  margin-bottom: 4px;
}

.check-circle {
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
}

.check-path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
}

.checkmark-svg.animate .check-circle {
  animation: drawStroke 0.55s ease-out forwards;
}

.checkmark-svg.animate .check-path {
  animation: drawStroke 0.35s ease-out 0.45s forwards;
}

.final-count {
  font-size: 52px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #4CAF50;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.final-label {
  font-size: 16px;
  font-weight: 700;
  color: #4CAF50;
}

.safe-text {
  font-size: 17px;
  font-style: italic;
  color: #3D3D3D;
  margin: 8px 0 12px;
}

/* ===== Share stat card ===== */
.share-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFDF9;
  border: 2px solid #F0C9A8;
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 6px 18px rgba(61, 61, 61, 0.08);
  margin-bottom: 16px;
  width: 100%;
  position: relative;
}

.share-card-icon {
  font-size: 34px;
}

.share-card-body {
  text-align: left;
  flex: 1;
}

.share-card-count {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #FF6B6B;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  line-height: 1.1;
}

.share-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #A9998A;
}

.share-card-site {
  position: absolute;
  bottom: 6px;
  right: 12px;
  font-size: 9px;
  font-weight: 700;
  color: #C9B9A5;
  letter-spacing: 0.3px;
}

.complete-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 280px;
}

#btn-again.spin,
#btn-again-stuffy.spin {
  animation: spinOnce 0.4s ease;
}

/* ===== Story scene 10 text ===== */
.urge-text {
  font-size: 22px;
  font-style: italic;
  font-weight: 600;
  color: #FF6B6B;
  margin-bottom: 16px;
  animation: fadeIn 1s ease;
}

/* ===== STUFFY MODE: story + spray screens ===== */
#stuffy-story-screen {
  justify-content: flex-start;
  padding-top: 72px;
}

#app.stuffy-mode .scene-pill {
  background: rgba(240, 247, 253, 0.92);
  border-color: #B8D4E8;
  color: #5A7690;
}

.stuffy-scene-btn {
  border-color: #5A88B0;
  color: #4A78A0;
  box-shadow: 0 5px 16px rgba(90, 136, 176, 0.2);
}

.stuffy-scene-btn.done {
  background: #B8D4E8;
  border-color: #9CBFDA;
  color: #2A4A6A;
}

.stuffy-counter {
  color: #E05A6A;
}

.stuffy-counter-label {
  color: #7A8EA2;
}

#stuffy-squeeze-screen {
  justify-content: center;
  padding-top: 0;
  z-index: 2;
}

#stuffy-squeeze-screen .germ-counter {
  margin-top: 12px;
}

.nose-container {
  position: relative;
  z-index: 3;
  margin-top: 4px;
}

#nose-svg {
  width: 120px;
  height: 112px;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(58, 74, 90, 0.15));
}

.nose-fill {
  transition: fill 0.6s ease;
}

.wisp {
  opacity: 0;
  animation: wispFloat 2.6s ease-in-out infinite;
}

.wisp-2 {
  animation-delay: 1.1s;
}

.spray-container {
  margin-top: 6px;
  margin-bottom: 10px;
}

#app.stuffy-mode .bottle-container {
  animation: glowPulseBlue 2.6s ease-in-out infinite;
}

#app.stuffy-mode .bottle-container.bottle-pulse {
  animation: heartbeat 1s ease-in-out infinite, glowPulseBlue 1.8s ease-in-out infinite;
}

.spray-container:hover #spray-bottle {
  animation: wobble 1s ease-in-out infinite;
}

#spray-bottle {
  width: 130px;
  height: 260px;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(58, 74, 90, 0.15));
}

#spray-pump {
  transition: transform 0.08s ease-out;
  cursor: pointer;
}

#spray-pump.pressed {
  transform: translateY(8px);
}

#app.stuffy-mode .squeeze-hint {
  color: #7A8EA2;
}

/* ===== Stuffy completion screen ===== */
#stuffy-complete-screen {
  background: radial-gradient(circle at 50% 38%, #F2FAFF 0%, #E8F4FD 55%, #DCEEFA 100%);
  z-index: 10;
  overflow: hidden;
}

.clear-sparkle {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 4px;
  animation: floaty 3s ease-in-out infinite;
}

.stuffy-final-count {
  color: #4A90C4;
}

.stuffy-final-label {
  color: #4A90C4;
}

.stuffy-share-card {
  background: #F7FBFE;
  border-color: #B8D4E8;
}

.stuffy-share-count {
  color: #5A88B0;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.reduced-notice {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #999;
  background: rgba(255,255,255,0.8);
  padding: 4px 10px;
  border-radius: 8px;
  z-index: 20;
}

/* ===== Keyframes ===== */
@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-3deg); }
  30% { transform: rotate(2deg); }
  45% { transform: rotate(-2deg); }
  60% { transform: rotate(1deg); }
  75% { transform: rotate(-1deg); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.04); }
  50% { transform: scale(1); }
  75% { transform: scale(1.03); }
}

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

@keyframes hintFadeIn {
  0% { opacity: 0; }
  40% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168, 213, 196, 0); }
  50% { box-shadow: 0 0 48px 14px rgba(168, 213, 196, 0.55); }
}

@keyframes glowPulseBlue {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168, 204, 228, 0); }
  50% { box-shadow: 0 0 48px 14px rgba(168, 204, 228, 0.6); }
}

@keyframes wispFloat {
  0% { opacity: 0; transform: translateY(6px); }
  30% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(-12px); }
}

@keyframes drawStroke {
  to { stroke-dashoffset: 0; }
}

@keyframes confettiBurst {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.6);
    opacity: 0;
  }
}

@keyframes spinOnce {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== Share Modal ===== */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-modal[hidden] {
  display: none;
}
.share-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(61, 61, 61, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.share-modal-card {
  position: relative;
  background: #FFFFFF;
  border-radius: 28px;
  border: 2px solid #B8E0D2;
  max-width: 340px;
  width: 92vw;
  padding: 28px 22px;
  text-align: center;
  animation: share-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes share-pop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .share-modal-card { animation: none; }
}
.share-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  font-size: 18px;
  color: #A9998A;
  cursor: pointer;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}
.share-modal-close:hover { color: #3D3D3D; }
.share-modal-mascot {
  width: 56px;
  height: 56px;
  display: block;
  margin: 0 auto 10px;
  animation: mascot-bob 3.4s ease-in-out infinite;
}
.share-modal-card h2 {
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #3D3D3D;
  margin-bottom: 10px;
}
.share-modal-preview {
  font-size: 13px;
  font-style: italic;
  color: #A9998A;
  margin-bottom: 18px;
  line-height: 1.45;
  word-break: break-word;
}
.share-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.share-tile {
  aspect-ratio: 1;
  border-radius: 18px;
  border: 2px solid var(--c);
  background: #fff;
  background: color-mix(in srgb, var(--c) 12%, white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
  padding: 8px;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-appearance: none;
  appearance: none;
}
.share-tile:hover {
  transform: translateY(-3px) scale(1.05);
}
.share-tile:active {
  transform: scale(0.92);
}
.tile-glyph {
  font-size: 24px;
  line-height: 1;
}
.share-tile span:last-child {
  font-size: 11px;
  font-weight: 700;
  color: #3D3D3D;
}

/* ===== Mobile adjustments ===== */
@media (max-width: 375px) {
  #mode-select h1 {
    font-size: 28px;
  }
  .urge-title {
    font-size: 30px;
  }
  .title-germ {
    font-size: 46px;
  }
  .scene-text {
    font-size: 18px;
  }
  .germ-counter, .final-count {
    font-size: 40px;
  }
  #bottle {
    width: 180px;
    height: 252px;
  }
  #spray-bottle {
    width: 105px;
    height: 210px;
  }
  #nose-svg {
    width: 100px;
    height: 93px;
  }
}

/* Short screens: shrink stuffy visuals so nose + bottle both fit */
@media (max-height: 640px) {
  #spray-bottle {
    width: 98px;
    height: 196px;
  }
  #nose-svg {
    width: 92px;
    height: 86px;
  }
  #stuffy-squeeze-screen .germ-counter {
    font-size: 38px;
    margin-top: 4px;
  }
}
