:root {
  --text: #573357;
  --muted: rgba(87, 51, 87, 0.8);
  --glass: rgba(255, 255, 255, 0.44);
  --glass-2: rgba(255, 255, 255, 0.58);
  --stroke: rgba(255, 255, 255, 0.56);
}

* { box-sizing: border-box; }

html { touch-action: manipulation; }
body { touch-action: manipulation; }

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  padding: 18px 0 120px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 0%, rgba(255,255,255,0.28), transparent 27%),
    radial-gradient(circle at 92% 8%, rgba(255,214,235,0.24), transparent 28%),
    linear-gradient(180deg, #bfc2d0 0%, #c8c5d2 46%, #dac9d8 100%);
  transition: background 900ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(82, 86, 108, 0.2);
  transition: opacity 900ms ease;
}

body.sunny {
  background:
    radial-gradient(circle at 82% 9%, rgba(255, 229, 116, 0.86), transparent 20%),
    radial-gradient(circle at 16% 0%, rgba(255,255,255,0.44), transparent 27%),
    radial-gradient(circle at 88% 18%, rgba(255, 196, 224, 0.36), transparent 30%),
    linear-gradient(180deg, #fff2f7 0%, #ffdcea 52%, #f7efff 100%);
}

body.sunny::before {
  opacity: 0;
}

.page {
  position: relative;
  z-index: 5;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 0 14px 34px;
}

.hero,
.care,
.game-card,
.gallery-card {
  border: 1px solid var(--stroke);
  background: var(--glass);
  box-shadow: 0 18px 54px rgba(60, 54, 76, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hero {
  min-height: 662px;
  padding: 18px 18px 22px;
  border-radius: 32px;
}

.top-pill {
  width: max-content;
  max-width: 100%;
  margin: 0 auto 24px;
  padding: 9px 17px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.42);
  background: rgba(255, 255, 255, 0.36);
  color: rgba(87, 51, 87, 0.82);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transform: rotate(-2deg);
  transform-origin: center;
}

h1 {
  margin: 0 0 13px;
  font-size: clamp(26px, 7vw, 32px);
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 850;
  color: transparent;
  background: linear-gradient(90deg, #723768 0%, #c24db0 39%, #5362dd 70%, #b87658 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.lead {
  margin: 0 0 18px;
  color: rgba(87, 51, 87, 0.87);
  font-size: clamp(15px, 4vw, 18px);
  line-height: 1.5;
  letter-spacing: 0;
}

.pills {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.pill {
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255, 255, 255, 0.38);
  color: rgba(87, 51, 87, 0.88);
  font-size: clamp(13px, 3.4vw, 15px);
  line-height: 1.25;
  font-weight: 650;
}

/* SUN LEVEL */
.sun-level {
  margin: 0 0 18px;
  padding: 10px 14px 8px;
  border-radius: 18px;
  background: rgba(255,255,255,0.42);
  border: 1px solid rgba(255,255,255,0.55);
}

.sun-level-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(120, 100, 130, 0.18);
  overflow: hidden;
}

.sun-level-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg,
    #b6c4ff 0%,
    #ffb3cf 35%,
    #ff8fb1 65%,
    #ffd86a 100%);
  transition: width 700ms ease;
}

.sun-level-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(87, 51, 87, 0.78);
  letter-spacing: 0.2px;
}

.sun-level-meta span:last-child {
  color: #d44384;
}

.main-btn {
  appearance: none;
  width: 100%;
  height: 56px;
  margin: 0 0 12px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  font: inherit;
  font-size: clamp(17px, 4.6vw, 21px);
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 15px 30px rgba(163, 60, 112, 0.22);
  -webkit-tap-highlight-color: transparent;
}

