* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 30px 16px;
}

/* confetti canvas sits on top of everything */
#confettiCanvas {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  display: none;
  z-index: 999;
}

.container {
  max-width: 520px;
  margin: auto;
  background: white;
  border-radius: 24px;
  padding: 36px 28px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

h1 {
  font-size: 28px;
  margin-bottom: 6px;
  color: #333;
}

.subtitle {
  color: #888;
  font-size: 14px;
  margin-bottom: 24px;
}

/* === COLLAPSIBLE CONTROLS === */
#controls {
  transition: all 0.4s ease;
  overflow: hidden;
}

#controls.collapsed h1        { font-size: 17px; margin-bottom: 2px; }
#controls.collapsed .subtitle { display: none; }
#controls.collapsed .stats-bar {
  padding: 6px 14px;
  margin-bottom: 10px;
  font-size: 13px;
}
#controls.collapsed .stat      { font-size: 13px; }
#controls.collapsed .stat-icon { font-size: 14px; }
#controls.collapsed .stat-label{ font-size: 11px; }
#controls.collapsed .slider-wrap { margin-bottom: 4px; }
#controls.collapsed #timeLabel  { font-size: 18px; margin-bottom: 4px; }
#controls.collapsed #tierBadge  { font-size: 12px; padding: 4px 12px; margin-bottom: 10px; }
#controls.collapsed .vibe-filter{ gap: 5px; margin-bottom: 12px; }
#controls.collapsed .vibe-pill  { padding: 4px 10px; font-size: 11px; }

#startBtn.collapsed {
  padding: 8px 20px;
  font-size: 13px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(102,126,234,0.25);
}

/* === SLIDER WRAP + EMOJI FLOAT === */
.slider-wrap {
  position: relative;
  padding-top: 36px;
  margin-bottom: 6px;
}

#puppyFloat {
  position: absolute;
  top: 0;
  font-size: 28px;
  line-height: 1;
  transform: translateX(-50%);
  transition: left 0.12s ease-out;
  pointer-events: none;
  user-select: none;
}

/* === TRACK (removed — kept selector for safety) === */
.track { display: none; }

/* === SLIDER === */
input[type=range] {
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #667eea, #764ba2);
  outline: none;
  margin: 4px 0 18px;
  cursor: pointer;
  touch-action: manipulation;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: white;
  border: 3px solid #764ba2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  cursor: grab;
}

input[type=range]:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.15);
}

/* === LABELS === */
#timeLabel {
  font-size: 28px;
  font-weight: 700;
  color: #444;
  margin-bottom: 10px;
}

#tierBadge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 22px;
  transition: background 0.3s;
  letter-spacing: 0.3px;
}

/* === BUTTON === */
button {
  padding: 14px 32px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 28px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 6px 20px rgba(102,126,234,0.45);
  transition: transform 0.1s, box-shadow 0.1s;
  letter-spacing: 0.5px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(102,126,234,0.55);
  }
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(102,126,234,0.35);
}

/* === STATS BAR === */
.stats-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  background: #f8f9ff;
  border-radius: 14px;
  padding: 10px 20px;
  margin-bottom: 20px;
  border: 1px solid #e8eeff;
}

.stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  font-weight: 700;
  color: #444;
}

.stat-icon { font-size: 18px; }

.stat-label {
  font-size: 12px;
  font-weight: 400;
  color: #999;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: #dde;
}

/* === VIBE FILTER === */
.vibe-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.vibe-pill {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid #ddd;
  border-radius: 50px;
  background: white;
  color: #666;
  cursor: pointer;
  box-shadow: none;
  margin-bottom: 0;
  transition: all 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .vibe-pill:hover {
    border-color: #764ba2;
    color: #764ba2;
    transform: translateY(-1px);
  }
}

.vibe-pill.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-color: transparent;
  color: white;
  box-shadow: 0 3px 10px rgba(102,126,234,0.4);
}

/* === MISSIONS === */
.missions-header {
  font-size: 15px;
  color: #888;
  margin-bottom: 16px;
  font-style: italic;
}

.mission {
  position: relative;
  background: white;
  padding: 18px 18px 14px;
  margin: 14px 0;
  border-radius: 18px;
  border: none;
  box-shadow: 0 6px 24px rgba(102,126,234,0.13);
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  color: #222;
  animation: cardDrop 0.45s cubic-bezier(0.34,1.56,0.64,1) calc(var(--i) * 0.12s) both;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.3s, background 0.3s;
  cursor: default;
  overflow: hidden;
}

/* coloured top bar per vibe */
.mission::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 18px 18px 0 0;
}

.mission.vibe-silly::before      { background: linear-gradient(90deg, #ffd43b, #ff922b); }
.mission.vibe-productive::before { background: linear-gradient(90deg, #40c057, #12b886); }
.mission.vibe-social::before     { background: linear-gradient(90deg, #339af0, #667eea); }
.mission.vibe-wild::before       { background: linear-gradient(90deg, #cc5de8, #f06595); }

.mission:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 32px rgba(102,126,234,0.2);
}

.mission.done {
  opacity: 0.5;
  background: #f6fff8;
  transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.mission-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.mission-num {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1.2;
}

.mission-text {
  flex: 1;
  line-height: 1.5;
  font-size: 15px;
  font-weight: 600;
  color: #222;
}

.vibe-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.vibe-silly      { background: #fff3bf; color: #e67700; }
.vibe-productive { background: #d3f9d8; color: #2f9e44; }
.vibe-social     { background: #d0ebff; color: #1971c2; }
.vibe-wild       { background: #f3d9fa; color: #9c36b5; }

.did-it-btn {
  width: 100%;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  background: #f8f9ff;
  color: #40c057;
  border: 2px solid #d3f9d8;
  box-shadow: none;
  margin-bottom: 0;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.3px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.did-it-btn:hover:not(:disabled) {
  background: #d3f9d8;
  border-color: #40c057;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(64,192,87,0.2);
}

.did-it-btn:disabled {
  background: #d3f9d8;
  border-color: #40c057;
  opacity: 0.7;
  cursor: default;
  transform: none;
}

.mission-num {
  font-size: 26px;
  flex-shrink: 0;
}

@keyframes cardDrop {
  from { opacity: 0; transform: translateY(-20px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#retryBtn {
  margin-top: 18px;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 600;
  background: white;
  color: #764ba2;
  border: 2px solid #764ba2;
  border-radius: 50px;
  box-shadow: none;
  animation: popIn 0.3s ease 0.35s both;
  margin-bottom: 0;
}

#retryBtn:hover {
  background: #f3eeff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(118,75,162,0.2);
}

#retryBtn:active {
  transform: translateY(1px);
}

/* === SHARE === */
#shareSection {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #eee;
}

.share-label {
  font-size: 14px;
  color: #888;
  margin-bottom: 12px;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  transition: transform 0.1s, box-shadow 0.1s;
  margin-bottom: 0;
  letter-spacing: 0.3px;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

.share-btn:active {
  transform: translateY(1px);
}

.share-x        { background: #000;    color: white; }
.share-whatsapp { background: #25D366; color: white; }
.share-copy     { background: #f1f3ff; color: #764ba2; border: 2px solid #764ba2; }

/* === TOAST === */
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
