/* Minimal white/black base */
:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #444;
  --paper: #fffdf5;
  --paper-edge: #e7ddc7;
  --cookie1: #d19b59;
  --cookie2: #b57a36;
  --shadow: 0 12px 30px rgba(0,0,0,.12);
}

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  display: grid;
  place-items: center;
  padding: 24px;
}

.wrap {
  width: min(720px, 92vw);
  text-align: center;
}

h1 {
  margin: 14px 0 6px;
  font-size: clamp(22px, 4vw, 32px);
}

.hint { color: var(--muted); margin: 0 0 8px; }
.date { color: var(--muted); font-size: 14px; margin-bottom: 8px; }

/* Fortune cookie */
.cookie {
  width: 220px;
  height: 160px;
  margin: 8px auto 6px;
  position: relative;
  cursor: pointer;
  user-select: none;
  outline: none;
}

.cookie .half {
  position: absolute;
  top: 28px;
  width: 50%;
  height: 100px;
  background: radial-gradient(120px 80px at 50% 20%, var(--cookie1), var(--cookie2));
  border-radius: 120px 120px 40px 40px;
  box-shadow: inset 0 8px 12px rgba(0,0,0,.10), 0 8px 18px rgba(0,0,0,.10);
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
  transform-origin: bottom center;
}

.cookie .left  { left: 0;  transform: rotate(8deg); }
.cookie .right { right: 0; transform: rotate(-8deg); }

/* Paper slip */
.paper {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%) scaleY(0.1);
  transform-origin: center top;
  background: var(--paper);
  border: 2px solid var(--paper-edge);
  border-radius: 6px;
  padding: 10px 14px;
  min-width: 240px;
  max-width: 420px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform .5s ease, opacity .5s ease;
}

.paper span {
  display: inline-block;
  font-family: 'Great Vibes', Georgia, 'Times New Roman', serif;
  font-size: clamp(22px, 4.6vw, 34px);
  line-height: 1.2;
  letter-spacing: .3px;
}

/* Open state */
.cookie.open .left  { transform: rotate(-28deg) translateX(-22px) translateY(6px); }
.cookie.open .right { transform: rotate(28deg)  translateX( 22px) translateY(6px); }
.cookie.open .paper { transform: translate(-50%, -64%) scaleY(1); opacity: 1; }

/* Reset button */
.reset {
  margin-top: 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.reset:hover { border-color: #aaa; color: #111; }

/* Confetti (birthday only) */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -10px; width: 10px; height: 14px;
  background: #222; opacity: .95; border-radius: 2px;
  transform: translateY(0) rotate(0);
  animation: fall 1.9s linear forwards;
}
.confetti i:nth-child(3n) { background: #555; }
.confetti i:nth-child(4n) { background: #999; }
@keyframes fall { to { transform: translateY(110vh) rotate(420deg);} }

/* Accessibility focus ring */
.cookie:focus { outline: 2px dashed #888; outline-offset: 6px; }

@media (max-width: 420px) {
  .cookie { width: 190px; height: 140px; }
  .paper { min-width: 210px; }
}