.main-btn:active { transform: scale(0.98); }
.hug { background: linear-gradient(135deg, #df4e92, #d44384); }
.reason { background: linear-gradient(135deg, #ef8584, #d95187); }

.message {
  margin-top: 18px;
  padding: 18px 18px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.56);
  background: rgba(255, 255, 255, 0.58);
  color: #573357;
  text-align: center;
  font-size: clamp(15px, 4.2vw, 18px);
  line-height: 1.5;
  box-shadow: 0 14px 40px rgba(60, 54, 76, 0.13);
}

.message.flash,
.care-result.flash {
  animation: flash 360ms ease;
}

@keyframes flash {
  50% { transform: scale(1.025); }
}

.care {
  margin-top: 42px;
  padding: 30px 28px;
  border-radius: 30px;
}

.game-card {
  margin-top: 18px;
  padding: 22px 18px;
  border-radius: 30px;
}

.game-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.15;
}

.game-card p {
  margin: 0 0 12px;
  color: rgba(87, 51, 87, 0.74);
  font-size: 14px;
  line-height: 1.45;
}

.game-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.game-stats span {
  padding: 10px 5px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  color: rgba(87, 51, 87, 0.72);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.game-stats b {
  display: block;
  margin-top: 2px;
  color: #e64c91;
  font-size: 22px;
}

.game-area {
  position: relative;
  height: 265px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.56);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.44);
}

.game-banner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #e64c91;
  font-size: 22px;
  font-weight: 850;
}

.game-heart {
  position: absolute;
  border: 0;
  padding: 0;
  background: transparent;
  color: #e64c91;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  animation: gameFloat var(--dur) ease-in-out forwards;
  filter: drop-shadow(0 4px 8px rgba(161, 67, 116, 0.22));
  -webkit-tap-highlight-color: transparent;
}

.game-heart.caught {
  pointer-events: none;
  animation: caught 320ms ease forwards;
}

@keyframes gameFloat {
  0% { opacity: 0; transform: translate(0, 0) scale(0.78) rotate(-5deg); }
  12% { opacity: 1; transform: translate(calc(var(--dx) * 0.15), calc(var(--dy) * 0.15)) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.18) rotate(10deg); }
}

@keyframes caught {
  to { opacity: 0; transform: scale(2); }
}

.game-button {
  appearance: none;
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, #df4e92, #d44384);
  color: #fff;
  font: inherit;
  font-size: 22px;
  font-weight: 850;
  cursor: pointer;
}

.care h2 {
  margin: 0 0 6px;
  color: #573357;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 850;
}

.care p {
  margin: 0 0 14px;
  color: rgba(87, 51, 87, 0.82);
  font-size: 15px;
  line-height: 1.45;
}

.care-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.care-chip {
  appearance: none;
  min-height: 48px;
  border: 1px solid rgba(255,255,255,0.56);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.58);
  color: #d44384;
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(60, 54, 76, 0.1);
  -webkit-tap-highlight-color: transparent;
}

.care-chip:active {
  transform: scale(0.97);
}

.care-result {
  margin-top: 14px;
  padding: 16px 17px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  color: #573357;
  box-shadow: 0 10px 28px rgba(60, 54, 76, 0.12);
  animation: resultIn 220ms ease;
}

.care-result[hidden] {
  display: none;
}

.care-result-label {
  margin-bottom: 6px;
  color: #d44384;
  font-size: 13px;
  font-weight: 850;
  text-transform: lowercase;
}

.care-result-text {
  font-size: 18px;
  line-height: 1.45;
  font-weight: 650;
}

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

.weather-bottom {
  margin-top: 18px;
  text-align: center;
  color: #573357;
  font-size: 15px;
  font-weight: 850;
}

.gallery-card {
  margin-top: 18px;
  padding: 22px 0 18px;
  border-radius: 30px;
}

.gallery-card h2 {
  margin: 0 0 10px;
  padding: 0 18px;
  font-size: 20px;
  line-height: 1.15;
}

.gallery {
  overflow: hidden;
}

.gallery-viewport {
  display: flex;
  height: clamp(300px, 80vw, 460px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}

.gallery-viewport.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
}

.gallery-viewport::-webkit-scrollbar {
  display: none;
}

.gallery-slide {
  flex: 0 0 100%;
  max-width: 100%;
  margin: 0;
  scroll-snap-align: center;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 188px;
  border: 1px dashed rgba(255,255,255,0.68);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.42);
  color: rgba(87, 51, 87, 0.62);
  text-align: center;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.4;
}

.gallery-slide img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(60, 54, 76, 0.16);
  object-fit: contain;
  pointer-events: none;
}

.gallery-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.gallery-button {
  appearance: none;
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,0.56);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.62);
  color: #d44384;
  font: inherit;
  font-size: 19px;
  font-weight: 850;
  cursor: pointer;
}

.gallery-button:disabled {
  opacity: 0.45;
}

.gallery-count {
  min-width: 54px;
  text-align: center;
  color: rgba(87, 51, 87, 0.7);
  font-weight: 800;
}

