/* 21 days. Motion rules: only transform and opacity are animated; every curve is a spring-like bezier;
   reduced-motion users get the same screens without movement. */
@font-face { font-family: "Fredoka"; src: url(fredoka.woff2) format("woff2"); font-weight: 300 700; font-display: swap }
:root {
  --bg: #f4ecdd; --paper: #fffdf8; --ink: #45362d; --soft: #8d7c6d; --faint: #cbbda6;
  --green: #7a9f55; --green-d: #5d7f3f; --pink: #f9d5dc; --rose: #a4485e;
  --spring: cubic-bezier(.32, .72, 0, 1); --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --lift: 0 1px 1px rgba(92, 70, 40, .05), 0 14px 30px -12px rgba(92, 70, 40, .22);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent }
html { background: var(--bg) }
body { margin: 0; color: var(--ink); font-family: "Fredoka", ui-rounded, system-ui, sans-serif; font-weight: 400;
  background: radial-gradient(120% 55% at 50% -8%, #fcf5e8 0%, var(--bg) 62%) fixed; overscroll-behavior: none; -webkit-font-smoothing: antialiased }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .06; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") }
#app { max-width: 460px; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 18px calc(44px + env(safe-area-inset-bottom)); min-height: 100dvh }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none }

/* header */
.head { display: flex; align-items: center; gap: 16px; margin: 8px 2px 26px }
.mascot { width: 66px; flex: none; animation: bob 3.6s var(--spring) infinite alternate }
.mascot .eye { transform-box: fill-box; transform-origin: center; animation: blink 5.2s var(--spring) infinite }
@keyframes bob { to { transform: translateY(-5px) rotate(-2deg) } }
@keyframes blink { 0%, 91%, 100% { transform: scaleY(1) } 95% { transform: scaleY(.1) } }
.tag { display: inline-block; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--rose); background: var(--pink); border-radius: 999px; padding: 4px 12px }
.head h1 { margin: 5px 0 0; font-size: 52px; font-weight: 600; letter-spacing: -.03em; color: var(--green-d); line-height: .95 }

/* the front door: her birthday, typed into eight cells */
.gate { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 11vh; gap: 22px }
.gate > * { animation: rise .8s var(--spring) backwards } .gate > :nth-child(2) { animation-delay: 70ms } .gate > :nth-child(3) { animation-delay: 140ms }
.gate .mascot { width: 104px } .gate h1 { margin: 0; font-size: 33px; font-weight: 600; letter-spacing: -.02em; color: var(--green-d) }
.bday { position: relative; display: flex; align-items: center; gap: 5px; padding: 6px 0 }
.bday input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 18px; border: 0 }
.bday .d { width: 36px; height: 50px; border-radius: 13px; background: var(--paper); box-shadow: inset 0 0 0 2px #e7dcc9, var(--lift); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 600; transition: transform .35s var(--bounce), box-shadow .3s var(--spring) }
.bday .d:empty::before { content: attr(data-ph); color: var(--faint); font-weight: 400; font-size: 19px }
.bday .d.on { animation: tap .25s var(--bounce) }
.bday input:focus ~ .d.next { box-shadow: inset 0 0 0 2.5px var(--green), var(--lift); transform: translateY(-3px) }
.bday .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); margin: 0 3px }
.gate.no .bday { animation: shake .45s var(--spring) }
.gate.yes .d { background: #6aaa64; color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08); animation: hop .7s var(--bounce) backwards; animation-delay: calc(var(--i) * 70ms) }
.gate.yes .mascot { animation: cheer 1.2s var(--bounce) }
@keyframes cheer { 30% { transform: translateY(-34px) rotate(-10deg) scale(1.12) } 60% { transform: translateY(0) rotate(6deg) } 80% { transform: translateY(-12px) rotate(-3deg) } }
.gate .msg { margin: 0 }

/* the grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px }
.tile { aspect-ratio: 1; border-radius: 28px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform .45s var(--bounce) }
.grid.in .tile { animation: rise .8s var(--spring) backwards; animation-delay: calc(var(--i) * 28ms) }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.9) } }
button.tile:active { transform: scale(.93) }
.tile .num { font-size: 33px; font-weight: 600; line-height: 1; position: relative }
.tile .when { font-size: 12.5px; font-weight: 500; margin-top: 4px; letter-spacing: .02em; position: relative }
.tile.locked { color: var(--faint); background: rgba(120, 95, 60, .055); box-shadow: inset 0 2px 5px rgba(92, 70, 40, .10), inset 0 -1px 0 rgba(255, 255, 255, .7) }
.tile.fresh { color: #77777c; box-shadow: var(--lift) }
.tile.fresh .foil { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; background: linear-gradient(135deg, #cfd0d3, #f8f8f9 38%, #bfc0c4 64%, #eeeef0); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -2px 3px rgba(0, 0, 0, .06) }
.tile.fresh .foil::before { content: ""; position: absolute; inset: -30%; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .9) 50%, transparent 60%); transform: translateX(-75%); animation: sheen 3.4s var(--spring) infinite }
@keyframes sheen { 55%, 100% { transform: translateX(75%) } }
.tile.fresh::after { content: ""; position: absolute; inset: -4px; border-radius: 32px; border: 2px solid var(--green); opacity: 0; animation: ring 2.6s var(--spring) infinite }
@keyframes ring { 0% { opacity: .55; transform: scale(.96) } 70%, 100% { opacity: 0; transform: scale(1.12) } }
.tile.done { background: var(--paper); box-shadow: var(--lift), inset 0 1px 0 #fff }
.tile.done .icon { font-size: 40px; line-height: 1 }
.tile.done .badge { position: absolute; right: 9px; bottom: 9px; font-size: 12px; font-weight: 600; background: var(--pink); color: var(--rose); border-radius: 999px; padding: 1px 8px }
.tile.done.new .icon { animation: stamp .9s var(--bounce) .35s backwards }
@keyframes stamp { from { opacity: 0; transform: scale(2.2) rotate(-18deg) } }

/* a day */
.back { font-size: 16px; font-weight: 500; color: var(--soft); padding: 10px 14px 10px 0; transition: transform .3s var(--spring) }
.back:active { transform: translateX(-4px) }
.day h2 { margin: 10px 0 20px; font-size: 50px; font-weight: 600; letter-spacing: -.03em; color: var(--green-d); line-height: 1 }
.day > .tag, .day h2, #more > *, .keys, .msg { animation: rise .7s var(--spring) backwards }
.day h2 { animation-delay: 40ms }
.shell { padding: 7px; border-radius: 36px; background: rgba(255, 255, 255, .5); box-shadow: 0 0 0 1px rgba(92, 70, 40, .07), var(--lift); view-transition-name: card }
.ticket { position: relative; border-radius: 29px; background: var(--paper); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(92, 70, 40, .04); min-height: 250px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 34px 28px; overflow: hidden }
.say { font-size: 25px; font-weight: 500; line-height: 1.32; letter-spacing: -.01em }
.ticket.pop .say { animation: say .9s var(--spring) backwards }
@keyframes say { from { opacity: .2; transform: scale(.9) } }
.ticket canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; border-radius: inherit; transition: opacity .7s var(--spring), transform .7s var(--spring) }
.ticket canvas.gone { opacity: 0; transform: scale(1.07); pointer-events: none }
.ticket .sheen { position: absolute; inset: -30%; pointer-events: none; background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .75) 50%, transparent 58%); transform: translateX(-75%); animation: sheen 3s var(--spring) infinite; transition: opacity .3s var(--spring) }
.ticket.touched .sheen { opacity: 0 }
.fleck { position: fixed; width: 7px; height: 5px; border-radius: 2px; background: linear-gradient(135deg, #f5f5f6, #b9babd); pointer-events: none; animation: fleck .75s var(--spring) forwards }
@keyframes fleck { to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(.5) } }

/* buttons and results */
#more { margin-top: 20px }
.go { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 9px 9px 9px 28px; border-radius: 999px; background: var(--green); color: #fff; font-size: 20px; font-weight: 600; text-decoration: none; box-shadow: 0 14px 26px -12px rgba(93, 127, 63, .75), inset 0 1px 0 rgba(255, 255, 255, .28); transition: transform .4s var(--bounce) }
.go .arrow { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 21px; transition: transform .4s var(--bounce) }
.go:active { transform: scale(.97) } .go:active .arrow { transform: translateX(4px) scale(1.05) }
.after { text-align: center; font-size: 19px; font-weight: 500; line-height: 1.35; color: var(--rose); background: var(--pink); border-radius: 24px; padding: 16px 20px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6) }

/* wordle */
.board-shell { padding: 16px 10px; margin-top: 6px }
.board { display: grid; gap: 7px; justify-content: center; perspective: 600px }
.row { display: grid; grid-template-columns: repeat(5, minmax(0, 58px)); gap: 7px }
.row.shake { animation: shake .45s var(--spring) }
@keyframes shake { 20% { transform: translateX(-7px) } 40% { transform: translateX(6px) } 60% { transform: translateX(-4px) } 80% { transform: translateX(2px) } }
.cell { aspect-ratio: 1; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 600; background: var(--paper); box-shadow: inset 0 0 0 2px #e7dcc9; text-transform: uppercase; backface-visibility: hidden }
.cell.f { box-shadow: inset 0 0 0 2px #bcad96; animation: tap .22s var(--bounce) }
@keyframes tap { from { transform: scale(.86) } }
.cell.flip { animation: flip .5s var(--spring) }
@keyframes flip { 50% { transform: rotateX(90deg) } }
.cell.g, .cell.y, .cell.x { color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08) }
.cell.g, .key.g { background: #6aaa64; color: #fff } .cell.y, .key.y { background: #cdb44f; color: #fff } .cell.x, .key.x { background: #8c8f93; color: #fff }
.cell.win { animation: hop .7s var(--bounce) }
@keyframes hop { 35% { transform: translateY(-18px) } }
.msg { text-align: center; color: var(--soft); min-height: 24px; margin: 12px 0 10px; font-size: 16px; font-weight: 500 }
.keys { display: grid; gap: 8px; transition: opacity .4s var(--spring), transform .4s var(--spring) }
.keys.off { opacity: 0; transform: translateY(16px); pointer-events: none }
.krow { display: flex; gap: 5px; justify-content: center }
.key { flex: 1; max-width: 42px; height: 56px; border-radius: 11px; background: #e8decb; font-weight: 600; font-size: 18px; box-shadow: inset 0 -3px 0 rgba(92, 70, 40, .10); transition: transform .14s var(--spring), background-color .35s var(--spring), color .35s var(--spring) }
.key:active { transform: scale(.88) }
.key.wide { max-width: 64px; flex: 1.6; font-size: 14px }
#end { margin-top: 6px } #end > * { animation: rise .7s var(--spring) backwards }

.confetti { position: fixed; top: -44px; font-size: 26px; pointer-events: none; animation: fall cubic-bezier(.3, .2, .6, 1) forwards }
.confetti b { display: block; font-weight: 400; animation: sway 1.1s var(--spring) infinite alternate }
@keyframes fall { to { transform: translateY(112vh) } }
@keyframes sway { from { transform: translateX(-16px) rotate(-30deg) } to { transform: translateX(16px) rotate(30deg) } }
.err { text-align: center; color: var(--soft); margin-top: 90px; font-size: 18px }

/* moving between screens: the tapped tile grows into the card */
::view-transition-old(root) { animation: vt-out .26s var(--spring) both }
::view-transition-new(root) { animation: vt-in .55s var(--spring) both }
@keyframes vt-out { to { opacity: 0; transform: scale(.985) } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px) } }
::view-transition-group(card) { animation-duration: .6s; animation-timing-function: var(--spring) }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important }
}
