/* ==========================================================================
   Dear Darling Life: interactive tools
   Loaded only on /tools/ pages. Uses the theme tokens (--ddl-*) so the
   section follows any future change to the brand palette.
   ========================================================================== */
.dt-page {
	--dt-ink: var(--ddl-obsidian, #171315);
	--dt-wine: var(--ddl-wine, #35111D);
	--dt-burg: var(--ddl-burgundy, #541B2B);
	--dt-ivory: var(--ddl-ivory, #F7F1E9);
	--dt-ivory-deep: var(--ddl-ivory-deep, #EEE4D6);
	--dt-champ: var(--ddl-champagne, #C7A77A);
	--dt-rose: var(--ddl-rose, #B88791);
	--dt-mute: var(--ddl-muted-dark, #CFC3B8);
	--dt-line: rgba(199, 167, 122, 0.3);
	--dt-display: var(--ddl-font-display, Georgia, serif);
	--dt-body: var(--ddl-font-body, system-ui, sans-serif);
	--dt-ease: var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

.dt-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Page shell ---------- */
.dt-hero {
	padding: clamp(1.5rem, 1rem + 3vw, 3.5rem) 0 clamp(1rem, 0.8rem + 1.5vw, 2rem);
}
.dt-hero .ddl-wrap { max-width: 64rem; }
.dt-hero h1 {
	font-size: var(--fs-2xl, clamp(2rem, 1.4rem + 2.8vw, 3.6rem));
	margin: 0.5rem 0 0.75rem;
}
.dt-hero__dek {
	max-width: 40rem;
	color: var(--ddl-muted, #5C4F53);
	font-size: var(--fs-md, 1.125rem);
	margin: 0;
}
.dt-crumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin: 0 0 1rem; padding: 0; list-style: none; font-size: var(--fs-sm, 0.875rem); color: var(--ddl-muted, #5C4F53); }
.dt-crumbs li + li::before { content: "/"; margin-right: 0.5rem; opacity: 0.5; }
.dt-crumbs a { text-decoration: none; }
.dt-crumbs a:hover { text-decoration: underline; }

.dt-play { padding: 0 0 clamp(2rem, 1rem + 4vw, 4rem); }
.dt-play .ddl-wrap { max-width: 64rem; }

/* ---------- Stage ---------- */
.dt-stage {
	position: relative;
	overflow: hidden;
	color: var(--dt-ivory);
	background:
		radial-gradient(120% 90% at 0% 0%, rgba(84, 27, 43, 0.95), transparent 62%),
		radial-gradient(90% 80% at 100% 100%, rgba(184, 135, 145, 0.2), transparent 58%),
		linear-gradient(160deg, #26131a, #171315 72%);
	border: 1px solid var(--dt-line);
	border-radius: var(--r-md, 8px);
	box-shadow: var(--sh-lift, 0 36px 70px -30px rgba(23, 19, 21, 0.6));
	padding: clamp(1rem, 0.6rem + 2.2vw, 2.25rem);
}
.dt-stage__mount { min-height: var(--dt-min, 32rem); }
.dt-skeleton { display: grid; gap: 0.75rem; }
.dt-skeleton i { display: block; height: 2.75rem; border-radius: 6px; background: rgba(247, 241, 233, 0.07); }
.dt-skeleton i:nth-child(2) { height: 7rem; }
.dt-skeleton i:nth-child(3) { height: 14rem; }
.dt-noscript { color: var(--dt-mute); margin: 0; }

.dt-label {
	display: block;
	margin: 0 0 0.5rem;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--dt-champ);
}
.dt-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end; margin-bottom: 1.25rem; }
.dt-field { min-width: 0; }
.dt-spacer { flex: 1; }

/* ---------- Chips (toggle groups) ---------- */
.dt-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.dt-chip {
	appearance: none;
	min-height: 2.75rem;
	padding: 0.35rem 1rem;
	border: 1px solid var(--dt-line);
	border-radius: var(--r-pill, 999px);
	background: transparent;
	color: var(--dt-ivory);
	font: 600 0.875rem/1 var(--dt-body);
	letter-spacing: 0.02em;
	transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--dt-ease);
}
.dt-chip:hover { border-color: var(--dt-champ); }
.dt-chip:active { transform: scale(0.97); }
.dt-chip.is-on { background: var(--dt-champ); border-color: var(--dt-champ); color: var(--dt-ink); }

/* ---------- Buttons ---------- */
.dt-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 2.9rem;
	padding: 0.5rem 1.25rem;
	border: 1px solid var(--dt-champ);
	border-radius: var(--r-pill, 999px);
	background: var(--dt-champ);
	color: var(--dt-ink);
	font: 700 0.9rem/1 var(--dt-body);
	letter-spacing: 0.03em;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.25s var(--dt-ease), background-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.dt-btn:hover { background: #d8bd93; box-shadow: 0 10px 24px -12px rgba(199, 167, 122, 0.8); }
.dt-btn:active { transform: translateY(1px) scale(0.985); }
.dt-btn:disabled, .dt-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.dt-btn--ghost { background: transparent; color: var(--dt-ivory); border-color: var(--dt-line); }
.dt-btn--ghost:hover { background: rgba(247, 241, 233, 0.08); border-color: var(--dt-champ); box-shadow: none; }
.dt-btn--lg { min-height: 3.4rem; padding: 0.7rem 2rem; font-size: 1rem; }
.dt-btn--sm { min-height: 2.75rem; padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.dt-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.dt-stage :focus-visible { outline: 2px solid var(--dt-champ); outline-offset: 3px; }
.dt-stage .dt-btn:not(.dt-btn--ghost):focus-visible { outline-color: var(--dt-ivory); }

/* ---------- Result / reveal card ---------- */
.dt-reveal {
	position: relative;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.5rem 1.25rem;
	align-items: center;
	min-height: 9.5rem;
	padding: 1.25rem 1.5rem;
	margin-bottom: 1.25rem;
	border-radius: var(--r-md, 8px);
	background: var(--dt-ivory);
	color: var(--dt-ink);
	outline: none;
}
.dt-reveal.is-empty { grid-template-columns: 1fr; background: rgba(247, 241, 233, 0.06); color: var(--dt-mute); border: 1px dashed var(--dt-line); text-align: center; align-content: center; }
.dt-reveal__hint { margin: 0; font-size: 1.05rem; }
.dt-reveal__num {
	font-family: var(--dt-display);
	font-size: clamp(3.6rem, 2.6rem + 5vw, 6rem);
	line-height: 0.9;
	font-weight: 500;
	color: var(--dt-burg);
	min-width: 1.4ch;
	text-align: center;
}
.dt-reveal__text {
	margin: 0.25rem 0 0;
	font-family: var(--dt-display);
	font-size: clamp(1.35rem, 1.1rem + 1.2vw, 2rem);
	line-height: 1.25;
	font-weight: 500;
	text-wrap: balance;
}
.dt-reveal .dt-actions .dt-btn--ghost { color: var(--dt-ink); border-color: rgba(23, 19, 21, 0.28); }
.dt-reveal .dt-actions .dt-btn--ghost:hover { background: rgba(23, 19, 21, 0.06); border-color: var(--dt-burg); }
.dt-reveal :focus-visible { outline-color: var(--dt-burg); }
.dt-reveal.is-in .dt-reveal__num, .dt-reveal.is-in .dt-reveal__text, .dt-reveal.is-in .dt-tag { animation: dt-rise 0.55s var(--dt-ease) both; }
.dt-reveal.is-in .dt-reveal__text { animation-delay: 0.08s; }
.dt-tag {
	display: inline-block;
	padding: 0.2rem 0.65rem;
	border-radius: var(--r-pill, 999px);
	background: var(--dt-burg);
	color: var(--dt-ivory);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}
.dt-tag--soft { background: rgba(84, 27, 43, 0.12); color: var(--dt-burg); }
@keyframes dt-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Progress ---------- */
.dt-progress { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1rem; color: var(--dt-mute); font-size: 0.85rem; }
.dt-progress__bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(247, 241, 233, 0.12); overflow: hidden; }
.dt-progress__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--dt-rose), var(--dt-champ)); transition: width 0.5s var(--dt-ease); }

/* ---------- Number grid ---------- */
.dt-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; }
@media (min-width: 560px) { .dt-grid { grid-template-columns: repeat(10, 1fr); gap: 0.45rem; } }
.dt-grid.is-quick { grid-template-columns: repeat(5, 1fr); }
@media (min-width: 560px) { .dt-grid.is-quick { grid-template-columns: repeat(10, 1fr); } }
.dt-tile {
	appearance: none;
	position: relative;
	aspect-ratio: 1;
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: 0;
	border: 1px solid var(--dt-line);
	border-radius: 6px;
	background: rgba(247, 241, 233, 0.04);
	color: var(--dt-ivory);
	font: 500 1.3rem/1 var(--dt-display);
	transition: transform 0.25s var(--dt-ease), background-color 0.25s, border-color 0.25s, color 0.25s;
}
.dt-tile:hover { background: var(--dt-burg); border-color: var(--dt-champ); transform: translateY(-2px); }
.dt-tile:active { transform: scale(0.95); }
.dt-tile.is-picked { background: transparent; border-style: dashed; color: rgba(207, 195, 184, 0.55); }
.dt-tile.is-picked::after { content: ""; position: absolute; right: 5px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--dt-champ); opacity: 0.8; }
.dt-tile.is-current { background: var(--dt-champ); border-color: var(--dt-champ); border-style: solid; color: var(--dt-ink); }
.dt-tile.is-current::after { background: var(--dt-burg); }

/* ---------- Generic big card (forfeits, truth or dare) ---------- */
.dt-card { padding: 1.5rem; border-radius: var(--r-md, 8px); background: var(--dt-ivory); color: var(--dt-ink); min-height: 13rem; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 0.75rem; margin-bottom: 1.25rem; outline: none; }
.dt-card.is-empty { background: rgba(247, 241, 233, 0.06); border: 1px dashed var(--dt-line); color: var(--dt-mute); align-items: center; text-align: center; }
.dt-card__text { margin: 0; font-family: var(--dt-display); font-size: clamp(1.6rem, 1.2rem + 2.2vw, 2.6rem); line-height: 1.18; font-weight: 500; text-wrap: balance; }
.dt-card.is-in .dt-card__text, .dt-card.is-in .dt-tag { animation: dt-rise 0.55s var(--dt-ease) both; }
.dt-card .dt-actions { margin-top: 0.5rem; }
.dt-card .dt-btn--ghost { color: var(--dt-ink); border-color: rgba(23, 19, 21, 0.28); }
.dt-card .dt-btn--ghost:hover { background: rgba(23, 19, 21, 0.06); border-color: var(--dt-burg); }
.dt-card :focus-visible { outline-color: var(--dt-burg); }
.dt-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.dt-count { color: var(--dt-mute); font-size: 0.85rem; margin: 0 0 1rem; }
.dt-recent { margin: 1.25rem 0 0; padding: 0; list-style: none; color: var(--dt-mute); font-size: 0.9rem; display: grid; gap: 0.35rem; }
.dt-recent li { padding-left: 1rem; position: relative; }
.dt-recent li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 5px; height: 5px; border-radius: 50%; background: var(--dt-champ); opacity: 0.6; }
.dt-note { margin: 1rem 0 0; font-size: 0.82rem; color: var(--dt-mute); }

/* ---------- Truth or dare ---------- */
.dt-names { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .dt-names { grid-template-columns: 1fr 1fr; } }
.dt-input {
	width: 100%;
	min-height: 2.9rem;
	padding: 0.55rem 0.9rem;
	border: 1px solid var(--dt-line);
	border-radius: 6px;
	background: rgba(247, 241, 233, 0.06);
	color: var(--dt-ivory);
	font: 500 1rem/1.2 var(--dt-body);
}
.dt-input::placeholder { color: rgba(207, 195, 184, 0.6); }
.dt-input:focus { border-color: var(--dt-champ); outline: none; box-shadow: 0 0 0 3px rgba(199, 167, 122, 0.25); }
.dt-turn { font-family: var(--dt-display); font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3rem); line-height: 1.05; margin: 0 0 1rem; font-weight: 500; }
.dt-turn em { color: var(--dt-champ); }
.dt-choose { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.25rem; }
.dt-choose .dt-btn { min-height: 4.5rem; font-family: var(--dt-display); font-size: 1.6rem; font-weight: 500; letter-spacing: 0; }
.dt-score { display: flex; gap: 1rem; margin: 0 0 1rem; color: var(--dt-mute); font-size: 0.85rem; }
.dt-score .is-active { color: var(--dt-champ); font-weight: 700; }

/* ---------- Wheel ---------- */
.dt-wheelwrap { display: grid; gap: 1.5rem; }
@media (min-width: 820px) { .dt-wheelwrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: start; } }
.dt-wheel { position: relative; width: 100%; max-width: 30rem; margin: 0 auto; aspect-ratio: 1; }
.dt-wheel canvas { width: 100%; height: 100%; display: block; border-radius: 50%; box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.8), 0 0 0 6px rgba(199, 167, 122, 0.35); }
.dt-pointer { position: absolute; top: -10px; left: 50%; width: 0; height: 0; transform: translateX(-50%); border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 30px solid var(--dt-ivory); filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5)); z-index: 2; pointer-events: none; }
.dt-hub-btn { position: absolute; z-index: 3; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 22%; aspect-ratio: 1; min-width: 3.2rem; border-radius: 50%; border: 3px solid var(--dt-champ); background: var(--dt-ink); color: var(--dt-champ); font: 700 0.8rem/1 var(--dt-body); letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: transform 0.25s var(--dt-ease), background-color 0.25s; }
.dt-hub-btn:hover:not(:disabled) { background: var(--dt-burg); transform: translate(-50%, -50%) scale(1.05); }
.dt-hub-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.dt-entries { display: grid; gap: 0.4rem; margin: 0 0 0.75rem; padding: 0; list-style: none; max-height: 19rem; overflow: auto; padding-right: 0.25rem; }
.dt-entry { display: flex; gap: 0.4rem; }
.dt-entry .dt-input { min-height: 2.75rem; }
.dt-entry__rm { flex: none; width: 2.75rem; height: 2.75rem; border: 1px solid var(--dt-line); border-radius: 6px; background: transparent; color: var(--dt-ivory); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.dt-entry__rm:hover:not(:disabled) { border-color: var(--dt-champ); background: rgba(247, 241, 233, 0.08); }
.dt-entry__rm:disabled { opacity: 0.35; cursor: not-allowed; }
.dt-check { display: flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; font-size: 0.9rem; color: var(--dt-mute); cursor: pointer; }
.dt-check input { width: 1.25rem; height: 1.25rem; accent-color: var(--dt-champ); }

/* ---------- Toast and sound ---------- */
.dt-toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 20px); z-index: 60; padding: 0.7rem 1.2rem; border-radius: var(--r-pill, 999px); background: var(--ddl-obsidian, #171315); color: var(--ddl-ivory, #F7F1E9); border: 1px solid rgba(199, 167, 122, 0.5); font: 600 0.88rem/1 var(--ddl-font-body, sans-serif); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.35s var(--ease-out, ease); }
.dt-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.dt-sound[aria-pressed="true"] { background: var(--dt-champ); color: var(--dt-ink); border-color: var(--dt-champ); }

/* ---------- Celebration ---------- */
.dt-petal { position: absolute; z-index: 5; left: var(--x); top: 38%; width: 9px; height: 14px; border-radius: 80% 0 80% 0; background: var(--dt-rose); opacity: 0; pointer-events: none; animation: dt-fall 1.5s var(--dt-ease) var(--d) forwards; }
.dt-petal:nth-child(3n) { background: var(--dt-champ); }
.dt-petal:nth-child(4n) { background: #8a2b45; }
@keyframes dt-fall { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), 190px) rotate(var(--r)); } }