.counter {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 90;
  transform: translateX(-50%);
  width: min(92vw, 340px);
  padding: 13px 18px;
  border: 1px solid rgba(255,255,255,0.64);
  border-radius: 999px;
  background: rgba(255, 247, 251, 0.94);
  color: #573357;
  text-align: center;
  font-size: 16px;
  font-weight: 850;
  box-shadow: 0 14px 40px rgba(60, 54, 76, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: none;
}

.counter.bump {
  animation: bump 220ms ease;
}

.counter b {
  margin-left: 12px;
  color: #e64c91;
  font-size: 22px;
}

@keyframes bump {
  50% { transform: translateX(-50%) scale(1.04); }
}

.rain,
.clouds,
.hearts,
.snow,
.sun,
.rainbow {
  position: fixed;
  pointer-events: none;
}

.rain,
.clouds,
.hearts,
.snow {
  inset: 0;
  overflow: hidden;
}

.rain {
  z-index: 30;
  opacity: 1;
  transition: opacity 900ms ease;
}

body.sunny .rain {
  opacity: 0;
}

.drop {
  position: absolute;
  top: -58px;
  width: 10px;
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(206,232,255,0.9) 42%, rgba(104,184,255,0.66));
  animation: rain linear infinite;
}

@keyframes rain {
  to { transform: translateY(112vh); }
}

.clouds {
  z-index: 40;
}

.sun {
  z-index: 4;
  top: 18px;
  right: 18px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8bd 0 28%, #ffd66c 58%, rgba(255, 214, 108, 0) 74%);
  box-shadow: 0 0 52px rgba(255, 214, 108, 0.72);
  opacity: 0;
  transform: scale(0.5) rotate(-12deg);
  transition: opacity 850ms ease 120ms, transform 850ms ease 120ms;
}

body.sunny .sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.rainbow {
  z-index: 3;
  top: 94px;
  right: -18px;
  width: 178px;
  height: 88px;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  background:
    radial-gradient(ellipse at 50% 100%,
      transparent 0 34%,
      rgba(154, 132, 255, 0.88) 35% 40%,
      rgba(92, 184, 255, 0.88) 41% 46%,
      rgba(120, 216, 145, 0.88) 47% 52%,
      rgba(255, 221, 106, 0.9) 53% 58%,
      rgba(255, 165, 91, 0.9) 59% 64%,
      rgba(255, 108, 145, 0.9) 65% 70%,
      transparent 71%);
  opacity: 0;
  transform: translateY(10px) scale(0.82);
  transition: opacity 900ms ease 220ms, transform 900ms ease 220ms;
}

body.sunny .rainbow {
  opacity: 0.78;
  transform: translateY(0) scale(1);
}

.cloud {
  position: absolute;
  --scale: 1;
  --drift-duration: 42s;
  --drift-delay: 0s;
  width: 240px;
  height: 84px;
  border-radius: 999px;
  background: rgba(255,255,255,0.78);
  box-shadow: 0 20px 56px rgba(88, 84, 108, 0.13);
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  left: 0;
  transform: translate3d(-340px, 0, 0) scale(var(--scale));
  animation: cloudDrift var(--drift-duration) linear infinite;
  animation-delay: var(--drift-delay);
  transition: opacity 400ms ease, filter 400ms ease;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  width: 92px;
  height: 92px;
  left: 38px;
  top: -43px;
}

.cloud::after {
  width: 128px;
  height: 128px;
  right: 30px;
  top: -70px;
}

.cloud.cleared {
  opacity: 0;
  animation-play-state: paused;
  filter: blur(7px);
}

.cloud-a { top: 126px; --scale: 1.08; --drift-duration: 42s; --drift-delay: -18s; }
.cloud-b { top: 238px; --scale: 1.06; --drift-duration: 50s; --drift-delay: -34s; }
.cloud-c { top: 382px; --scale: 0.88; --drift-duration: 46s; --drift-delay: -9s; }
.cloud-d { top: 526px; --scale: 0.9;  --drift-duration: 54s; --drift-delay: -28s; }

