:root {
  --sky-1: #6fbaff;
  --sky-2: #a9dbff;
  --sky-3: #e4f4ff;
  --sky-4: #fff4d2;
  --yellow: #ffd43b;
  --yellow-deep: #f2b705;
  --denim: #2c5d9f;
  --denim-dark: #1b3d6e;
  --ink: #183461;
  --white: #ffffff;
  --shadow: rgba(18, 40, 80, .22);
  --vh: 1vh;
}

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 38%, var(--sky-3) 72%, var(--sky-4) 100%);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

img { -webkit-user-drag: none; user-select: none; pointer-events: none; }

/* ---------- gökyüzü ---------- */
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.sun {
  position: absolute;
  width: 60vmax; height: 60vmax;
  left: 50%; top: -34vmax;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 250, 220, .75) 0%, rgba(255, 245, 200, .25) 35%, transparent 65%);
}
.cloud {
  position: absolute;
  height: 9vmin;
  border-radius: 999px;
  background: #fff;
  opacity: .85;
  filter: blur(1px);
  animation: drift linear infinite;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.cloud::before { width: 55%; height: 170%; left: 12%; bottom: 20%; }
.cloud::after { width: 38%; height: 130%; right: 14%; bottom: 25%; }
.c1 { width: 26vmin; top: 9%; animation-duration: 95s; animation-delay: -20s; }
.c2 { width: 18vmin; top: 24%; opacity: .7; animation-duration: 120s; animation-delay: -70s; }
.c3 { width: 32vmin; top: 4%; opacity: .6; animation-duration: 140s; animation-delay: -110s; }
.c4 { width: 14vmin; top: 36%; opacity: .55; animation-duration: 105s; animation-delay: -40s; }
@keyframes drift {
  from { transform: translateX(-40vmin); left: 0; }
  to { transform: translateX(0); left: 110%; }
}

canvas#bg, canvas#fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
canvas#fx { z-index: 70; }

/* ---------- başlık ---------- */
.top {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 0; right: 0;
  text-align: center;
  z-index: 5;
  pointer-events: none;
}
.logo {
  margin: 0;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 700;
  font-size: min(15vw, 12vh, 120px);
  line-height: 1;
  letter-spacing: .01em;
  color: var(--yellow);
  display: inline-flex;
  align-items: center;
  text-shadow:
    0 .035em 0 var(--yellow-deep),
    0 .07em 0 var(--denim),
    0 .1em .12em rgba(20, 50, 100, .35);
  -webkit-text-stroke: .018em #fff6c9;
  paint-order: stroke fill;
}
.goggle {
  display: inline-block;
  width: .74em; height: .74em;
  margin: 0 .02em 0 .03em;
  border-radius: 50%;
  position: relative;
  top: .06em;
  background:
    radial-gradient(circle at 35% 30%, #ffffff 0%, #e9edf2 18%, #aab2bd 46%, #6f7985 70%, #cfd6de 86%, #8a929c 100%);
  box-shadow:
    0 .07em 0 var(--denim),
    0 .1em .12em rgba(20, 50, 100, .35),
    inset 0 -.03em .05em rgba(0, 0, 0, .35);
}
.goggle::before { /* kayış */
  content: "";
  position: absolute;
  left: -.12em; right: -.12em;
  top: 50%;
  height: .14em;
  transform: translateY(-50%);
  background: #2b2b2e;
  border-radius: .04em;
  z-index: -1;
}
.g-eye {
  position: absolute;
  inset: .11em;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #ffffff 0%, #f4f1ea 55%, #d9d4ca 100%);
  box-shadow: inset 0 .03em .05em rgba(0, 0, 0, .35);
}
.g-iris {
  position: absolute;
  width: 46%; height: 46%;
  left: 27%; top: 27%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 34%, rgba(255,255,255,.95) 0 9%, transparent 10%),
    radial-gradient(circle, #111 0 30%, #5a3418 34%, #8b5a2b 62%, #4a2a12 100%);
  will-change: transform;
}
.sub {
  margin: .5em auto 0;
  max-width: 92vw;
  font-weight: 800;
  font-size: clamp(14px, min(3.6vw, 2.6vh), 22px);
  color: var(--ink);
  opacity: .88;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}
.nowrap { white-space: nowrap; }

/* ---------- sahne ---------- */
#stage {
  position: absolute;
  inset: 0;
  z-index: 10;
  outline: none;
}
.minion {
  position: absolute;
  transform-origin: 50% 100%;
}
.minion:focus-visible { outline: none; }
.minion:focus-visible .body { filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 2px var(--denim)); }
.ground {
  position: absolute;
  left: 8%; right: 8%;
  bottom: -2.5%;
  height: 7%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(25, 45, 85, .32) 0%, rgba(25, 45, 85, .12) 45%, transparent 70%);
  transform-origin: 50% 50%;
}
.idle {
  position: absolute;
  inset: 0;
  transform-origin: 50% 100%;
  animation: breathe 3.6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  50% { transform: scale(1.008, 1.016) rotate(var(--sway, .5deg)); }
}
.body {
  position: absolute;
  inset: 0;
  transform-origin: 50% 100%;
  transition: filter .2s;
}
.minion.hover .body { filter: brightness(1.04) saturate(1.05); }
.base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.eye {
  position: absolute;
  overflow: hidden;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.iris {
  position: absolute;
  height: auto;
  will-change: transform;
}
.eshade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 130% 60% at 50% -12%, rgba(90, 70, 30, .22), transparent 70%),
    radial-gradient(ellipse 130% 50% at 50% 112%, rgba(90, 70, 30, .12), transparent 70%);
}
.lid {
  position: absolute;
  left: -4%; right: -4%;
  top: 0;
  height: 104%;
  transform: translateY(-104%);
  background: linear-gradient(180deg, #ffe46f 0%, #f9d24a 62%, #e6b42c 88%, #7a5a14 97%, #3d2c08 100%);
}
.minion.blink .lid { animation: blink .19s ease-in-out; }
@keyframes blink {
  0% { transform: translateY(-104%); }
  45%, 58% { transform: translateY(0); }
  100% { transform: translateY(-104%); }
}

/* carl'ın sireni */
.siren {
  position: absolute;
  width: 34%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(.6);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 60, 40, .95) 0%, rgba(255, 40, 30, .55) 25%, rgba(255, 0, 0, 0) 68%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}