/* ---------- Content below the tool ---------- */
.dt-copy { padding: clamp(2rem, 1rem + 4vw, 4.5rem) 0; border-top: 1px solid var(--ddl-line, rgba(23, 19, 21, 0.14)); }
.dt-copy .ddl-wrap { max-width: 46rem; }
.dt-copy h2 { font-size: var(--fs-xl, 2rem); margin: 2.5rem 0 1rem; }
.dt-copy h2:first-child { margin-top: 0; }
.dt-copy p { margin: 0 0 1rem; }
.dt-copy ol, .dt-copy ul { margin: 0 0 1rem; padding-left: 1.25rem; list-style: revert; }
.dt-copy li { margin: 0.45rem 0; padding-left: 0.25rem; }
.dt-faq details { border-top: 1px solid var(--ddl-line, rgba(23, 19, 21, 0.14)); padding: 0.9rem 0; }
.dt-faq details:last-child { border-bottom: 1px solid var(--ddl-line, rgba(23, 19, 21, 0.14)); }
.dt-faq summary { cursor: pointer; font-weight: 700; min-height: 2.75rem; display: flex; align-items: center; }
.dt-faq details p { margin: 0.5rem 0 0; }

.dt-related { padding: 0 0 clamp(3rem, 2rem + 4vw, 6rem); }
.dt-related .ddl-wrap { max-width: 64rem; }
.dt-related h2 { font-size: var(--fs-xl, 2rem); margin: 0 0 1.25rem; }
.dt-cards { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .dt-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .dt-cards { grid-template-columns: repeat(3, 1fr); } }
.dt-tcard { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.4rem; border: 1px solid var(--ddl-line, rgba(23, 19, 21, 0.14)); border-radius: var(--r-md, 8px); background: #fffaf3; text-decoration: none; color: var(--ddl-obsidian, #171315); transition: transform 0.35s var(--dt-ease), box-shadow 0.35s, border-color 0.35s; }
.dt-tcard:hover { transform: translateY(-3px); box-shadow: var(--sh-soft, 0 20px 40px -26px rgba(23, 19, 21, 0.5)); border-color: var(--ddl-champagne, #C7A77A); }
.dt-tcard h3 { font-size: var(--fs-lg, 1.4rem); margin: 0; }
.dt-tcard p { margin: 0; color: var(--ddl-muted, #5C4F53); font-size: 0.95rem; }
.dt-tcard__go { margin-top: auto; padding-top: 0.5rem; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.06em; color: var(--ddl-burgundy, #541B2B); }
.dt-tcard.is-featured { background: var(--ddl-wine, #35111D); color: var(--ddl-ivory, #F7F1E9); border-color: transparent; }
.dt-tcard.is-featured p { color: var(--ddl-muted-dark, #CFC3B8); }
.dt-tcard.is-featured .dt-tcard__go { color: var(--ddl-champagne, #C7A77A); }
.dt-tcard .dt-tag { align-self: flex-start; }
.dt-tcard.is-featured .dt-tag { background: var(--ddl-champagne, #C7A77A); color: var(--ddl-obsidian, #171315); }
.dt-articles { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.dt-articles a { font-weight: 600; }

/* ---------- Hub ---------- */
.dt-hubbar { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin: 1.5rem 0 1.75rem; }
.dt-hubbar .dt-input { max-width: 22rem; background: #fffaf3; color: var(--ddl-obsidian, #171315); border-color: rgba(23, 19, 21, 0.25); }
.dt-hubbar .dt-chip { color: var(--ddl-obsidian, #171315); border-color: rgba(23, 19, 21, 0.25); }
.dt-hubbar .dt-chip.is-on { background: var(--ddl-wine, #35111D); color: var(--ddl-ivory, #F7F1E9); border-color: var(--ddl-wine, #35111D); }
.dt-hubbar :focus-visible { outline: 2px solid var(--ddl-burgundy, #541B2B); outline-offset: 3px; }
.dt-empty { padding: 2rem 0; color: var(--ddl-muted, #5C4F53); }

/* ---------- Mobile polish ---------- */
@media (max-width: 559px) {
	.dt-reveal { grid-template-columns: 1fr; text-align: left; }
	.dt-reveal__num { text-align: left; }
	.dt-actions .dt-btn { flex: 1 1 calc(50% - 0.5rem); }
	.dt-choose .dt-btn { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
	.dt-page *, .dt-page *::before, .dt-page *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
	.dt-petal { display: none; }
}
.dt-tcard[hidden], [data-empty][hidden] { display: none; }
