/* Hide the Presents! — look C "Dollhouse": ink outlines, flat bright rooms, a snowy blue evening. No purple. */
:root { --ink: #17233f; --sky: #2f6fe0; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
	background: linear-gradient(var(--sky) 0 89%, #fff 89%);
	font-family: 'Fredoka', system-ui, sans-serif;
	color: var(--ink);
	-webkit-user-select: none; user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}
#stage { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
#dark { pointer-events: none; transition: opacity .9s; }
/* his speech bubble and the effects sit on top of the house: a finger must go straight through them */
#bubble, #fx { pointer-events: none; }
#sky { transition: fill .9s; }
#moon { transition: fill .9s; }

.t-night { font: 700 24px 'Fredoka', system-ui, sans-serif; fill: #fff; }
.t-hand { font: 400 26px 'Patrick Hand', 'Fredoka', system-ui, sans-serif; fill: var(--ink); }
.t-count { font: 600 18px 'Fredoka', system-ui, sans-serif; fill: #3d5a99; }
.t-bubble { font: 600 20px 'Fredoka', system-ui, sans-serif; fill: var(--ink); }
.t-pop { font: 700 30px 'Fredoka', system-ui, sans-serif; fill: #e23b3b; stroke: #fff; stroke-width: 6; paint-order: stroke; }

/* hiding spots */
.spot-ring { fill: none; stroke: var(--ink); stroke-width: 4; stroke-dasharray: 3 11; stroke-linecap: round; opacity: 0; transition: opacity .15s; pointer-events: none; }
.spot-hit { fill: transparent; pointer-events: none; }
.picking .spot:not(.full) .spot-ring { opacity: .85; animation: hp-ring 1.1s ease-in-out infinite alternate; }
.picking .spot:not(.full) .spot-hit { pointer-events: all; cursor: pointer; }
.spot.hot .spot-ring { opacity: 1; stroke-dasharray: none; stroke-width: 6; fill: rgba(255, 216, 74, .5); animation: none; }
.spot.target .spot-ring { opacity: 1; stroke: #ff7a1a; stroke-dasharray: none; stroke-width: 7; fill: rgba(255, 122, 26, .25); animation: hp-ring .45s ease-in-out infinite alternate; }
.spot .eyes { opacity: 0; pointer-events: none; transition: opacity .2s; }
.hiding .spot.mem .eyes { opacity: 1; }
@keyframes hp-ring { from { stroke-width: 4; } to { stroke-width: 8; } }

/* presents */
.item { cursor: grab; }
.item .in { transform-box: fill-box; transform-origin: 50% 60%; }
.item.sel .in, .item.hint .in { animation: hp-wiggle .5s ease-in-out infinite alternate; }
.item.lift { filter: url(#lift); }
.item.taken { pointer-events: none; }
.watching .item { cursor: pointer; }
@keyframes hp-wiggle { from { transform: rotate(-9deg) scale(1.08); } to { transform: rotate(9deg) scale(1.08); } }

/* the grump */
#grump { cursor: pointer; }
.watching #grump { pointer-events: none; }
.gbob { transform-box: fill-box; transform-origin: 50% 100%; }
.idle .gbob { animation: hp-idle 1.6s ease-in-out infinite alternate; }
.walking .gbob { animation: hp-bob .26s ease-in-out infinite alternate; }
.peek .gbob { animation: hp-peek .7s ease-in-out infinite alternate; }
.jump .gbob { animation: hp-jump .42s ease-out 3; }
.shake .gbob { animation: hp-shake .11s linear 10; }
.spin .gbob { animation: hp-spin .6s linear 2; transform-origin: 50% 50%; }
.cold .gbody { fill: #bfe3ff; }
.hot .gbody { fill: #ffb3a1; }
.gshock { display: none; }
.shock .gbrow, .shock .gfrown { display: none; }
.shock .gshock { display: inline; }
.gprop > * { animation: hp-drop .28s ease-in both; }
@keyframes hp-idle { from { transform: scaleY(1); } to { transform: scaleY(1.035); } }
@keyframes hp-bob { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-5px) rotate(3deg); } }
@keyframes hp-peek { from { transform: rotate(6deg); } to { transform: rotate(14deg); } }
@keyframes hp-jump { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-30px); } }
@keyframes hp-shake { 0%, 100% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }
@keyframes hp-spin { to { transform: rotate(360deg); } }
@keyframes hp-drop { from { transform: translateY(-70px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

#clock, #dog { transform-box: fill-box; transform-origin: 50% 100%; }
#clock.ring { animation: hp-shake .09s linear 14; }
#dog.up { animation: hp-jump .3s ease-out 3; }
.puff { animation: hp-puff .7s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes hp-puff { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.popword { animation: hp-popword 1.2s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes hp-popword { 0% { transform: scale(.4); opacity: 0; } 20% { transform: scale(1.15); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-26px); opacity: 0; } }
.conf { animation: hp-conf 2.2s linear forwards; transform-box: fill-box; }
@keyframes hp-conf { to { transform: translateY(760px) rotate(540deg); } }

/* the one instruction, always on screen */
#step {
	position: fixed; left: 76px; top: 12px; max-width: calc(100vw - 152px); min-height: 52px;
	display: flex; align-items: center; gap: 12px; padding: 6px 22px 6px 8px;
	background: #fff; border: 4px solid var(--ink); border-radius: 30px;
	font-size: clamp(16px, 2vw, 22px); font-weight: 600; line-height: 1.15;
}
#step.nudge { animation: hp-shake .1s linear 6; background: #fff3c4; }
#boo.nudge { animation: hp-shake .1s linear 6; }
/* the night: a bar that fills up to sunrise, hanging under the step line */
#sunbar { position: absolute; left: 26px; right: 26px; bottom: -17px; height: 14px; border: 3px solid var(--ink); border-radius: 9px; background: #17233f; }
#sunbar[hidden] { display: none; }
#sunfill { position: relative; display: block; height: 100%; width: 0; min-width: 4px; border-radius: 6px; background: #ffd84a; transition: width .15s linear; }
#sunfill::after { content: ''; position: absolute; right: -11px; top: -8px; width: 18px; height: 18px; border-radius: 50%; background: #ffd84a; border: 3px solid var(--ink); }
#stepNum { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #e23b3b; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }

#go, #boo {
	position: fixed; right: 20px; bottom: 16px; min-width: 190px; height: 64px; padding: 0 26px;
	border: 4px solid var(--ink); border-radius: 34px; box-shadow: 0 6px 0 var(--ink);
	font: 700 26px 'Fredoka', system-ui, sans-serif; color: var(--ink); background: #ffd84a; cursor: pointer;
	touch-action: manipulation;
}
#go.wait { opacity: .55; }
#go.ready { animation: hp-pulse .7s ease-in-out infinite alternate; }
#boo { background: #ff8a3d; }
#boo.off { opacity: .45; }
#boo.now { animation: hp-pulse .35s ease-in-out infinite alternate; }
#booLeft { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; margin-left: 6px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 20px; }
#go:active, #boo:active, #next:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
@keyframes hp-pulse { from { transform: scale(1); } to { transform: scale(1.07); } }
[hidden] { display: none !important; }

#turn { display: none; }

/* morning card */
#result { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .45); padding: 12px; }
#card { width: min(560px, 100%); max-height: 100%; overflow: auto; background: #fff; border: 5px solid var(--ink); border-radius: 30px; box-shadow: 0 8px 0 var(--ink); padding: 18px 24px 22px; text-align: center; }
#card h2 { margin: 0 0 4px; font-size: clamp(28px, 4vw, 40px); font-weight: 700; }
#card p { margin: 6px 0; }
#rLine { font-size: clamp(19px, 2.6vw, 26px); font-weight: 600; }
#rRow { display: flex; justify-content: center; gap: 10px; margin: 12px 0 8px; }
#rRow svg { width: 68px; height: 68px; overflow: visible; }
#rRow .gone { opacity: .22; }
#rTip { font: 400 22px 'Patrick Hand', 'Fredoka', system-ui, sans-serif; color: #24407d; }
#rTotal { font-size: 17px; font-weight: 500; color: #3d5a99; }
#next { margin-top: 10px; min-width: 220px; height: 60px; padding: 0 28px; border: 4px solid var(--ink); border-radius: 32px; box-shadow: 0 6px 0 var(--ink); font: 700 25px 'Fredoka', system-ui, sans-serif; color: var(--ink); background: #ffd84a; cursor: pointer; }

/* phones */
@media (max-height: 460px) {
	#step { min-height: 44px; padding: 4px 16px 4px 6px; border-width: 3px; font-size: 15px; top: 8px; }
	#stepNum { width: 28px; height: 28px; }
	#go, #boo { height: 50px; min-width: 150px; font-size: 21px; bottom: 10px; right: 12px; border-width: 3px; box-shadow: 0 4px 0 var(--ink); }
	#card { padding: 10px 18px 14px; border-radius: 22px; }
	#rRow { margin: 6px 0 4px; }
	#rRow svg { width: 46px; height: 46px; }
	#rTip { font-size: 18px; }
	#next { height: 50px; margin-top: 4px; }
}
@media (orientation: portrait) and (max-width: 600px) {
	#step { left: 12px; top: 72px; max-width: calc(100vw - 24px); }
	#turn { display: block; position: fixed; left: 0; right: 0; bottom: 96px; text-align: center; font: 400 20px 'Patrick Hand', 'Fredoka', system-ui, sans-serif; color: var(--ink); padding: 0 76px; }
	#go, #boo { right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.idle .gbob, .item.hint .in, #go.ready { animation: none; }
}
