/* Calczora Fun section: each fun calculator gets its own theme, set by <html data-fun="...">.
   The theme repaints the shared sky, adds its own floating decorations (.fun-fx, built by
   tools/build_calc.py) and swaps the accent colour. Pro keeps a flat tint with no motion. */

/* ================= Love (FLAMES, Love Calculator) ================= */
[data-fun="love"] {
  --fun: #e2466b; --fun-2: #f37a98; --fun-ink: #b3264f; --fun-soft: #ffe3ea; --fun-line: rgba(226, 70, 107, .35);
}
[data-fun="love"] body { background: #fbd0dc; }
/* blush by day, deep wine at night, for every sky choice */
[data-fun="love"] .sky { --s1: #f59ab3 !important; --s2: #fbc4d3 !important; --s3: #fff0f4 !important; }
[data-fun="love"][data-sky="clear"] .sky { --s1: #f48aa7 !important; --s2: #f9b9cb !important; --s3: #ffeef3 !important; }
[data-fun="love"][data-sky="cloudy"] .sky { --s1: #e7a9ba !important; --s2: #f3cbd6 !important; --s3: #fbeef2 !important; }
[data-fun="love"][data-theme="dark"] body { background: #2a1020; }
[data-fun="love"][data-theme="dark"] .sky { --s1: #1d0a16 !important; --s2: #3a1229 !important; --s3: #5a1d3d !important; }
[data-fun="love"][data-theme="dark"][data-sky="clear"] .sky { --s1: #150711 !important; --s2: #2f0e22 !important; --s3: #4b1834 !important; }
[data-fun="love"][data-theme="dark"][data-sky="cloudy"] .sky { --s1: #26121d !important; --s2: #3d1c2e !important; --s3: #553045 !important; }
/* the sun and moon step aside for a soft heart glow; clouds turn cotton-candy */
[data-fun="love"] .orb { display: none; }
[data-fun="love"] .c use { fill: #fff3f6; }
[data-fun="love"][data-theme="dark"] .c use { fill: #4a1d35; }
[data-fun="love"] .stars { filter: hue-rotate(-40deg) saturate(1.4); }

.fun-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.fun-fx .glow { position: absolute; top: -6vmax; right: -4vmax; width: 34vmax; height: 34vmax; opacity: .55;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 62%); }
.fun-fx .glow svg { position: absolute; inset: 24%; width: 52%; height: 52%; fill: #ffd6e1; filter: drop-shadow(0 0 30px rgba(255, 120, 160, .55)); }
[data-theme="dark"] .fun-fx .glow { opacity: .4; background: radial-gradient(circle, rgba(255, 120, 165, .35), rgba(255, 120, 165, 0) 62%); }
[data-theme="dark"] .fun-fx .glow svg { fill: #ff8fb0; }
.fun-fx .h { position: absolute; bottom: -40px; width: var(--s, 18px); height: var(--s, 18px); fill: var(--c, #fff); opacity: 0;
  animation: heartRise var(--t, 22s) linear var(--d, 0s) infinite; }
@keyframes heartRise {
  0% { opacity: 0; transform: translate(0, 0) rotate(-8deg); }
  10% { opacity: var(--o, .55); }
  50% { transform: translate(var(--x, 24px), -55vh) rotate(8deg); }
  90% { opacity: var(--o, .55); }
  100% { opacity: 0; transform: translate(0, -110vh) rotate(-6deg); }
}
[data-theme="dark"] .fun-fx .h { --c: #ff8fb0; }

/* accents: rose instead of navy and amber */
[data-fun] .under path { stroke: var(--fun-2); }
[data-fun] .btn.fun-go { color: #fff; background: linear-gradient(180deg, var(--fun-2), var(--fun) 60%, var(--fun-ink)); box-shadow: 0 12px 22px -14px rgba(160, 20, 60, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
[data-fun] .btn.fun-go:disabled { opacity: .55; }
[data-fun] .eyebrow { color: var(--fun-ink); }
[data-theme="dark"][data-fun] .eyebrow { color: #ff9fbb; }
[data-fun] .cf-in:focus-within, [data-fun] .fun-name:focus { border-color: var(--fun); box-shadow: 0 0 0 3px rgba(226, 70, 107, .22); }
[data-fun] .bonus svg { color: var(--fun); }

/* Pro: a calm flat tint, no floating hearts */
[data-look="pro"][data-fun="love"] body { background: #fdf1f4; }
[data-look="pro"][data-fun="love"] .sky { background: linear-gradient(180deg, #fbe1e8 0, #fdf1f4 300px) !important; }
[data-look="pro"][data-fun="love"][data-theme="dark"] body { background: #1c0d16; }
[data-look="pro"][data-fun="love"][data-theme="dark"] .sky { background: linear-gradient(180deg, #2d1222 0, #1c0d16 300px) !important; }
[data-look="pro"] .fun-fx { display: none; }
@media (prefers-reduced-motion: reduce) { .fun-fx .h { animation: none; display: none; } }

/* ================= FLAMES game board ================= */
.fun-name { width: 100%; height: 52px; padding: 0 14px; border: 1.5px solid var(--field-line); border-radius: 14px; background: var(--field); color: var(--navy);
  font: 650 17px/1 "Figtree", system-ui, sans-serif; text-align: left; }
.fun-name:focus { outline: none; }
.fun-name[aria-invalid="true"] { border-color: #d64545; }
.fun-names { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 10px; margin-top: 14px; }
.fun-names label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--navy); }
.fun-names .plus { display: grid; place-items: center; width: 34px; height: 52px; }
.fun-names .plus svg { width: 26px; height: 26px; fill: var(--fun); }
@media (max-width: 520px) { .fun-names { grid-template-columns: 1fr; } .fun-names .plus { width: 100%; height: 22px; } }
.btn.fun-go { width: 100%; min-height: 54px; margin-top: 16px; font-size: 17px; }
.btn.fun-go svg { width: 20px; height: 20px; fill: currentColor; }

.fl-row { display: flex; justify-content: center; gap: 6px; margin: 4px 0 6px; }
.fl-row span { display: grid; place-items: center; width: 34px; height: 38px; border-radius: 10px; background: var(--fun-soft); color: var(--fun-ink);
  font: 800 17px/1 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; opacity: .45; transition: transform .35s cubic-bezier(.2, .9, .3, 1.3), opacity .3s; }
.fl-row span.win { opacity: 1; color: #fff; background: linear-gradient(180deg, var(--fun-2), var(--fun)); transform: scale(1.18); box-shadow: 0 8px 16px -8px rgba(180, 30, 70, .7); }
[data-theme="dark"] .fl-row span { background: rgba(255, 143, 176, .16); color: #ffb3c8; }

.board-names { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.board-name { display: flex; flex-wrap: wrap; gap: 5px; }
.board-name b { display: block; width: 100%; margin-bottom: 2px; font-size: 13px; color: var(--navy-2); font-weight: 700; }
.tile { position: relative; display: grid; place-items: center; min-width: 32px; height: 36px; padding: 0 6px; border-radius: 9px; border: 1.5px solid var(--fun-line);
  background: var(--field); color: var(--navy); font: 750 16px/1 "Figtree", system-ui, sans-serif; text-transform: uppercase; transition: opacity .3s, background-color .3s; }
.tile.gone { opacity: .42; background: var(--fun-soft); text-decoration: line-through 2.5px var(--fun); }
.tile.gone::after { content: ""; position: absolute; top: -7px; right: -6px; width: 13px; height: 13px;
  background: var(--fun); -webkit-mask: var(--lo-shape) center / contain no-repeat; mask: var(--lo-shape) center / contain no-repeat; }
[data-theme="dark"] .tile.gone { background: rgba(255, 143, 176, .14); }
.board-count { margin-top: 12px; font-size: 15px; color: var(--body-soft); }
.board-count b { color: var(--fun-ink); font-weight: 800; }
[data-theme="dark"] .board-count b { color: #ff9fbb; }
.board-flames { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.board-flames .ft { position: relative; display: grid; place-items: center; width: 46px; height: 52px; border-radius: 12px; background: var(--fun-soft); color: var(--fun-ink);
  font: 800 22px/1 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; transition: opacity .35s, transform .35s cubic-bezier(.2, .9, .3, 1.3); }
.board-flames .ft small { position: absolute; bottom: -18px; font: 700 11px/1 "Figtree", system-ui, sans-serif; color: var(--navy-2); }
.board-flames .ft.out { opacity: .3; transform: scale(.88); }
.board-flames .ft.out::before { content: ""; position: absolute; inset: 22% 18%; background: linear-gradient(45deg, transparent 46%, var(--fun) 46% 54%, transparent 54%), linear-gradient(-45deg, transparent 46%, var(--fun) 46% 54%, transparent 54%); }
.board-flames .ft.win { color: #fff; background: linear-gradient(180deg, var(--fun-2), var(--fun)); transform: scale(1.12); box-shadow: 0 10px 20px -10px rgba(180, 30, 70, .8); }
[data-theme="dark"] .board-flames .ft { background: rgba(255, 143, 176, .16); color: #ffb3c8; }
.board-order { margin: 28px 0 0; padding-left: 20px; font-size: 14.5px; line-height: 1.5; color: var(--body-soft); }
.board-order li + li { margin-top: 4px; }
.fun-note { margin-top: 10px; font-size: 13px; color: var(--navy-2); }
[data-look="pro"] .tile, [data-look="pro"] .board-flames .ft, [data-look="pro"] .fl-row span { border-radius: 6px; }

/* ================= Flames: the bold look of the love theme ================= */
[data-fun="love"][data-fun-alt] { --fun: #f0541e; --fun-2: #ff8a3d; --fun-ink: #b8360c; --fun-soft: #ffe6d6; --fun-line: rgba(240, 84, 30, .35); }
[data-fun="love"][data-fun-alt] body { background: #ffc49a; }
[data-fun="love"][data-fun-alt] .sky { --s1: #f2562a !important; --s2: #ff9a55 !important; --s3: #ffe6cc !important; }
[data-fun="love"][data-fun-alt][data-sky="clear"] .sky { --s1: #ee4a22 !important; --s2: #ff8c47 !important; --s3: #ffe1c2 !important; }
[data-fun="love"][data-fun-alt][data-sky="cloudy"] .sky { --s1: #d9775a !important; --s2: #f0a88a !important; --s3: #fbe5d9 !important; }
[data-fun="love"][data-fun-alt][data-theme="dark"] body { background: #1c0905; }
[data-fun="love"][data-fun-alt][data-theme="dark"] .sky { --s1: #0d0403 !important; --s2: #240b06 !important; --s3: #43150a !important; }
[data-fun="love"][data-fun-alt][data-theme="dark"][data-sky="clear"] .sky { --s1: #080201 !important; --s2: #1d0804 !important; --s3: #3a1208 !important; }
[data-fun="love"][data-fun-alt][data-theme="dark"][data-sky="cloudy"] .sky { --s1: #1a0d0a !important; --s2: #2c1610 !important; --s3: #432419 !important; }
[data-fun="love"][data-fun-alt] .c use { fill: #fff1e6; }
[data-fun="love"][data-fun-alt][data-theme="dark"] .c use { fill: #3a1a12; }
[data-fun="love"][data-fun-alt] .stars { filter: hue-rotate(-70deg) saturate(1.6); }
/* hearts float in Hearts, embers rise in Flames */
.fun-fx .em { position: absolute; bottom: -20px; width: var(--s, 5px); height: var(--s, 5px); border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff4c2 0, #ffb347 40%, rgba(255, 90, 20, 0) 72%); box-shadow: 0 0 8px 2px rgba(255, 120, 40, .55);
  animation: emberRise var(--t, 12s) ease-in var(--d, 0s) infinite; display: none; }
@keyframes emberRise {
  0% { opacity: 0; transform: translate(0, 0) scale(1); }
  12% { opacity: .9; }
  60% { opacity: .7; transform: translate(var(--x, 30px), -60vh) scale(.8); }
  100% { opacity: 0; transform: translate(calc(var(--x, 30px) * -.5), -105vh) scale(.4); }
}
[data-fun-alt] .fun-fx .em { display: block; }
[data-fun-alt] .fun-fx .h { display: none; }
.fun-fx .glow .lb-flame, [data-fun-alt] .fun-fx .glow .lb-heart { display: none; }
[data-fun-alt] .fun-fx .glow .lb-flame { display: inline; }
[data-fun-alt] .fun-fx .glow svg { fill: #ffd38a; filter: drop-shadow(0 0 34px rgba(255, 110, 30, .7)); }
[data-fun-alt][data-theme="dark"] .fun-fx .glow { background: radial-gradient(circle, rgba(255, 110, 30, .38), rgba(255, 110, 30, 0) 62%); }
[data-fun-alt][data-theme="dark"] .fun-fx .glow svg { fill: #ff7a2a; }
@media (prefers-reduced-motion: reduce) { .fun-fx .em { animation: none; display: none !important; } }

/* ================= the logo: a heart (or a flame) for the "o", a badge on the cloud ================= */
[data-fun] .hd-logo { position: relative; }
[data-fun] .hd .tw b { color: var(--fun); }
[data-theme="dark"][data-fun] .hd .tw b { color: var(--fun-2); }
[data-fun] { --lo-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -9 20 16'%3E%3Cpath d='M0 6C-6 1.5-9-2-9-5.5A4.5 4.5 0 0 1 0-8a4.5 4.5 0 0 1 9 2.5C9-2 6 1.5 0 6z'/%3E%3C/svg%3E"); }
[data-fun][data-fun-alt] { --lo-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-9 -12 18 21'%3E%3Cpath d='M0 8C-5 8-7.5 4.5-7.5 1-7.5-3-4-5.5-3.5-9-1.5-7-1-5 .5-5 0-8 2.5-10 3-11 4.5-7.5 7.5-4.5 7.5 1 7.5 4.5 5 8 0 8z'/%3E%3C/svg%3E"); }
[data-fun] .tw .lo { display: inline-block; width: .6em; height: .58em; margin: 0 .02em; color: transparent; vertical-align: -.02em; background: var(--fun);
  -webkit-mask: var(--lo-shape) center / contain no-repeat; mask: var(--lo-shape) center / contain no-repeat; }
[data-theme="dark"][data-fun] .tw .lo { background: var(--fun-2); }
.lo-badge { display: none; }
[data-fun] .lo-badge { display: block; position: absolute; left: 30px; top: -2px; width: 17px; height: 17px; fill: var(--fun); stroke: #fff; stroke-width: 1.6px; filter: drop-shadow(0 2px 3px rgba(120, 20, 50, .35));
  animation: badgeBeat 2.4s ease-in-out infinite; transform-origin: 50% 60%; }
[data-fun] .lo-badge .lb-flame, [data-fun][data-fun-alt] .lo-badge .lb-heart { display: none; }
[data-fun][data-fun-alt] .lo-badge .lb-flame { display: inline; }
@keyframes badgeBeat { 0%, 60%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(.96); } 45% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { [data-fun] .lo-badge { animation: none; } }

/* ================= the look switch, fun version ================= */
.fun-switch button svg { width: 15px; height: 15px; }
.fun-switch button[aria-pressed="true"] { color: var(--fun-ink); }

/* ================= Cupid: beanie colours and the extra moods ================= */
.fun-mascot { width: 118px !important; height: 82px !important; }
.fun-mascot .bn-dome { fill: #f37a98; stroke: #b3264f; }
.fun-mascot .bn-brim { fill: #e2466b; stroke: #b3264f; }
.fun-mascot .bn-rib { stroke: #ffc2d2; }
.fun-mascot .bn-pom { fill: #ffe1ea; stroke: #e2466b; }
.fun-mascot .bn-h { fill: #fff; }
.fun-mascot .bn-f { display: none; fill: #ffd66b; }
.fun-mascot .bow-tip { fill: #e2466b; }
.fun-mascot .bow-tail { stroke: #e2466b; }
[data-fun-alt] .fun-mascot .bn-dome { fill: #ff7a3d; stroke: #b8360c; }
[data-fun-alt] .fun-mascot .bn-brim { fill: #e8451a; stroke: #b8360c; }
[data-fun-alt] .fun-mascot .bn-rib { stroke: #ffc7a3; }
[data-fun-alt] .fun-mascot .bn-pom { fill: #ffe4c4; stroke: #e8451a; }
[data-fun-alt] .fun-mascot .bn-h { display: none; }
[data-fun-alt] .fun-mascot .bn-f { display: inline; }
[data-fun-alt] .fun-mascot .wg { stroke: #f3a27a; }
[data-fun-alt] .fun-mascot .bow-tip { fill: #f0541e; }
[data-fun-alt] .fun-mascot .bow-tail { stroke: #f0541e; }
.f-heart, .m-shy, .m-red, .m-steam { display: none; }
.f-heart path { fill: #e2466b; }
[data-fun-alt] .f-heart path { fill: #f0541e; }
[data-mood="hearts"] :is(.f-heart, .f-big),
[data-mood="wedding"] :is(.f-heart, .f-big, .m-spark),
[data-mood="shy"] :is(.f-happy, .f-smile, .m-shy),
[data-mood="angry"] :is(.eyes, .b-set, .f-frown, .m-red, .m-steam),
[data-mood="cheeky"] :is(.eyes, .b-up, .f-wink, .f-grin) { display: inline; }
[data-mood="cheeky"] .eye-r { display: none; }
.f-heart path { transform-box: fill-box; transform-origin: center; animation: heartBeat 1.1s ease-in-out infinite; }
@keyframes heartBeat { 0%, 100% { scale: 1; } 30% { scale: 1.16; } 50% { scale: .96; } }
.m-steam path { transform-box: fill-box; transform-origin: center; animation: steam 1.6s ease-out infinite; }
.m-steam .st2 { animation-delay: .5s; }
@keyframes steam { 0% { opacity: 0; translate: 0 4px; scale: .6; } 30% { opacity: 1; } 100% { opacity: 0; translate: 0 -9px; scale: 1.15; } }
[data-mood="angry"] .m-bob { animation: fume .45s ease-in-out 3; }
@keyframes fume { 0%, 100% { translate: 0 0; } 25% { translate: -2px 0; } 75% { translate: 2px 0; } }
@media (prefers-reduced-motion: reduce) { .f-heart path, .m-steam path, [data-mood="angry"] .m-bob { animation: none; } }

/* ================= reveal, couples and the meanings table ================= */
.result.waiting .big, .result.waiting .res-sub, .result.waiting .stats, .result.waiting .fine, .result.waiting .fl-row, .result.waiting .res-actions { opacity: .4; transition: opacity .25s; }
.result.landed .big { animation: land .6s cubic-bezier(.2, .9, .3, 1.35); }
@keyframes land { 0% { transform: scale(.8); opacity: .3; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .result.landed .big { animation: none; } }
.couples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
@media (max-width: 520px) { .couples { grid-template-columns: 1fr; } }
.couple { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 64px; padding: 12px 14px; border: 1.5px solid var(--fun-line); border-radius: 14px; background: var(--field); text-align: left; cursor: pointer; color: var(--navy); transition: border-color .2s, transform .15s; }
.couple .cn { font-weight: 750; font-size: 15px; }
.couple .cn i { font-style: normal; color: var(--fun); }
.couple .cr { font-size: 13.5px; font-weight: 700; color: var(--fun-ink); }
[data-theme="dark"] .couple .cr { color: #ffb3c8; }
@media (hover: hover) { .couple:hover { border-color: var(--fun); transform: translateY(-1px); } }
.couple:active { transform: scale(.98); }
.meanings { margin-top: 12px; }
.meanings td:first-child { font: 800 18px/1 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; color: var(--fun-ink); }
[data-theme="dark"] .meanings td:first-child { color: #ffb3c8; }
.meanings td[lang="hi"] { font-family: "Nirmala UI", "Noto Sans Devanagari", system-ui, sans-serif; }

/* phones: the two looks show as icons only (the names stay for screen readers) */
@media (max-width: 430px) { .lookswitch.fun-switch button { font-size: 0; gap: 0; min-width: 46px; padding: 0 12px; } .lookswitch.fun-switch button svg { display: block; width: 18px; height: 18px; } }

/* the soft buttons (Share, Start over) take the page's colour too */
[data-fun] .btn.soft { color: var(--fun-ink); background: var(--fun-soft); box-shadow: inset 0 0 0 1px var(--fun-line); }
@media (hover: hover) { [data-fun] .btn.soft:hover { background: color-mix(in srgb, var(--fun-soft) 70%, var(--fun-2)); } }
[data-theme="dark"][data-fun] .btn.soft { color: #ffd1df; background: rgba(255, 143, 176, .14); box-shadow: inset 0 0 0 1px rgba(255, 143, 176, .25); }
[data-theme="dark"][data-fun][data-fun-alt] .btn.soft { color: #ffd2b8; background: rgba(255, 138, 61, .14); box-shadow: inset 0 0 0 1px rgba(255, 138, 61, .28); }
@media (max-width: 430px) { .board-flames { gap: 6px; } .board-flames .ft { width: 40px; height: 48px; font-size: 20px; } }
/* Flames by day: the orange sky needs a deeper ember for the logo to read */
[data-fun][data-fun-alt]:not([data-theme="dark"]) .hd .tw b { color: #a32a07; }
[data-fun][data-fun-alt]:not([data-theme="dark"]) .tw .lo { background: #a32a07; }
[data-fun][data-fun-alt]:not([data-theme="dark"]) .lo-badge { fill: #c2380c; }

/* ================= night cards: tinted to match the sky (wine for Hearts, charcoal ember for Flames) ================= */
html[data-fun="love"][data-theme="dark"] {
  --frost: rgba(52, 20, 40, .84); --quiet: rgba(52, 20, 40, .76); --glass: rgba(52, 20, 40, .84);
  --hero-a: rgba(92, 32, 66, .82); --hero-b: rgba(50, 18, 38, .78);
  --field: rgba(30, 10, 22, .9); --solid: rgba(30, 10, 22, .86); --grade: #4a2038;
  --tint: rgba(255, 143, 176, .12); --tint-strong: rgba(255, 143, 176, .2);
  --edge: rgba(255, 190, 210, .18); --hairline: rgba(255, 210, 225, .12); --field-line: rgba(255, 190, 210, .32);
}
html[data-fun="love"][data-fun-alt][data-theme="dark"] {
  --frost: rgba(44, 20, 13, .86); --quiet: rgba(44, 20, 13, .78); --glass: rgba(44, 20, 13, .86);
  --hero-a: rgba(86, 34, 16, .84); --hero-b: rgba(42, 18, 10, .8);
  --field: rgba(24, 10, 6, .9); --solid: rgba(24, 10, 6, .86); --grade: #4a2416;
  --tint: rgba(255, 138, 61, .12); --tint-strong: rgba(255, 138, 61, .2);
  --edge: rgba(255, 200, 160, .18); --hairline: rgba(255, 215, 190, .12); --field-line: rgba(255, 190, 150, .32);
}
html[data-fun][data-theme="dark"] .card { border-color: var(--edge); }
/* the winning letter stays lit at night */
[data-theme="dark"] .fl-row span.win, [data-theme="dark"] .board-flames .ft.win { color: #fff; background: linear-gradient(180deg, var(--fun-2), var(--fun)); }
[data-theme="dark"][data-fun-alt] .fl-row span:not(.win), [data-theme="dark"][data-fun-alt] .board-flames .ft:not(.win) { background: rgba(255, 138, 61, .14); color: #ffc49a; }
[data-theme="dark"][data-fun-alt] .eyebrow, [data-theme="dark"][data-fun-alt] .board-count b, [data-theme="dark"][data-fun-alt] .couple .cr, [data-theme="dark"][data-fun-alt] .meanings td:first-child { color: #ffb27a; }
[data-theme="dark"][data-fun-alt] .tile.gone { background: rgba(255, 138, 61, .14); }
html[data-fun="love"][data-theme="dark"] .tool > .result::after { background: radial-gradient(70% 46% at 50% 30%, rgba(255, 143, 176, .2), rgba(255, 143, 176, 0) 70%); }
html[data-fun="love"][data-fun-alt][data-theme="dark"] .tool > .result::after { background: radial-gradient(70% 46% at 50% 30%, rgba(255, 138, 61, .2), rgba(255, 138, 61, 0) 70%); }

/* ================= readable text on the coloured buttons and tiles (WCAG AA) ================= */
[data-fun="love"] { --go-a: #c8345a; --go-b: #9e1c43; }
[data-fun="love"][data-fun-alt] { --go-a: #c93c0c; --go-b: #9a2806; }
[data-fun] .btn.fun-go { background-color: var(--go-b); background-image: linear-gradient(180deg, var(--go-a), var(--go-b)); }
.fl-row span.win, .board-flames .ft.win, [data-theme="dark"] .fl-row span.win, [data-theme="dark"] .board-flames .ft.win {
  background-color: var(--go-b); background-image: linear-gradient(180deg, var(--go-a), var(--go-b)); color: #fff; }
@media (hover: hover) { [data-fun] .btn.soft:hover { color: #8f1a3c; } [data-fun][data-fun-alt] .btn.soft:hover { color: #8a2206; } [data-theme="dark"][data-fun] .btn.soft:hover { color: #fff; } }

/* =====================================================================
   FLAMES stage layout (fun pages get their own layout, not the calculator template)
   ===================================================================== */
/* the names card is a notebook page: ruled lines and a pink margin, the way FLAMES was played */
.notebook { position: relative; overflow: hidden;
  background-image: linear-gradient(90deg, transparent 30px, rgba(226, 70, 107, .35) 30px, rgba(226, 70, 107, .35) 32px, transparent 32px),
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(90, 140, 210, .16) 31px 32px);
  background-position: 0 0, 0 18px; }
[data-theme="dark"] .notebook { background-image: linear-gradient(90deg, transparent 30px, rgba(255, 143, 176, .3) 30px, rgba(255, 143, 176, .3) 32px, transparent 32px),
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(255, 220, 230, .07) 31px 32px); }
[data-fun-alt] .notebook { background-image: linear-gradient(90deg, transparent 30px, rgba(240, 84, 30, .35) 30px, rgba(240, 84, 30, .35) 32px, transparent 32px),
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(200, 120, 70, .16) 31px 32px); }
.notebook h2 { padding-left: 22px; font: 800 22px/1.2 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; color: var(--navy); }
.notebook .fun-names, .notebook .cf-note, .notebook .fun-go, .notebook .fun-note { margin-left: 22px; }
.notebook .fun-go { width: calc(100% - 22px); }
.nb-doodles { position: absolute; top: 12px; right: 14px; display: flex; gap: 4px; transform: rotate(10deg); pointer-events: none; }
.nb-doodles svg { width: 22px; height: 18px; fill: none; stroke: var(--fun); stroke-width: 1.6px; }
.nb-doodles svg + svg { width: 15px; height: 12px; margin-top: 12px; }
/* two names side by side, even on a phone */
.fun-names { grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr) !important; gap: 6px; }
.fun-names .plus { width: 30px; height: 50px; }
.fun-names .plus svg { width: 20px; height: 20px; }
.fun-name { height: 50px; padding: 0 12px; font-size: 16.5px; }
@media (max-width: 520px) { .fun-names label { font-size: 13px; } }

/* the stage */
.stage { text-align: center; }
.stage .eyebrow { align-self: center; padding-right: 0; }
.st-names { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 8px; }
.st-names .board-name { justify-content: center; align-items: center; gap: 4px; }
.st-names .board-name b { width: auto; margin: 0 6px 0 0; font-size: 12.5px; max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-names .tile { min-width: 26px; height: 30px; padding: 0 5px; border-radius: 8px; font-size: 14px; }
.st-names .tile.gone::after { top: -6px; right: -5px; width: 11px; height: 11px; }

.fl-ring { --size: min(292px, 80vw); position: relative; width: var(--size); height: var(--size); margin: 4px auto 30px; flex: none; }
.fl-track { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fl-track circle { fill: none; stroke: var(--fun-line); stroke-width: .8; stroke-dasharray: 1.6 2.4; }
.rl { --R: calc(var(--size) * .41); position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; display: grid; place-items: center; border-radius: 50%;
  background: var(--fun-soft); color: var(--fun-ink); box-shadow: inset 0 0 0 1.5px var(--fun-line);
  transform: rotate(var(--a)) translateY(calc(var(--R) * -1)) rotate(calc(var(--a) * -1));
  transition: opacity .3s, background-color .2s, color .2s, scale .18s cubic-bezier(.2, .9, .3, 1.4); }
.rl b { font: 800 23px/1 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; }
.rl small { position: absolute; bottom: -17px; left: 50%; translate: -50% 0; font: 700 11px/1 "Figtree", system-ui, sans-serif; color: var(--navy-2); white-space: nowrap; }
.rl.tick { scale: 1.16; color: #fff; background-color: var(--fun-2); box-shadow: 0 0 0 4px var(--fun-soft); }
.rl.out { opacity: .4; scale: .9; }
.rl.out::before { content: ""; position: absolute; inset: 24%; background: linear-gradient(45deg, transparent 45%, var(--fun) 45% 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, var(--fun) 45% 55%, transparent 55%); }
.rl.win { scale: 1.22; color: #fff; background-color: var(--go-b); background-image: linear-gradient(180deg, var(--go-a), var(--go-b)); box-shadow: 0 10px 22px -8px rgba(160, 20, 60, .75), 0 0 0 5px var(--fun-soft); }
.rl.win small { color: var(--fun-ink); }
[data-theme="dark"] .rl:not(.win):not(.tick) { background: rgba(255, 143, 176, .14); color: #ffc2d3; }
[data-theme="dark"][data-fun-alt] .rl:not(.win):not(.tick) { background: rgba(255, 138, 61, .14); color: #ffc49a; }
[data-theme="dark"] .rl small, [data-theme="dark"] .rl.win small { color: #f3d6e0; }
/* the buddy in the middle of the ring, big enough to read the mood */
.fl-ring .result-mascot.fun-mascot { position: absolute !important; left: 50%; top: 47%; right: auto; width: 54% !important; height: auto !important; aspect-ratio: 150 / 104;
  translate: -50% -50%; filter: drop-shadow(0 8px 10px rgba(120, 30, 60, .22)); }
.ring-n { position: absolute; left: 50%; top: 71%; translate: -50% 0; display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 10px; border-radius: 99px;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--fun-line); font: 650 12px/1 "Figtree", system-ui, sans-serif; color: var(--navy-2); }
.ring-n b { font: 800 16px/1 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; color: var(--fun-ink); }
[data-theme="dark"] .ring-n b { color: #ffb3c8; }
.stage .big { margin-top: 2px; }
.stage .fine { margin-top: 2px; }
.stage.playing .stats, .stage.playing .res-actions, .stage.playing .bonus, .stage.playing .work { opacity: .35; transition: opacity .25s; }
.stage.playing { cursor: pointer; }
.skip-hint { margin-top: 4px; font-size: 12px; color: var(--navy-2); }
.stage.landed .big { animation: land .6s cubic-bezier(.2, .9, .3, 1.35); }
@media (prefers-reduced-motion: reduce) { .rl { transition: none; } .stage.landed .big { animation: none; } }
@media (min-width: 960px) {
  [data-fun] .tool.calc-tool { grid-template-columns: minmax(0, .85fr) minmax(400px, 1.15fr); }
  .fl-ring { --size: 330px; }
  .rl { width: 58px; height: 58px; margin: -29px 0 0 -29px; }
  .rl b { font-size: 26px; }
}

/* ================= below the game: couples and every count ================= */
.fun-extra { display: flex; flex-direction: column; gap: 34px; margin-top: 10px; }
.fun-block .fb-head h2 { font: 800 var(--t-h2, 28px)/1.15 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; color: var(--navy); }
.fun-block .fb-head p { margin-top: 6px; color: var(--body-soft, #3d4a6b); max-width: 60ch; }
[data-theme="dark"] .fun-block .fb-head h2 { color: #fff; }
[data-theme="dark"] .fun-block .fb-head p { color: #f3d6e0; }
/* couples: a row of cards you swipe on a phone */
.couples { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); grid-template-columns: none; gap: 12px; margin-top: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; overscroll-behavior-x: contain; }
.couple { scroll-snap-align: start; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 132px; padding: 16px; border: 0; border-radius: 20px;
  background: var(--glass); box-shadow: inset 0 0 0 1.5px var(--fun-line), 0 10px 24px -18px rgba(120, 20, 50, .6); text-align: left; cursor: pointer; color: var(--navy); transition: translate .2s, box-shadow .2s; }
.couple .cr-e { font-size: 30px; line-height: 1; }
.couple .cn { font: 750 16px/1.25 "Figtree", system-ui, sans-serif; }
.couple .cn i { font-style: normal; color: var(--fun); }
.couple .cr { margin-top: auto; padding: 4px 10px; border-radius: 99px; background: var(--fun-soft); color: var(--fun-ink); font-size: 13px; font-weight: 750; }
@media (hover: hover) { .couple:hover { translate: 0 -3px; box-shadow: inset 0 0 0 1.5px var(--fun), 0 16px 28px -18px rgba(120, 20, 50, .7); } }
@media (min-width: 960px) { .couples { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; } }
[data-theme="dark"] .couple { color: #fff; }
[data-theme="dark"] .couple .cr { background: rgba(255, 143, 176, .16); color: #ffc2d3; }
/* every count as a grid of tiles, coloured by the answer */
.count-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 16px; }
.cg { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px 9px; border-radius: 16px; background: var(--cg-bg); color: var(--cg-ink); }
.cg b { font: 800 22px/1 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; }
.cg span { font-size: 18px; line-height: 1; }
.cg small { font: 700 11.5px/1.1 "Figtree", system-ui, sans-serif; }
.cg[data-l="F"] { --cg-bg: #e3f5ee; --cg-ink: #0b6b55; }
.cg[data-l="L"] { --cg-bg: #ffe0e8; --cg-ink: #a51e45; }
.cg[data-l="A"] { --cg-bg: #fff0d6; --cg-ink: #8a4d00; }
.cg[data-l="M"] { --cg-bg: #ffe6f0; --cg-ink: #9a1d5a; }
.cg[data-l="E"] { --cg-bg: #ffe1d8; --cg-ink: #9c2c0e; }
.cg[data-l="S"] { --cg-bg: #e4edfb; --cg-ink: #26457e; }
[data-theme="dark"] .cg { --cg-bg: rgba(255, 255, 255, .07); --cg-ink: #ffe3ec; box-shadow: inset 0 0 0 1px rgba(255, 220, 230, .12); }

/* the footer follows the fun theme too (day and night) */
html[data-fun="love"] .sitefoot { background: linear-gradient(180deg, #ffe1ea, #fbd0dc); }
html[data-fun="love"][data-fun-alt] .sitefoot { background: linear-gradient(180deg, #ffe4cf, #ffd2b0); }
html[data-fun="love"][data-theme="dark"] .sitefoot { background: linear-gradient(180deg, #6a2449, #4e1835); color: #f3d6e0; }
html[data-fun="love"][data-fun-alt][data-theme="dark"] .sitefoot { background: linear-gradient(180deg, #5a2412, #401709); color: #f3d6c6; }
html[data-fun][data-theme="dark"] .sitefoot .base { border-color: rgba(255, 220, 230, .12); }
html[data-fun][data-theme="dark"] .sitefoot li a, html[data-fun][data-theme="dark"] .sitefoot p { color: #f3d6e0; }

/* ================= header pop-ups (Display and the Calculators menu) follow the fun theme ================= */
html[data-fun="love"] { --pop: #fff6f8; --pop-seg: #ffe6ee; --pop-on: #fff; --pop-ink: #3a1a2a; --pop-soft: #7a4a5c; --pop-ring: rgba(226, 70, 107, .3); }
html[data-fun="love"][data-fun-alt] { --pop: #fff7f0; --pop-seg: #ffe9d9; --pop-on: #fff; --pop-ink: #3a1f12; --pop-soft: #7a5040; --pop-ring: rgba(240, 84, 30, .3); }
html[data-fun="love"][data-theme="dark"] { --pop: #3a1429; --pop-seg: rgba(255, 143, 176, .1); --pop-on: rgba(255, 255, 255, .94); --pop-ink: #fbe7ef; --pop-soft: #e2b7c8; }
html[data-fun="love"][data-fun-alt][data-theme="dark"] { --pop: #2e140b; --pop-seg: rgba(255, 138, 61, .1); --pop-on: rgba(255, 255, 255, .94); --pop-ink: #fbeadf; --pop-soft: #e4bfa8; }
html[data-fun] .hd-pop { background: var(--pop); color: var(--pop-ink); box-shadow: 0 30px 60px -26px rgba(90, 20, 45, .55), 0 0 0 1px var(--fun-line); }
html[data-fun] .hd-k, html[data-fun] .hd-fine, html[data-fun] .mega-none, html[data-fun] .mega-cat h3 a { color: var(--pop-soft); }
html[data-fun] .hd-seg { background: var(--pop-seg); }
html[data-fun] .hd-seg button { color: var(--pop-ink); }
html[data-fun] .hd-seg button[aria-pressed="true"] { background: var(--pop-on); color: var(--fun-ink); box-shadow: 0 2px 8px -3px rgba(120, 20, 50, .45); }
@media (hover: hover) { html[data-fun] .hd-seg button[aria-pressed="false"]:hover { background: rgba(255, 255, 255, .5); } html[data-fun][data-theme="dark"] .hd-seg button[aria-pressed="false"]:hover { background: rgba(255, 255, 255, .08); } }
html[data-fun] .mega-find { background: var(--pop-on); border-color: var(--fun-line); color: var(--pop-soft); }
html[data-fun][data-theme="dark"] .mega-find { background: rgba(0, 0, 0, .22); }
html[data-fun] .mega-find:focus-within { border-color: var(--fun); box-shadow: 0 0 0 4px var(--pop-ring); }
html[data-fun] .mega-find input { color: var(--pop-ink); }
html[data-fun] .mega-find input::placeholder { color: var(--pop-soft); }
html[data-fun] .mega-cat li > a, html[data-fun] .mega-all { color: var(--pop-ink); }
@media (hover: hover) { html[data-fun] .mega-cat li > a:hover, html[data-fun] .mega-cat h3 a:hover { background: var(--pop-seg); color: var(--fun-ink); } }
html[data-fun][data-theme="dark"] .mega-cat li > a:hover { color: #fff; }
html[data-fun] .mega-cat li > span { color: var(--pop-soft); }
html[data-fun] .mega-cat small { background: var(--fun-soft); color: var(--fun-ink); }
html[data-fun][data-theme="dark"] .mega-cat small { background: rgba(255, 143, 176, .16); color: #ffc2d3; }
html[data-fun][data-theme="dark"] .hd-btn[aria-expanded="true"] { background: rgba(255, 143, 176, .28); }
html[data-fun][data-fun-alt][data-theme="dark"] .hd-btn[aria-expanded="true"] { background: rgba(255, 138, 61, .28); }
@media (hover: hover) { html[data-fun][data-theme="dark"] .hd-btn:hover { background: rgba(255, 143, 176, .2); } html[data-fun][data-fun-alt][data-theme="dark"] .hd-btn:hover { background: rgba(255, 138, 61, .2); } }
/* the footer logo takes the theme's colour too (amber is too faint on the blush footer) */
html[data-fun] .sitefoot .ft b { color: var(--fun-ink); }
html[data-fun][data-theme="dark"] .sitefoot .ft b { color: var(--fun-2); }

/* after a fun result: one quiet tip link (never next to an ad slot: it sits inside the result card) */
.tip-line { margin-top: 16px; font-size: 14px; text-align: center; }
.tip-line[hidden] { display: none; }
.tip-line a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; color: var(--navy-2); text-decoration: none; }
.tip-line b { color: var(--fun-ink); font-weight: 750; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--fun-line); }
[data-theme="dark"] .tip-line b { color: var(--fun-2); }
@media (hover: hover) { .tip-line a:hover b { text-decoration-color: currentColor; } }