.minion.alarm .siren { animation: siren .46s ease-in-out infinite; }
.minion.alarm .siren:nth-of-type(2n) { animation-delay: .23s; }
@keyframes siren {
  0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(.55); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}
.alarm-flash {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 70%, rgba(255, 40, 40, .0), rgba(255, 30, 30, .18));
  opacity: 0;
}
.alarm-flash.on { animation: flash .46s ease-in-out 4; }
@keyframes flash { 50% { opacity: 1; } }

/* ---------- konuşma balonu ---------- */
#bubbles { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.bubble {
  position: absolute;
  padding: .42em .8em .46em;
  background: #fff;
  color: var(--ink);
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: clamp(15px, min(3.8vw, 3vh), 26px);
  line-height: 1.1;
  border-radius: 1.1em;
  white-space: nowrap;
  box-shadow: 0 6px 18px var(--shadow), 0 0 0 2.5px var(--denim-dark);
  transform-origin: var(--tail-x, 50%) 120%;
  animation: pop .38s cubic-bezier(.2, 1.6, .4, 1) both;
}
.bubble::after {
  content: "";
  position: absolute;
  left: var(--tail-x, 50%);
  bottom: -9px;
  width: 16px; height: 16px;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 2.5px 2.5px 0 0 var(--denim-dark);
  border-radius: 0 0 4px 0;
}
.bubble.out { animation: bye .3s ease-in forwards; }
@keyframes pop {
  from { transform: scale(.3) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes bye { to { transform: scale(.85) translateY(-14px); opacity: 0; } }

/* ---------- arayüz ---------- */
.ui {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 50;
  pointer-events: none;
}
.ui > * { pointer-events: auto; }
.counter {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  padding: .38em .8em;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(20, 50, 100, .12), inset 0 0 0 1px rgba(255, 255, 255, .7);
  font-weight: 800;
  font-size: clamp(12px, 3.2vw, 15px);
  color: var(--denim-dark);
}
.counter b { font-family: "Fredoka", sans-serif; font-size: 1.12em; min-width: 1ch; text-align: center; }
.counter.bump .c-heart { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.5); } }
.c-heart { display: inline-block; }