.cloud-x1 { top:  62px; --scale: 0.7;  --drift-duration: 70s; --drift-delay: -25s; }
.cloud-x2 { top: 192px; --scale: 0.78; --drift-duration: 64s; --drift-delay: -44s; }
.cloud-x3 { top: 320px; --scale: 0.92; --drift-duration: 78s; --drift-delay: -10s; }
.cloud-x4 { top: 460px; --scale: 0.74; --drift-duration: 60s; --drift-delay: -32s; }
.cloud-x5 { top: 600px; --scale: 0.86; --drift-duration: 72s; --drift-delay: -16s; }
.cloud-x6 { top: 720px; --scale: 0.7;  --drift-duration: 84s; --drift-delay: -48s; }

@keyframes cloudDrift {
  from { transform: translate3d(-340px, 0, 0) scale(var(--scale)); }
  to { transform: translate3d(calc(100vw + 340px), 0, 0) scale(var(--scale)); }
}

.hearts {
  z-index: 70;
}

.snow {
  z-index: 72;
}

.heart,
.snowflake,
.snow-puff {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

.heart {
  font-size: 28px;
  animation: heart 1500ms ease-out forwards;
}

@keyframes heart {
  0% { opacity: 0; transform: translate(0, 0) scale(0.45); }
  15% { opacity: 1; transform: translate(0, -8px) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), -160px) scale(1.25); }
}

.snowflake {
  top: -24px;
  color: #fff;
  font-size: 18px;
  text-shadow: 0 2px 8px rgba(112, 151, 190, 0.34);
  animation: snowFall linear forwards;
}

.snow-puff {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 18px rgba(255,255,255,0.74);
  animation: snowPuff 760ms ease-out forwards;
}

@keyframes snowFall {
  to { transform: translate(var(--drift), 112vh) rotate(300deg); opacity: 0; }
}

@keyframes snowPuff {
  to { transform: translate(var(--dx), var(--dy)) scale(1.8); opacity: 0; }
}

/* FOOTER + GRAVEYARD */
.site-footer {
  margin-top: 28px;
  margin-bottom: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.graveyard {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(255, 255, 255, 0.42);
  border-radius: 22px;
  padding: 14px 22px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font: inherit;
  color: #573357;
  box-shadow: 0 10px 28px rgba(60, 54, 76, 0.14);
  transition: transform 180ms ease, box-shadow 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.graveyard:hover { transform: translateY(-1px); }
.graveyard:active { transform: scale(0.98); }

.graveyard-stone {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(60, 54, 76, 0.18));
}

.graveyard-dates {
  font-size: 13px;
  font-weight: 800;
  color: #573357;
  letter-spacing: 0.4px;
  font-variant-numeric: tabular-nums;
}

.graveyard-cap {
  font-size: 11px;
  font-weight: 600;
  color: rgba(87, 51, 87, 0.62);
  letter-spacing: 0.2px;
}

.made-with-love {
  font-size: 12px;
  font-weight: 700;
  color: rgba(87, 51, 87, 0.7);
  letter-spacing: 0.3px;
}

/* APOLOGY MODAL */
.apology {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.apology[hidden] { display: none; }

.apology-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(46, 30, 60, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: apologyFade 240ms ease forwards;
}

.apology-card {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: 100%;
  padding: 28px 24px 22px;
  border-radius: 26px;
  background: linear-gradient(180deg, #fff5fa 0%, #ffe5ee 100%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 60px rgba(60, 54, 76, 0.32);
  text-align: center;
  color: #573357;
  animation: apologyPop 260ms cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
}

.apology-close {
  position: absolute;
  top: 8px;
  right: 12px;
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(87, 51, 87, 0.55);
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
  -webkit-tap-highlight-color: transparent;
}
.apology-close:hover { color: #573357; }

.apology-stone {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 3px 6px rgba(60, 54, 76, 0.22));
}

.apology-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 850;
  color: #d44384;
}

.apology-card p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.5;
  color: #573357;
}

.apology-dates {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(212, 67, 132, 0.2);
  font-size: 13px;
  font-weight: 800;
  color: #573357;
  letter-spacing: 0.4px;
  font-variant-numeric: tabular-nums;
}

@keyframes apologyFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes apologyPop {
  from { opacity: 0; transform: scale(0.85) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@media (min-width: 520px) {
  .page {
    width: min(100%, 560px);
  }
}

@media (max-width: 380px) {
  .page { padding-inline: 10px; }
  .hero { padding-inline: 18px; }
  h1 { font-size: 35px; }
  .lead { font-size: 20px; }
  .pill { font-size: 15px; }
  .main-btn { font-size: 24px; }
  .message { font-size: 22px; }
  .care-actions { grid-template-columns: 1fr; }
}
