/* variables are shared with the reader, which is moved to <body> */
.dptf, .dptf-reader {
	--night: #1c2541;
	--night-deep: #121a30;
	--enamel: #fbf8f1;
	--coin: #d9b44a;
	--ink-light: #eeebf6;
	--muted: #a7aecb;
	--paper: #ffffff;
}
.dptf {
	box-sizing: border-box;
	background: var(--night);
	background-image:
		radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,.55), transparent 60%),
		radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,.45), transparent 60%),
		radial-gradient(1.5px 1.5px at 64% 40%, rgba(255,255,255,.35), transparent 60%),
		radial-gradient(1px 1px at 30% 72%, rgba(255,255,255,.35), transparent 60%),
		radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,.4), transparent 60%);
	color: var(--ink-light);
	font-family: "Alegreya Sans", "Gill Sans", "Trebuchet MS", sans-serif;
	font-size: 18px;
	line-height: 1.5;
	padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 48px) clamp(36px, 6vw, 72px);
	border-radius: 20px;
	max-width: 1180px;
	margin: 0 auto;
}
.dptf *, .dptf *::before, .dptf *::after { box-sizing: border-box; }
.dptf button, .dptf-reader button { font: inherit; color: inherit; }
.dptf-reader *, .dptf-reader *::before, .dptf-reader *::after { box-sizing: border-box; }
.dptf-reader :focus-visible { outline: 3px solid var(--coin); outline-offset: 3px; }
.dptf :focus-visible { outline: 3px solid var(--coin); outline-offset: 3px; }