.icon-btn {
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--denim-dark);
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(20, 50, 100, .12), inset 0 0 0 1px rgba(255, 255, 255, .7);
  cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn .ic-off { display: none; }
.icon-btn.muted .ic-on { display: none; }
.icon-btn.muted .ic-off { display: block; }

.bottom {
  position: absolute;
  left: 0; right: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  height: 40px;
  display: grid;
  place-items: center;
  z-index: 45;
  pointer-events: none;
}
.bottom > * { grid-area: 1 / 1; }
.hint {
  margin: 0;
  padding: .35em .9em;
  border-radius: 999px;
  font-weight: 800;
  font-size: clamp(12px, 3.3vw, 15px);
  color: #fff;
  background: rgba(27, 61, 110, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity .6s, transform .6s;
  animation: nudge 2.4s ease-in-out infinite;
}
.hint.gone { opacity: 0; transform: translateY(8px); animation: none; }
@keyframes nudge { 50% { transform: translateY(-3px); } }

.chorus {
  pointer-events: auto;
  border: 0;
  cursor: pointer;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: clamp(14px, 3.6vw, 17px);
  letter-spacing: .01em;
  color: var(--denim-dark);
  padding: .55em 1.2em .6em;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe066 0%, var(--yellow) 55%, #f5c518 100%);
  box-shadow: 0 3px 0 #c99a0a, 0 8px 18px rgba(20, 50, 100, .25), inset 0 1px 0 rgba(255, 255, 255, .7);
  transition: transform .12s, box-shadow .12s;
}
.chorus:active { transform: translateY(2px); box-shadow: 0 1px 0 #c99a0a, 0 4px 10px rgba(20, 50, 100, .25), inset 0 1px 0 rgba(255, 255, 255, .7); }
.bottom .chorus { opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .5s; pointer-events: none; }
.bottom .chorus.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- sürpriz kart ---------- */
.secret {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(ellipse at center, rgba(255, 220, 230, .35), rgba(20, 40, 80, .35));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadein .5s ease both;
}
.secret[hidden] { display: none; }
.card {
  position: relative;
  max-width: 360px;
  width: 100%;
  text-align: center;
  padding: 34px 26px 26px;
  border-radius: 28px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 24px 60px rgba(20, 40, 80, .35), inset 0 0 0 1px rgba(255, 255, 255, .9);
  animation: pop .6s cubic-bezier(.2, 1.5, .4, 1) both;
}
.card h2 {
  margin: 0 0 .25em;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 44px;
  color: var(--yellow);
  text-shadow: 0 3px 0 var(--denim), 0 6px 12px rgba(20, 50, 100, .3);
  -webkit-text-stroke: 1px #fff6c9;
  paint-order: stroke fill;
}
.card p { margin: 0 0 1.2em; font-size: 17px; line-height: 1.5; font-weight: 600; }
.card strong { font-weight: 800; color: #d6336c; }
.card-hearts {
  position: absolute;
  top: -26px; left: 50%;
  transform: translateX(-50%);
  font-size: 46px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .2));
  animation: beat 1.1s ease-in-out infinite;
}
@keyframes beat { 15% { transform: translateX(-50%) scale(1.18); } 30% { transform: translateX(-50%) scale(1); } 45% { transform: translateX(-50%) scale(1.12); } 60% { transform: translateX(-50%) scale(1); } }
@keyframes fadein { from { opacity: 0; } }

/* ---------- yükleniyor ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--sky-1), var(--sky-3));
  transition: opacity .6s ease, visibility .6s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-goggle {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, #3a2210 0 14%, #8b5a2b 15% 30%, #fff 31% 62%, #b8bec7 63% 78%, #7d8590 79% 100%);
  animation: look 1.2s ease-in-out infinite;
}
@keyframes look { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

@media (prefers-reduced-motion: reduce) {
  .cloud, .idle, .hint { animation: none !important; }
}
