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

:root {
  --paw-cursor: url("assets/cursors/click.png") 50 20, pointer;
  --grab-cursor: url("assets/cursors/grab.png") 29 28, grab;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1030;
  font-family: 'Nunito', sans-serif;
  touch-action: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ctext x='2' y='30' font-size='28'%3E%F0%9F%92%9C%3C/text%3E%3C/svg%3E") 6 26, auto;
}

#bg-gradient, #bg-gradient-2 {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 25%, #ff9ecb55, transparent 55%),
    radial-gradient(circle at 80% 20%, #7ee8ff44, transparent 55%),
    radial-gradient(circle at 50% 90%, #ffd97e55, transparent 60%),
    linear-gradient(135deg, #2a1854 0%, #431a5e 40%, #7a2d6b 75%, #b34a6b 100%);
  background-size: 200% 200%;
  animation: gradientShift 22s ease-in-out infinite;
  transition: opacity 3.5s ease;
}

#bg-gradient-2 {
  opacity: 0;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#ribbon-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.ribbon-word {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  will-change: transform, opacity;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
  user-select: none;
  transform-origin: center center;
}

#hamster-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.hamster {
  position: absolute;
  top: 0;
  left: 0;
  cursor: var(--grab-cursor);
  pointer-events: auto;
  will-change: transform;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.45));
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.hamster:active {
  cursor: url("assets/cursors/grab.png") 29 28, grabbing;
}

.hamster img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.hamster.squeak img {
  animation: squeak 0.35s ease;
}

@keyframes squeak {
  0%   { transform: scale(var(--s, 1)) rotate(var(--r, 0deg)); }
  35%  { transform: scale(calc(var(--s, 1) * 1.22)) rotate(calc(var(--r, 0deg) + 6deg)); }
  70%  { transform: scale(calc(var(--s, 1) * 0.92)) rotate(calc(var(--r, 0deg) - 4deg)); }
  100% { transform: scale(var(--s, 1)) rotate(var(--r, 0deg)); }
}

.bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  background: rgba(255,255,255,0.96);
  color: #442a5e;
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 14px;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  animation: bubbleIn 0.25s ease, bubbleOut 0.3s ease 1.6s forwards;
  pointer-events: none;
}

.bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(255,255,255,0.96);
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.7); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes bubbleOut {
  to { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.85); }
}

#particle-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  font-size: 18px;
  will-change: transform, opacity;
}

#card {
  position: fixed;
  z-index: 3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 440px);
  padding: 34px 28px 28px;
  border-radius: 28px;
  background: rgba(20, 10, 35, 0.42);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  text-align: center;
  color: #fff;
}

.found-counter {
  position: fixed;
  z-index: 6;
  bottom: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 10, 35, 0.42);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 10px 26px rgba(0,0,0,0.35);
  color: #fff;
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: 11.5px;
  white-space: nowrap;
  pointer-events: none;
}

.found-emoji { font-size: 14px; }

.found-counter.pop { animation: foundPop 0.4s ease; }

@keyframes foundPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.eyebrow {
  margin: 0 0 2px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 11px;
  opacity: 0.65;
  font-weight: 700;
}

.title {
  font-family: 'Pacifico', cursive;
  font-weight: 400;
  font-size: clamp(26px, 6vw, 36px);
  margin: 4px 0 22px;
  background: linear-gradient(90deg, #ffd97e, #ff9ecb, #7ee8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25));
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 10px 4px;
  min-width: 62px;
  flex: 1;
}

.num {
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 6vw, 30px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.label {
  margin-top: 6px;
  font-size: 10.5px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meeting-date {
  margin: 18px 0 4px;
  font-family: 'Caveat', cursive;
  font-size: 22px;
  font-weight: 700;
  opacity: 0.9;
}

.celebration {
  margin-top: 14px;
  font-family: 'Pacifico', cursive;
  font-size: 20px;
  color: #ffe08a;
}
.celebration.hidden { display: none; }
#countdown.hidden { display: none; }

.button-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.button-row .pill-btn { margin-top: 0; }

.pill-btn {
  margin-top: 20px;
  border: none;
  cursor: var(--paw-cursor);
  background: linear-gradient(90deg, #ff9ecb, #ffd97e);
  color: #3a1a3f;
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  transition: transform 0.15s ease;
}
.pill-btn:active { transform: scale(0.94); }
.pill-btn.full { display: block; width: 100%; margin-top: 14px; }

#settings-toggle {
  position: fixed;
  z-index: 10;
  bottom: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(20,10,35,0.55);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 20px;
  cursor: var(--paw-cursor);
}

.settings-panel {
  position: fixed;
  z-index: 10;
  bottom: 76px;
  right: 18px;
  width: min(84vw, 300px);
  background: rgba(20, 10, 35, 0.82);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 18px 18px 16px;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.settings-panel.hidden { display: none; }

.settings-panel h3 {
  margin: 0 0 12px;
  font-family: 'Comfortaa', sans-serif;
  font-size: 15px;
}

.settings-panel .row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  margin-bottom: 12px;
  opacity: 0.9;
}

.settings-panel .checkbox-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.settings-panel input[type="range"] {
  width: 100%;
  accent-color: #ff9ecb;
  cursor: var(--paw-cursor);
}

.settings-panel input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #ff9ecb;
  cursor: var(--paw-cursor);
}

.settings-panel select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  cursor: var(--paw-cursor);
}

.settings-panel select option {
  background: #2a1854;
  color: #fff;
}

.hint {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.6;
}

@media (max-width: 420px) {
  #card { padding: 26px 18px 22px; }
  .unit { min-width: 52px; padding: 8px 3px; }
}