.dptf-head { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.dptf-title {
	font-family: "Caveat", "Bradley Hand", cursive;
	font-weight: 700;
	font-size: clamp(44px, 7vw, 76px);
	line-height: 1;
	margin: 0 0 12px;
	color: var(--enamel);
	letter-spacing: 0;
}
.dptf-lede { margin: 0; color: var(--muted); }

/* child picker */
.dptf-kids { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 auto 8px; max-width: 900px; }
.dptf-kid {
	background: transparent;
	border: 2px solid transparent;
	border-radius: 16px;
	padding: 12px 8px 14px;
	cursor: pointer;
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	transition: border-color .2s, background-color .2s;
}
.dptf-kid:hover { background: rgba(255,255,255,.05); }
.dptf-kid[aria-pressed="true"] { border-color: var(--coin); background: rgba(217,180,74,.08); }
.dptf-kid-face {
	width: 96px; height: 96px; border-radius: 50%;
	background: var(--paper) center 20% / cover no-repeat;
	border: 3px solid var(--enamel);
}
.dptf-kid[aria-pressed="true"] .dptf-kid-face { border-color: var(--coin); }
.dptf-kid-name { font-family: "Caveat", cursive; font-weight: 700; font-size: 32px; line-height: 1; color: var(--enamel); }
.dptf-kid-fairy { font-size: 15px; color: var(--muted); line-height: 1.2; text-align: center; }

/* mouth */
.dptf-mouth-wrap { text-align: center; }
.dptf-mouth { max-width: 720px; margin: 0 auto; position: relative; }
.dptf-mouth svg { width: 100%; height: auto; display: block; overflow: visible; }
.dptf-count {
	font-family: "Caveat", cursive; font-weight: 700; fill: var(--enamel); font-size: 44px;
}
.dptf-count-sub { fill: var(--muted); font-size: 17px; font-family: "Alegreya Sans", sans-serif; }
.dptf-tooth { cursor: pointer; }
.dptf-tooth .shape { transition: transform .25s ease, fill .2s; transform-box: fill-box; transform-origin: center; }
.dptf-tooth.found .shape { fill: var(--enamel); stroke: #cfc8b6; stroke-width: 1.5; }
.dptf-tooth.missing { cursor: default; }
.dptf-tooth.missing .shape { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .6; }
.dptf-tooth.found:hover .shape, .dptf-tooth.found:focus-visible .shape { transform: scale(1.12); fill: #fff6d6; stroke: var(--coin); stroke-width: 2.5; }
.dptf-tooth:focus-visible { outline: none; }
.dptf-tooth .num { font-size: 13px; fill: #5a5446; font-family: "Alegreya Sans", sans-serif; font-weight: 700; pointer-events: none; }
.dptf-tooth.missing .num { fill: var(--muted); opacity: .6; }

.dptf-tip {
	position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 14px));
	background: var(--enamel); color: #2a2722; border-radius: 10px; padding: 8px 12px;
	font-size: 15px; line-height: 1.3; max-width: 240px; text-align: left;
	box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.dptf-tip b { display: block; font-family: "Caveat", cursive; font-size: 22px; line-height: 1.05; }
.dptf-tip[hidden] { display: none; }

.dptf-note { color: var(--muted); font-size: 15px; font-style: italic; max-width: 520px; margin: 8px auto 0; }
.dptf-extras { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.dptf-extra, .dptf-chest-item {
	display: flex; align-items: center; gap: 12px;
	background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
	border-radius: 12px; padding: 8px 16px 8px 8px; cursor: pointer; text-align: left;
	transition: border-color .2s;
}
.dptf-extra:hover, .dptf-chest-item:hover { border-color: var(--coin); }
.dptf-extra img, .dptf-chest-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #fff; }
.dptf-extra span small, .dptf-chest-item span small { display: block; color: var(--muted); font-size: 14px; }

.dptf-chest { margin-top: 56px; padding-top: 28px; border-top: 1px dashed rgba(255,255,255,.2); }
.dptf-section-title { font-family: "Caveat", "Bradley Hand", cursive; font-weight: 700; font-size: clamp(38px, 5vw, 52px); line-height: 1; color: var(--enamel); margin: 0 0 8px; text-align: center; }
.dptf-section-lede { color: var(--muted); text-align: center; max-width: 560px; margin: 0 auto 32px; }
.dptf-chest .dptf-section-title { margin-bottom: 20px; }

/* who's who */
.dptf-cast { margin-top: 64px; padding-top: 40px; border-top: 1px dashed rgba(255,255,255,.2); }
.dptf-cast-group + .dptf-cast-group { margin-top: 40px; }
.dptf-cast-group-title { font-family: "Caveat", cursive; font-weight: 700; font-size: 32px; line-height: 1.1; color: var(--coin); margin: 0 0 16px; }
.dptf-cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 24px 20px; }
.dptf-person { margin: 0; display: flex; flex-direction: column; }
.dptf-person-pic {
	background: var(--paper); border-radius: 4px; height: 230px; display: flex; align-items: center; justify-content: center;
	padding: 12px; box-shadow: 0 14px 30px rgba(0,0,0,.35); transform: rotate(var(--tilt, 0deg));
}
.dptf-person-pic img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.dptf-person h4 { font-family: "Caveat", cursive; font-weight: 700; font-size: 32px; line-height: 1; color: var(--enamel); margin: 18px 0 4px; }
.dptf-person-role { color: var(--coin); font-size: 15px; font-weight: 500; margin: 0 0 6px; }
.dptf-person p:last-child { color: var(--ink-light); font-size: 16px; line-height: 1.5; margin: 0; opacity: .88; }
.dptf-unseen { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 28px; }
.dptf-unseen p { margin: 0; color: var(--muted); font-size: 16px; }
.dptf-unseen b { color: var(--enamel); font-weight: 700; }

/* standalone pages (/tooth-fairy/ and coming soon) */
body.dptf-standalone { margin: 0; background: #1c2541; min-height: 100vh; }
body.dptf-standalone .dptf { border-radius: 0; max-width: none; min-height: 100vh; }
.dptf-page-shell { background: var(--night, #1c2541); }
.dptf-topbar { margin: 0; padding: calc(14px + env(safe-area-inset-top, 0px)) 24px 0; background: #1c2541; font-family: "Caveat", cursive; font-size: 26px; }
.dptf-topbar a { color: #a7aecb; text-decoration: none; }
.dptf-topbar a:hover { color: #d9b44a; }
.dptf-page-shell .dptf > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.dptf-cs-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.dptf-cs-site { font-family: "Caveat", cursive; font-size: 30px; color: var(--muted); margin: 0 0 18px; }
.dptf-cs-painting { display: block; margin: 0 auto 32px; max-width: min(380px, 82%); max-height: 48vh; width: auto; height: auto; border: 10px solid var(--enamel); border-radius: 3px; box-shadow: 0 22px 54px rgba(0,0,0,.5); }
.dptf-mouth-teaser .dptf-mouth { max-width: 560px; }
.dptf-cta {
	display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 28px; margin-top: 8px;
	border-radius: 999px; background: var(--coin); color: #1c2541; font-weight: 700; font-size: 18px; text-decoration: none;
	box-shadow: 0 10px 28px rgba(217,180,74,.25); transition: transform .2s, box-shadow .2s;
}
.dptf-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(217,180,74,.4); color: #1c2541; }
.dptf-cs-small { color: var(--muted); font-size: 15px; margin: 14px 0 0; }
.dptf-chest-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

/* reader */
.dptf-reader {
	position: fixed; inset: 0; z-index: 99999;
	background: var(--night-deep);
	display: grid; grid-template-rows: auto 1fr auto;
	padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
	color: var(--ink-light);
	font-family: "Alegreya Sans", "Gill Sans", sans-serif;
}
.dptf-reader[hidden] { display: none; }
.dptf-reader-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px clamp(16px, 3vw, 32px) 8px; }
.dptf-reader-kicker { margin: 0; color: var(--muted); font-size: 15px; }
.dptf-reader-title { margin: 0; font-family: "Caveat", cursive; font-weight: 700; font-size: clamp(28px, 4vw, 40px); line-height: 1.05; color: var(--enamel); }
.dptf-reader-meta { flex: 1 1 auto; min-width: 0; }
.dptf-tools { display: flex; gap: 8px; margin-left: auto; flex-wrap: nowrap; justify-content: flex-end; flex: none; }
.dptf-tool {
	display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
	background: transparent; border: 1.5px solid rgba(255,255,255,.35); border-radius: 999px;
	color: var(--ink-light); font-size: 16px; text-decoration: none; cursor: pointer;
}
.dptf-tool:hover { border-color: var(--coin); color: var(--ink-light); }
.dptf-tool[aria-pressed="true"] { background: var(--coin); border-color: var(--coin); color: #1c2541; }
.dptf-tool[hidden] { display: none; }
.dptf-tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dptf-magnifying img, .dptf-magnifying video { cursor: none; touch-action: none; }
.dptf-lens {
	position: absolute; width: 220px; height: 220px; border-radius: 50%; pointer-events: none; z-index: 3;
	background-color: #fff; background-repeat: no-repeat;
	border: 4px solid var(--enamel); box-shadow: 0 0 0 2px var(--coin), 0 16px 40px rgba(0,0,0,.55);
}
.dptf-lens[hidden] { display: none; }
.dptf-toast {
	position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 4;
	background: var(--enamel); color: #1c2541; border-radius: 999px; padding: 10px 20px; font-size: 16px; max-width: 90vw; text-align: center;
	box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.dptf-toast[hidden] { display: none; }
.dptf-close {
	flex: none; background: transparent; border: 1.5px solid rgba(255,255,255,.35); border-radius: 999px;
	padding: 8px 18px; min-height: 44px; cursor: pointer;
}
.dptf-close:hover { border-color: var(--coin); }
.dptf-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 8px clamp(56px, 7vw, 96px); }
.dptf-page { margin: 0; height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
.dptf-page { position: relative; }
.dptf-page img, .dptf-page video {
	max-width: 100%; max-height: 100%; object-fit: contain; background: var(--paper);
	border-radius: 4px; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 20px 60px rgba(0,0,0,.5);
	transition: opacity .25s ease, transform .35s ease;
}
.dptf-page video[hidden], .dptf-page img[hidden] { display: none; }
.dptf-page { overflow: hidden; }
.dptf-zoomer { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; transform-origin: 0 0; touch-action: none; }
.dptf-zoomed .dptf-zoomer { cursor: grab; }
.dptf-zoomed .dptf-zoomer:active { cursor: grabbing; }
.dptf-tool-icon { padding: 8px 12px; }
.dptf-tool[disabled] { opacity: .35; cursor: default; }
.dptf-read {
	position: absolute; top: 8px; right: clamp(56px, 7vw, 96px); bottom: 8px; width: min(440px, 46%); z-index: 4;
	display: flex; flex-direction: column; background: var(--paper, #fbf7ee); color: #1c2541; border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0,0,0,.55); overflow: hidden;
}
.dptf-read[hidden] { display: none; }
.dptf-read-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #1c2541; color: var(--enamel, #fff); font-size: 15px; }
.dptf-read-x { background: transparent; border: 0; color: inherit; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px; }
.dptf-read-text { flex: 1; overflow: auto; padding: 18px 22px; font-family: "Caveat", cursive; font-size: 25px; line-height: 1.3; white-space: pre-wrap; }
.dptf-read-note { margin: 0; padding: 8px 16px; font-size: 13px; color: #6b6458; border-top: 1px solid rgba(0,0,0,.08); }
.dptf-page img.turning, .dptf-page video.turning { opacity: 0; transform: translateX(var(--dir, 24px)); }
.dptf-nav {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.3);
	background: rgba(18,26,48,.7); cursor: pointer; display: grid; place-items: center;
}
.dptf-nav:hover { border-color: var(--coin); }
.dptf-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dptf-nav[disabled] { opacity: .25; cursor: default; }
.dptf-prev { left: clamp(4px, 2vw, 24px); }
.dptf-next { right: clamp(4px, 2vw, 24px); }
.dptf-strip { display: flex; gap: 8px; justify-content: center; padding: 10px 16px 16px; overflow-x: auto; }
.dptf-strip button { flex: none; padding: 0; border: 2px solid transparent; border-radius: 6px; background: #fff; cursor: pointer; width: 54px; height: 70px; }
.dptf-strip button img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; display: block; }
.dptf-strip button[aria-current="true"] { border-color: var(--coin); }
.dptf-strip:has(button:only-child) { visibility: hidden; }

@media (max-width: 640px) {
	.dptf-reader-bar { flex-wrap: wrap; }
	.dptf-tools { order: 3; width: 100%; justify-content: flex-start; flex-wrap: wrap; }
	.dptf-tool span { font-size: 15px; }
	.dptf-lens { width: 170px; height: 170px; }
	.dptf-read { left: 8px; right: 8px; width: auto; }
	.dptf-cast-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
	.dptf-person-pic { height: 150px; padding: 8px; }
	.dptf-person h4 { font-size: 26px; margin-top: 12px; }
	.dptf-person p:last-child { font-size: 15px; }
	.dptf-kids { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.dptf-kid-face { width: 72px; height: 72px; }
	.dptf-stage { padding: 4px 8px 56px; }
	.dptf-nav { top: auto; bottom: 0; transform: none; }
}
/* the one tooth that's ready on the coming soon page */
.dptf-tooth.glow .shape { fill: #fff6d6; stroke: var(--coin); stroke-width: 2.5; animation: dptf-glow 2.4s ease-in-out infinite; }
@keyframes dptf-glow {
	0%, 100% { filter: drop-shadow(0 0 2px rgba(217,180,74,.5)); }
	50% { filter: drop-shadow(0 0 14px rgba(217,180,74,.95)); }
}
@media (prefers-reduced-motion: reduce) {
	.dptf-tooth.glow .shape { animation: none; filter: drop-shadow(0 0 8px rgba(217,180,74,.8)); }
	.dptf *, .dptf-reader * { transition: none !important; }
}

/* Share GIF menu */
.dptf-share-wrap { position: relative; display: inline-flex; }
.dptf-menu {
	position: absolute; top: calc(100% + 8px); right: 0; z-index: 6; min-width: 200px; padding: 6px;
	background: #fff; color: #1c2541; border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.45);
	display: flex; flex-direction: column;
}
.dptf-menu[hidden] { display: none; }
.dptf-menu-item {
	display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; min-height: 44px;
	background: transparent; border: 0; border-radius: 8px; color: #1c2541 !important; font-size: 16px; text-align: left; cursor: pointer;
}
.dptf-menu-item:hover, .dptf-menu-item:focus-visible { background: #f3ecd9; }
.dptf-menu-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 640px) { .dptf-menu { left: 0; right: auto; } }
