/* Calczora Fun: the fairground theme (Love Calculator). Loaded after fun.css, only on its pages.
   Two looks: Funfair (a butter-yellow fair day, cherry red and gold bulbs; a teal-navy night with warm lights)
   and Neon (a mint day with a black neon cabinet; a black night where the pink and cyan tubes glow). */

/* ================= colours ================= */
html[data-fun="fair"] {
  --fun: #d8343f; --fun-2: #f2626a; --fun-ink: #a51d29; --fun-soft: #ffe4dc; --fun-line: rgba(216, 52, 63, .3);
  --go-a: #c92a36; --go-b: #9c1824; --f-gold: #f5b52e; --f-teal: #138a80; --f-paper: #fffaf0;
  --tint: rgba(216, 52, 63, .07); --tint-strong: rgba(216, 52, 63, .14);
  /* the machine */
  --mc-body: linear-gradient(180deg, #e04049, #b8222e); --mc-edge: #8e1621; --mc-face: #fff7e6; --mc-screen: #2b0c0f; --mc-digit: #ffd36b;
  --mc-glass: rgba(255, 255, 255, .7); --mc-liquid: linear-gradient(180deg, #ff6b74, #d8343f); --mc-bulb-on: #ffe08a; --mc-sign: #fff3d6; --mc-sign-ink: #b8222e;
}
html[data-fun="fair"][data-fun-alt] {
  --fun: #e41b5f; --fun-2: #ff5c90; --fun-ink: #a50f43; --fun-soft: #ffe1ea; --fun-line: rgba(228, 27, 95, .3);
  --go-a: #d0185a; --go-b: #9c0d40; --f-gold: #ffc24a; --f-teal: #0fb5b8; --f-paper: #f7fffe;
  --tint: rgba(228, 27, 95, .07); --tint-strong: rgba(228, 27, 95, .14);
  --mc-body: linear-gradient(180deg, #1b222b, #0d1117); --mc-edge: #05080b; --mc-face: #10161d; --mc-screen: #06090c; --mc-digit: #ff5c90;
  --mc-glass: rgba(120, 240, 240, .1); --mc-liquid: linear-gradient(180deg, #ff7aa6, #e41b5f); --mc-bulb-on: #7ff3f0; --mc-sign: #0b0f14; --mc-sign-ink: #ff5c90;
}
html[data-fun="fair"][data-theme="dark"] { --fun-2: #ff7b82; --fun-soft: rgba(255, 123, 130, .14); --fun-line: rgba(255, 150, 150, .3); --mc-face: #1d2a36; --mc-glass: rgba(255, 255, 255, .1); --mc-sign: #2b1d12; --mc-sign-ink: #ffd36b; }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] { --fun-2: #ff6b9b; --fun-soft: rgba(255, 92, 144, .14); --fun-line: rgba(255, 120, 165, .32); --mc-face: #0a0e13; --mc-sign: #07090c; --mc-sign-ink: #ff6b9b; }

/* ================= the sky ================= */
/* Funfair: a butter-yellow fair day, a deep teal-navy night with the lights on */
[data-fun="fair"] body { background: #fbe8b0; }
[data-fun="fair"] .sky { --s1: #f4cf6a !important; --s2: #fae5a6 !important; --s3: #fffaf0 !important; }
[data-fun="fair"][data-sky="clear"] .sky { --s1: #f2c75a !important; --s2: #f8df95 !important; --s3: #fff8ea !important; }
[data-fun="fair"][data-sky="cloudy"] .sky { --s1: #dcc48a !important; --s2: #ecdcb2 !important; --s3: #faf5e8 !important; }
[data-fun="fair"][data-theme="dark"] body { background: #0c2630; }
[data-fun="fair"][data-theme="dark"] .sky { --s1: #061a24 !important; --s2: #0c2c38 !important; --s3: #15404a !important; }
[data-fun="fair"][data-theme="dark"][data-sky="clear"] .sky { --s1: #04141c !important; --s2: #09242f !important; --s3: #113641 !important; }
[data-fun="fair"][data-theme="dark"][data-sky="cloudy"] .sky { --s1: #12212a !important; --s2: #1c303a !important; --s3: #29424b !important; }
/* Neon: a mint day, a black night */
[data-fun="fair"][data-fun-alt] body { background: #c4ece9; }
[data-fun="fair"][data-fun-alt] .sky { --s1: #63c7c9 !important; --s2: #b4e6e4 !important; --s3: #f4fcfb !important; }
[data-fun="fair"][data-fun-alt][data-sky="clear"] .sky { --s1: #52bfc2 !important; --s2: #a6e1df !important; --s3: #f1fbfa !important; }
[data-fun="fair"][data-fun-alt][data-sky="cloudy"] .sky { --s1: #8fbcbd !important; --s2: #c8e0df !important; --s3: #f3f8f7 !important; }
[data-fun="fair"][data-fun-alt][data-theme="dark"] body { background: #120a10; }
[data-fun="fair"][data-fun-alt][data-theme="dark"] .sky { --s1: #070507 !important; --s2: #140a10 !important; --s3: #22101a !important; }
[data-fun="fair"][data-fun-alt][data-theme="dark"][data-sky="clear"] .sky { --s1: #040304 !important; --s2: #10070c !important; --s3: #1c0c15 !important; }
[data-fun="fair"][data-fun-alt][data-theme="dark"][data-sky="cloudy"] .sky { --s1: #110c10 !important; --s2: #1e141a !important; --s3: #2c1d26 !important; }
[data-fun="fair"] .orb { display: none; }
[data-fun="fair"] .c use { fill: #fffdf6; }
[data-fun="fair"][data-theme="dark"] .c use { fill: #17384a; }
[data-fun="fair"][data-fun-alt] .c use { fill: #f7fffe; }
[data-fun="fair"][data-fun-alt][data-theme="dark"] .c use { fill: #24141e; }
[data-fun="fair"] .stars { filter: sepia(.5) saturate(1.4); }
[data-fun="fair"][data-fun-alt] .stars { filter: hue-rotate(-60deg) saturate(1.3); }

/* ================= sky decorations ================= */
/* Funfair: a string of bulbs across the top, and a ferris wheel turning slowly in the corner */
.fun-fx .garland { position: absolute; left: 0; top: 0; width: 100%; height: 86px; overflow: visible; }
.fun-fx .garland path { fill: none; stroke: rgba(120, 70, 20, .32); stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.fun-fx .bulb { position: absolute; width: 9px; height: 11px; margin-left: -4.5px; border-radius: 50% 50% 45% 45%; background: #fff4cc;
  box-shadow: 0 0 0 1.5px rgba(150, 90, 20, .25); opacity: .85; animation: bulbGlow 3s ease-in-out var(--d) infinite; }
.fun-fx .bulb:nth-of-type(3n) { background: #ffd0c8; }
.fun-fx .bulb:nth-of-type(3n+1) { background: #c9f0ea; }
@keyframes bulbGlow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
[data-theme="dark"] .fun-fx .garland path { stroke: rgba(255, 220, 160, .22); }
[data-theme="dark"] .fun-fx .bulb { background: #ffe08a; box-shadow: 0 0 10px 2px rgba(255, 200, 90, .45); }
[data-theme="dark"] .fun-fx .bulb:nth-of-type(3n) { background: #ff9a8a; box-shadow: 0 0 10px 2px rgba(255, 120, 100, .4); }
[data-theme="dark"] .fun-fx .bulb:nth-of-type(3n+1) { background: #9ff0e4; box-shadow: 0 0 10px 2px rgba(120, 240, 220, .35); }
.fun-fx .wheel { position: absolute; right: -12vmax; bottom: -16vmax; width: 44vmax; height: 55vmax; opacity: .13; }
.fun-fx .wheel .rot { animation: spinWheel 70s linear infinite; transform-origin: 0 0; }
.fun-fx .wheel .rim { fill: #b8222e; }
.fun-fx .wheel .sp path, .fun-fx .wheel .legs { stroke: #b8222e; stroke-width: .35; fill: none; stroke-linecap: round; }
.fun-fx .wheel .car { fill: #138a80; }
.fun-fx .wheel .hub { fill: #f5b52e; }
@keyframes spinWheel { to { rotate: 360deg; } }
[data-theme="dark"] .fun-fx .wheel { opacity: .22; }
[data-theme="dark"] .fun-fx .wheel .rim, [data-theme="dark"] .fun-fx .wheel .sp path, [data-theme="dark"] .fun-fx .wheel .legs { fill: #ffd36b; stroke: #ffd36b; }
[data-theme="dark"] .fun-fx .wheel .sp path, [data-theme="dark"] .fun-fx .wheel .legs { fill: none; }
[data-theme="dark"] .fun-fx .wheel .car { fill: #ff8a7a; }
/* Neon: a big heart sign that hums, and a few sparks */
.fun-fx .sign, .fun-fx .spk { display: none; }
.fun-fx .sign { position: absolute; top: 3vmax; right: -3vmax; width: 30vmax; height: 26vmax; fill: #ff5c90; opacity: .3;
  filter: drop-shadow(0 0 6px rgba(255, 92, 144, .8)); animation: hum 7s linear infinite; }
@keyframes hum { 0%, 46%, 50%, 100% { opacity: .3; } 47%, 49% { opacity: .18; } }
[data-theme="dark"] .fun-fx .sign { opacity: .55; filter: drop-shadow(0 0 4px #ff5c90) drop-shadow(0 0 22px rgba(255, 60, 130, .7)); animation-name: humNight; }
@keyframes humNight { 0%, 46%, 50%, 100% { opacity: .55; } 47%, 49% { opacity: .3; } }
.fun-fx .spk { position: absolute; width: 9px; height: 9px; background: #fff; opacity: 0;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: sparkle 4.5s ease-in-out var(--d) infinite; }
@keyframes sparkle { 0%, 100% { opacity: 0; scale: .4; } 50% { opacity: .85; scale: 1; } }
[data-theme="dark"] .fun-fx .spk { background: #7ff3f0; }
[data-fun-alt] .fun-fx .sign, [data-fun-alt] .fun-fx .spk { display: block; }
[data-fun-alt] .fun-fx .garland, [data-fun-alt] .fun-fx .bulb, [data-fun-alt] .fun-fx .wheel { display: none; }
@media (prefers-reduced-motion: reduce) { .fun-fx .bulb, .fun-fx .wheel .rot, .fun-fx .sign, .fun-fx .spk { animation: none; } .fun-fx .spk { display: none !important; } }

/* ================= the logo: a bulb burst (or a neon heart) for the "o" ================= */
html[data-fun="fair"] { --lo-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Cpath d='M0-9.5L2.2-5.3 6.7-6.7 5.3-2.2 9.5 0 5.3 2.2 6.7 6.7 2.2 5.3 0 9.5-2.2 5.3-6.7 6.7-5.3 2.2-9.5 0-5.3-2.2-6.7-6.7-2.2-5.3z'/%3E%3C/svg%3E"); }
html[data-fun="fair"][data-fun-alt] { --lo-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -9 20 16'%3E%3Cpath fill-rule='evenodd' 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 6zM0 2.5C-3 .25-4.5-1.5-4.5-3.25A2.25 2.25 0 0 1 0-4.5a2.25 2.25 0 0 1 4.5 1.25C4.5-1.5 3 .25 0 2.5z'/%3E%3C/svg%3E"); }
html[data-fun="fair"] .tw .lo { width: .62em; height: .62em; vertical-align: -.04em; }
html[data-fun="fair"]:not([data-theme="dark"]) .hd .tw b { color: var(--fun-ink); }
html[data-fun="fair"]:not([data-theme="dark"]) .tw .lo { background: var(--fun-ink); }
html[data-fun="fair"][data-theme="dark"] .hd .tw b, html[data-fun="fair"][data-theme="dark"] .tw .lo { color: var(--f-gold); }
html[data-fun="fair"][data-theme="dark"] .tw .lo { background: var(--f-gold); }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] .hd .tw b { color: var(--fun-2); }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] .tw .lo { background: var(--fun-2); filter: drop-shadow(0 0 4px rgba(255, 92, 144, .8)); }

/* ================= the love theme's pinks, swapped for this theme's colours ================= */
html[data-fun="fair"] .cf-in:focus-within, html[data-fun="fair"] .fun-name:focus { border-color: var(--fun); box-shadow: 0 0 0 3px var(--fun-line); }
html[data-fun="fair"] .btn.fun-go { box-shadow: 0 12px 22px -14px rgba(120, 10, 20, .75), inset 0 1px 0 rgba(255, 255, 255, .3); }
html[data-fun="fair"][data-theme="dark"] .eyebrow { color: var(--f-gold); }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] .eyebrow { color: var(--fun-2); }
@media (hover: hover) { html[data-fun="fair"] .btn.soft:hover { color: var(--fun-ink); background: color-mix(in srgb, var(--fun-soft) 60%, var(--fun-2)); } }
html[data-fun="fair"][data-theme="dark"] .btn.soft { color: #ffe2a8; background: rgba(255, 211, 107, .12); box-shadow: inset 0 0 0 1px rgba(255, 211, 107, .26); }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] .btn.soft { color: #ffc2d6; background: rgba(255, 92, 144, .12); box-shadow: inset 0 0 0 1px rgba(255, 92, 144, .28); }
@media (hover: hover) { html[data-fun="fair"][data-theme="dark"] .btn.soft:hover { color: #fff; background: rgba(255, 255, 255, .14); } }
html[data-fun="fair"][data-theme="dark"] .fun-block .fb-head p { color: #d6e3e6; }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] .fun-block .fb-head p { color: #ecd8e0; }
html[data-fun="fair"] .tip-line b { color: var(--fun-ink); }
html[data-fun="fair"][data-theme="dark"] .tip-line b { color: var(--f-gold); }

/* ================= night cards: teal-navy (Funfair) and black (Neon) ================= */
html[data-fun="fair"][data-theme="dark"] {
  --frost: rgba(14, 40, 52, .88); --quiet: rgba(14, 40, 52, .8); --glass: rgba(14, 40, 52, .88);
  --hero-a: rgba(26, 62, 76, .86); --hero-b: rgba(12, 34, 44, .82);
  --field: rgba(4, 18, 24, .9); --solid: rgba(4, 18, 24, .86); --grade: #1f4250;
  --tint: rgba(255, 211, 107, .09); --tint-strong: rgba(255, 211, 107, .17);
  --edge: rgba(200, 240, 240, .16); --hairline: rgba(210, 240, 240, .11); --field-line: rgba(200, 235, 235, .3); --f-paper: #102a35;
}
html[data-fun="fair"][data-fun-alt][data-theme="dark"] {
  --frost: rgba(26, 16, 22, .9); --quiet: rgba(26, 16, 22, .82); --glass: rgba(26, 16, 22, .9);
  --hero-a: rgba(44, 26, 36, .86); --hero-b: rgba(22, 12, 18, .82);
  --field: rgba(8, 4, 7, .9); --solid: rgba(8, 4, 7, .86); --grade: #3a2030;
  --tint: rgba(255, 92, 144, .09); --tint-strong: rgba(255, 92, 144, .17);
  --edge: rgba(255, 190, 215, .16); --hairline: rgba(255, 215, 230, .11); --field-line: rgba(255, 190, 215, .3); --f-paper: #1d1219;
}
html[data-fun="fair"][data-theme="dark"] .tool > .result::after { background: radial-gradient(70% 46% at 50% 30%, rgba(255, 211, 107, .12), rgba(255, 211, 107, 0) 70%); }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] .tool > .result::after { background: radial-gradient(70% 46% at 50% 30%, rgba(255, 92, 144, .16), rgba(255, 92, 144, 0) 70%); }

/* ================= the buddy as the showman: a straw boater and a heart lollipop ================= */
.fair-mascot .bt-brim, .fair-mascot .bt-crown { fill: #f6d98f; stroke: #b5852c; }
.fair-mascot .bt-band { fill: #d8343f; }
.fair-mascot .bt-weave { stroke: #d9b160; }
.fair-mascot .bt-top { stroke: #fff0c4; }
.fair-mascot .bt-heart { fill: #fff3d6; }
.fair-mascot .pop-h { fill: #ff5a66; stroke: #b8222e; }
.fair-mascot .pop-hl { stroke: #ffd0d4; }
[data-fun-alt] .fair-mascot .bt-band { fill: #e41b5f; }
[data-fun-alt] .fair-mascot .bt-heart { fill: #7ff3f0; }
[data-fun-alt] .fair-mascot .pop-h { fill: #ff5c90; stroke: #a50f43; }
.fair-mascot .f-heart path { fill: #d8343f; }
[data-fun-alt] .fair-mascot .f-heart path { fill: #e41b5f; }
.fair-mascot .pop { transform-box: fill-box; transform-origin: 30% 100%; animation: popWave 3.2s ease-in-out infinite; }
@keyframes popWave { 0%, 100% { rotate: 0deg; } 50% { rotate: -6deg; } }
@media (prefers-reduced-motion: reduce) { .fair-mascot .pop { animation: none; } }

/* ================= the names card: a fair ticket ================= */
.ticket { position: relative; overflow: hidden; padding-top: 0 !important; background: var(--f-paper);
  background-image: repeating-linear-gradient(135deg, rgba(216, 52, 63, .025) 0 2px, transparent 2px 9px); }
.ticket::before { content: ""; position: absolute; inset: 52px 10px 10px; border: 1.5px dashed var(--fun-line); border-radius: 14px; pointer-events: none; }
.tk-band { display: flex; align-items: center; gap: 10px; margin: 0 -18px 14px; padding: 12px 18px; background: var(--fun); color: #fff3e0;
  font: 800 12.5px/1 "Figtree", system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(0, 0, 0, .06)); }
.tk-band span:first-child::before { content: "★ "; color: var(--f-gold); }
.tk-dots { flex: 1; height: 2px; background: radial-gradient(circle, rgba(255, 243, 224, .7) 1px, transparent 1.4px) 0 50% / 7px 2px repeat-x; }
#tkNo { font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.ticket h2 { padding: 0 12px; font: 800 22px/1.2 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; color: var(--navy); }
.ticket .fun-names, .ticket .cf-note, .ticket .fun-note { padding: 0 12px; }
.ticket .fun-go { width: calc(100% - 24px); margin-left: 12px; margin-right: 12px; }
.ticket .fun-names .plus svg { fill: var(--fun); }
.tk-tear { height: 14px; margin: 14px -18px -18px; background: radial-gradient(circle at 50% 0, var(--sky-tear, rgba(216, 52, 63, .14)) 4px, transparent 4.5px) 0 0 / 16px 14px repeat-x;
  border-top: 1.5px dashed var(--fun-line); }
[data-theme="dark"] .ticket { background-image: repeating-linear-gradient(135deg, rgba(255, 211, 107, .03) 0 2px, transparent 2px 9px); }
[data-theme="dark"] .ticket h2 { color: #fff; }
[data-fun-alt] .tk-band { background: #10161d; color: #ff8fb2; text-shadow: 0 0 8px rgba(255, 92, 144, .6); }
[data-fun-alt] .tk-band span:first-child::before { color: #7ff3f0; }
[data-fun-alt] .tk-dots { background-image: radial-gradient(circle, rgba(127, 243, 240, .8) 1px, transparent 1.4px); }
@media (min-width: 521px) { .tk-band, .tk-tear { margin-left: -24px; margin-right: -24px; } .tk-tear { margin-bottom: -24px; } }

/* ================= the stage: a love-tester machine ================= */
.lt-stage { padding-top: 18px !important; }
.lt-stage .eyebrow { margin-bottom: 30px; }
.machine { --tube-h: 156px; position: relative; width: 100%; max-width: 440px; margin: 0 auto; padding: 0 12px 14px; border-radius: 26px 26px 20px 20px;
  background: var(--mc-body); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -3px 0 rgba(0, 0, 0, .18), 0 0 0 2px var(--mc-edge), 0 18px 30px -18px rgba(80, 10, 20, .7); }
/* the sign on top, ringed with chasing bulbs */
.mc-sign { position: relative; display: grid; place-items: center; height: 54px; margin: -22px 26px 12px; border-radius: 16px; background: var(--mc-sign);
  box-shadow: 0 0 0 3px var(--f-gold), 0 0 0 5px var(--mc-edge), 0 8px 14px -8px rgba(0, 0, 0, .5); }
.mc-word { font: 800 21px/1 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; letter-spacing: .02em; text-transform: uppercase; color: var(--mc-sign-ink); font-stretch: 80%; }
.mc-bulbs, .mc-bulbs::after { position: absolute; inset: 5px 8px; border-radius: 12px; pointer-events: none;
  background: radial-gradient(circle, var(--mc-bulb-on) 0 2.2px, transparent 2.8px) 0 0 / 14px 100% repeat-x, radial-gradient(circle, var(--mc-bulb-on) 0 2.2px, transparent 2.8px) 0 100% / 14px 100% repeat-x;
  background-size: 14px 6px, 14px 6px; background-position: 0 0, 0 100%; background-repeat: repeat-x; }
.mc-bulbs { opacity: .95; }
.mc-bulbs::after { content: ""; inset: 0; background-position: 7px 0, 7px 100%; opacity: .25; }
.playing .mc-bulbs, .landed .mc-bulbs { animation: chaseA .5s steps(1) infinite; }
.playing .mc-bulbs::after, .landed .mc-bulbs::after { animation: chaseB .5s steps(1) infinite; }
@keyframes chaseA { 50% { opacity: .25; } }
@keyframes chaseB { 50% { opacity: .95; } }
/* the buddy leans on the sign */
.machine .result-mascot.fun-mascot { position: absolute !important; top: -58px; right: -16px; width: 104px !important; height: 72px !important; z-index: 2; }
/* the face of the machine: the score screen, the reading and the two tubes */
.mc-face { padding: 12px 10px 10px; border-radius: 16px; background: var(--mc-face); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .08); }
.mc-display { display: grid; place-items: center; width: min(220px, 100%); margin: 0 auto; padding: 6px 14px 4px; border-radius: 12px; background: var(--mc-screen);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, .6), 0 0 0 3px rgba(0, 0, 0, .1); }
.lt-stage .mc-display .big { margin: 0; font: 800 54px/1.05 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; letter-spacing: -.02em; color: var(--mc-digit);
  font-variant-numeric: tabular-nums; text-shadow: 0 0 14px color-mix(in srgb, var(--mc-digit) 55%, transparent); }
.lt-stage .res-sub { margin-top: 8px; font: 800 18px/1.2 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; color: var(--fun-ink); }
.mc-tubes { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: start; gap: 6px; margin-top: 10px; }
.tube { display: flex; flex-direction: column; align-items: center; }
.tb-pct { order: -1; height: 22px; font: 800 16px/22px var(--display, "Bricolage Grotesque"), system-ui, sans-serif; color: var(--navy); font-variant-numeric: tabular-nums; }
.tube.more .tb-pct::after { content: " ♥"; color: var(--fun); }
.tb-glass { position: relative; width: 26px; height: var(--tube-h); border-radius: 13px 13px 0 0; background: var(--mc-glass); overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .14), inset 3px 0 6px rgba(0, 0, 0, .06); }
.tb-fill { position: absolute; left: 4px; right: 4px; bottom: -4px; height: calc(var(--p, 0) * 1% + 4px); border-radius: 9px 9px 0 0; background: var(--mc-liquid);
  transition: height 1.05s cubic-bezier(.3, 1.25, .45, 1); }
.machine.instant .tb-fill { transition: none; }
.tb-shine { position: absolute; left: 6px; top: 8px; bottom: 8px; width: 4px; border-radius: 3px; background: rgba(255, 255, 255, .55); }
.tb-bulb { width: 40px; height: 40px; margin-top: -6px; border-radius: 50%; background: radial-gradient(circle at 36% 32%, rgba(255, 255, 255, .7) 0 4px, transparent 5px), var(--mc-liquid);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .14), 0 4px 8px -4px rgba(0, 0, 0, .4); }
.tb-who { max-width: 76px; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 750 13px/1.2 "Figtree", system-ui, sans-serif; color: var(--navy-2); }
/* the readings, each at the middle of its band, lined up with the tubes */
.mc-scale { position: relative; height: var(--tube-h); margin: 22px 0 0; padding: 0; list-style: none; }
.mc-scale::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1.5px dotted rgba(0, 0, 0, .14); }
.mc-scale li { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 5px; translate: 0 50%;
  font: 700 11.5px/1 "Figtree", system-ui, sans-serif; color: color-mix(in srgb, var(--navy-2) 75%, transparent); white-space: nowrap; transition: color .2s; }
.mc-scale li span { padding: 2px 6px; border-radius: 99px; background: var(--mc-face); }
/* evenly spaced, so every reading has room (the tubes show the exact number) */
.mc-scale li[data-at="90"] { bottom: 91%; } .mc-scale li[data-at="80"] { bottom: 75%; } .mc-scale li[data-at="65"] { bottom: 59%; }
.mc-scale li[data-at="50"] { bottom: 43%; } .mc-scale li[data-at="30"] { bottom: 27%; } .mc-scale li[data-at="0"] { bottom: 11%; }
.mc-scale i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: rgba(0, 0, 0, .14); transition: background-color .2s, box-shadow .2s; }
.mc-scale li.lit i { background: var(--f-gold); box-shadow: 0 0 6px 1px color-mix(in srgb, var(--f-gold) 70%, transparent); }
.mc-scale li.on { color: #fff; }
.mc-scale li { padding: 0 2px; }
.mc-scale li.on { z-index: 1; }
.mc-scale li.on::before { content: ""; position: absolute; inset: -4px 0; z-index: -1; border-radius: 99px; background: var(--go-b); background-image: linear-gradient(180deg, var(--go-a), var(--go-b)); }
.mc-scale li.on i { background: #fff; box-shadow: 0 0 6px 1px rgba(255, 255, 255, .8); }
.lt-stage .fine { margin-top: 12px; }
.lt-stage .bonus { margin-top: 10px; }

/* Neon: the cabinet is black and the tubes and words glow */
[data-fun-alt] .machine { box-shadow: inset 0 0 0 1.5px rgba(127, 243, 240, .35), 0 0 0 2px #05080b, 0 0 24px -6px rgba(255, 92, 144, .45), 0 18px 30px -18px rgba(0, 0, 0, .8); }
[data-fun-alt] .mc-sign { box-shadow: 0 0 0 2px #ff5c90, 0 0 14px rgba(255, 92, 144, .6), 0 0 0 5px #05080b; }
[data-fun-alt] .mc-word { color: #ffd6e4; text-shadow: 0 0 4px #ff5c90, 0 0 12px rgba(255, 60, 130, .9), 0 0 24px rgba(255, 60, 130, .5); }
[data-fun-alt] .mc-face { box-shadow: inset 0 0 0 1.5px rgba(127, 243, 240, .18); }
[data-fun-alt] .tb-glass { box-shadow: inset 0 0 0 1.5px rgba(127, 243, 240, .6), 0 0 10px rgba(127, 243, 240, .25); }
[data-fun-alt] .tb-fill, [data-fun-alt] .tb-bulb { box-shadow: 0 0 14px rgba(255, 92, 144, .7); }
[data-fun-alt] .tb-pct { color: #ffd6e4; text-shadow: 0 0 8px rgba(255, 92, 144, .7); }
[data-fun-alt] .tb-who { color: #a8f5f2; }
[data-fun-alt] .lt-stage .res-sub { color: #fff; text-shadow: 0 0 10px rgba(255, 92, 144, .8); }
[data-fun-alt] .lt-stage .res-sub { color: var(--fun-ink); text-shadow: none; }
[data-fun-alt] .mc-face .res-sub, [data-fun-alt] .lt-stage .mc-face .res-sub { color: #ffd6e4; text-shadow: 0 0 10px rgba(255, 92, 144, .8); }
[data-fun-alt] .mc-scale li { color: rgba(220, 240, 245, .55); }
[data-fun-alt] .mc-scale::before { border-color: rgba(127, 243, 240, .2); }
[data-fun-alt] .mc-scale i { background: rgba(255, 255, 255, .14); }
[data-fun-alt] .mc-scale li.lit i { background: #7ff3f0; box-shadow: 0 0 8px 2px rgba(127, 243, 240, .7); }
[data-fun-alt] .mc-scale li.on { color: #fff; }
[data-fun-alt] .mc-scale li.on::before { background: none; box-shadow: inset 0 0 0 1.5px #ff5c90, 0 0 12px rgba(255, 92, 144, .6); }
[data-fun-alt] .mc-scale li.on { text-shadow: 0 0 8px #ff5c90; }
/* night: the Funfair face goes dark and its numbers glow */
[data-theme="dark"]:not([data-fun-alt]) .tb-pct { color: #ffe9b8; }
[data-theme="dark"]:not([data-fun-alt]) .lt-stage .res-sub { color: #ffd36b; }
[data-theme="dark"]:not([data-fun-alt]) .tb-who { color: #cfe3e6; }
[data-theme="dark"]:not([data-fun-alt]) .mc-scale li { color: rgba(220, 235, 240, .6); }
[data-theme="dark"] .mc-scale::before { border-color: rgba(255, 255, 255, .14); }
[data-theme="dark"] .mc-scale i { background: rgba(255, 255, 255, .16); }
[data-theme="dark"]:not([data-fun-alt]) .mc-face { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .08); }

/* ================= the working, printed on a ticket tape ================= */
.tape { position: relative; width: 100%; max-width: 440px; margin: 16px auto 0; padding: 12px 12px 14px; border-radius: 4px 4px 14px 14px; background: var(--f-paper); text-align: center;
  box-shadow: 0 0 0 1px var(--fun-line), 0 10px 20px -16px rgba(80, 20, 10, .5); }
/* torn top edge, as if it came out of the machine */
.tape::before { content: ""; position: absolute; left: 0; right: 0; top: -7px; height: 8px;
  background: linear-gradient(135deg, var(--f-paper) 50%, transparent 50%) 0 0 / 10px 8px repeat-x, linear-gradient(-135deg, var(--f-paper) 50%, transparent 50%) 0 0 / 10px 8px repeat-x; }
.tp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tp-title { margin: 0; font: 800 12px/1 "Figtree", system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--fun-ink); }
.tp-tabs { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--tint-strong); }
.tp-tabs button { min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font: 700 12.5px/1 "Figtree", system-ui, sans-serif; color: var(--navy-2); cursor: pointer; white-space: nowrap; }
.tp-tabs button[aria-pressed="true"] { background: #fff; color: var(--fun-ink); box-shadow: 0 2px 6px -2px rgba(80, 10, 20, .35); }
.tp-sent { margin: 12px 0 4px; font: 800 15px/1.4 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; letter-spacing: .06em; color: color-mix(in srgb, var(--navy) 45%, transparent); word-break: break-word; }
.tp-sent span { transition: color .15s, background-color .15s; border-radius: 3px; }
.tp-sent .done { color: var(--navy); }
.tp-sent .on { color: #fff; background: var(--fun); box-shadow: 0 0 0 2px var(--fun); }
.tp-rows { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.tp-row { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; animation: rowIn .28s cubic-bezier(.2, .9, .3, 1.2) both; }
.tp-count { padding-top: 2px; }
.tp-row > span:not(.tp-arrow) { display: grid; place-items: center; min-width: 21px; height: 25px; padding: 0 2px; border-radius: 6px; background: var(--tint-strong);
  font: 800 15px/1 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; color: var(--navy); font-variant-numeric: tabular-nums; }
.tp-count > span { height: auto !important; padding: 3px 3px 4px !important; gap: 1px; }
.tp-count i { font: 700 10px/1 "Figtree", system-ui, sans-serif; font-style: normal; color: var(--fun-ink); text-transform: uppercase; }
.tp-count .wait { opacity: .12; }
.tp-arrow { position: absolute; left: -16px; top: 50%; translate: 0 -50%; font-size: 12px; color: var(--fun-ink); opacity: .6; }
.tp-final > span:not(.tp-arrow) { color: #fff; background-color: var(--go-b); background-image: linear-gradient(180deg, var(--go-a), var(--go-b)); }
.tp-eq { align-self: center; margin-left: 6px; font: 800 15px/1 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; color: var(--fun-ink); }
@keyframes rowIn { from { opacity: 0; translate: 0 -6px; } }
.machine.instant ~ .tape .tp-row { animation: none; }
[data-theme="dark"] .tape { box-shadow: 0 0 0 1px var(--fun-line); }
[data-theme="dark"] .tp-title, [data-theme="dark"] .tp-eq, [data-theme="dark"] .tp-count i, [data-theme="dark"] .tp-arrow { color: var(--f-gold); }
[data-theme="dark"][data-fun-alt] .tp-title, [data-theme="dark"][data-fun-alt] .tp-eq, [data-theme="dark"][data-fun-alt] .tp-count i, [data-theme="dark"][data-fun-alt] .tp-arrow { color: var(--fun-2); }
[data-theme="dark"] .tp-sent { color: rgba(255, 255, 255, .35); }
[data-theme="dark"] .tp-sent .done, [data-theme="dark"] .tp-row > span:not(.tp-arrow) { color: #fff; }
[data-theme="dark"] .tp-tabs button { color: #d6e3e6; }
[data-theme="dark"] .tp-tabs button[aria-pressed="true"] { background: rgba(255, 255, 255, .92); color: #10161d; }
@media (prefers-reduced-motion: reduce) { .tp-row { animation: none; } .tb-fill { transition: none; } .playing .mc-bulbs, .landed .mc-bulbs, .playing .mc-bulbs::after, .landed .mc-bulbs::after { animation: none; } }
[data-look="pro"] .tp-row { animation: none; }

/* ================= below the game: famous pairs ================= */
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.pair-b { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; width: 100%; min-height: 108px; padding: 14px 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(80, 20, 10, .55); text-align: left; cursor: pointer; color: var(--navy); transition: translate .2s, box-shadow .2s; }
.pr-n { font: 750 16px/1.25 "Figtree", system-ui, sans-serif; }
.pr-n i { font-style: normal; color: var(--fun); }
.pr-m { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pr-m b { font: 800 26px/1 var(--display, "Bricolage Grotesque"), system-ui, sans-serif; color: var(--fun-ink); }
.pr-m small { font: 700 12px/1.1 "Figtree", system-ui, sans-serif; color: var(--navy-2); text-align: right; }
.pr-bars { grid-column: 1 / -1; display: grid; gap: 5px; }
.pr-bars > span { position: relative; display: block; height: 18px; border-radius: 99px; background: var(--tint-strong); overflow: hidden; }
.pr-bars i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 1%); border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--fun-2) 40%, transparent), color-mix(in srgb, var(--fun-2) 62%, transparent)); }
.pr-bars em { position: relative; padding-left: 9px; font: 700 11.5px/18px "Figtree", system-ui, sans-serif; font-style: normal; color: var(--navy); white-space: nowrap; }
[data-theme="dark"] .pr-bars em { color: #fff; }
@media (hover: hover) { .pair-b:hover { translate: 0 -3px; box-shadow: inset 0 0 0 1.5px var(--fun), 0 16px 28px -18px rgba(80, 20, 10, .65); } }
.pair-b:active { translate: 0 1px; }
[data-theme="dark"] .pair-b { color: #fff; }
[data-theme="dark"] .pr-m b { color: var(--f-gold); }
[data-theme="dark"][data-fun-alt] .pr-m b { color: var(--fun-2); }
[data-theme="dark"] .pr-m small { color: #cfdde2; }

/* ================= desktop: the ticket on the left, the machine on the right ================= */
@media (min-width: 960px) {
  html[data-fun="fair"] .tool.calc-tool { grid-template-columns: minmax(0, .9fr) minmax(440px, 1.1fr); }
  /* the machine is taller than the ticket, so the ticket stays in view beside it */
  .ticket { position: sticky !important; top: 86px; }
  .machine { --tube-h: 176px; }
}
@media (max-width: 520px) {
  .lt-stage .eyebrow { margin-bottom: 26px; }
  .machine { --tube-h: 136px; }
  .mc-face { padding: 10px 8px 8px; }
  .lt-stage .mc-display .big { font-size: 46px; }
  .lt-stage .res-sub { margin-top: 6px; font-size: 17px; }
  .tb-bulb { width: 34px; height: 34px; }
  .tape { margin-top: 14px; padding: 10px 10px 12px; }
  .tp-sent { margin: 8px 0 2px; font-size: 14px; }
}
@media (max-width: 400px) {
  .machine { padding: 0 8px 12px; }
  .mc-sign { margin-left: 18px; margin-right: 34px; }
  .mc-word { font-size: 18px; }
  .mc-tubes { grid-template-columns: 54px minmax(0, 1fr) 54px; gap: 4px; }
  .mc-scale li { font-size: 11px; }
  .lt-stage .mc-display .big { font-size: 48px; }
}

/* ================= Pro: calm and flat, no glow ================= */
[data-look="pro"][data-fun="fair"] body { background: #fdf8ea; }
[data-look="pro"][data-fun="fair"] .sky { background: linear-gradient(180deg, #faefcf 0, #fdf8ea 300px) !important; }
[data-look="pro"][data-fun="fair"][data-theme="dark"] body { background: #0b1e26; }
[data-look="pro"][data-fun="fair"][data-theme="dark"] .sky { background: linear-gradient(180deg, #12303b 0, #0b1e26 300px) !important; }

/* ================= footer and header pop-ups follow the theme ================= */
html[data-fun="fair"] .sitefoot { background: linear-gradient(180deg, #fff3d2, #fbe3a0); }
html[data-fun="fair"][data-fun-alt] .sitefoot { background: linear-gradient(180deg, #e8faf8, #c4ece9); }
html[data-fun="fair"][data-theme="dark"] .sitefoot { background: linear-gradient(180deg, #123542, #0a222b); color: #d6e3e6; }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] .sitefoot { background: linear-gradient(180deg, #1e121a, #0e080c); color: #ecd8e0; }
html[data-fun="fair"][data-theme="dark"] .sitefoot li a, html[data-fun="fair"][data-theme="dark"] .sitefoot p { color: #d6e3e6; }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] .sitefoot li a, html[data-fun="fair"][data-fun-alt][data-theme="dark"] .sitefoot p { color: #ecd8e0; }
html[data-fun="fair"][data-theme="dark"] .sitefoot .base { border-color: rgba(220, 240, 240, .12); }
html[data-fun="fair"] { --pop: #fffaf0; --pop-seg: #fbeccb; --pop-on: #fff; --pop-ink: #2a1a10; --pop-soft: #6e5038; --pop-ring: rgba(216, 52, 63, .26); }
html[data-fun="fair"][data-fun-alt] { --pop: #f6fdfc; --pop-seg: #dcf3f1; --pop-on: #fff; --pop-ink: #10212a; --pop-soft: #4a6670; --pop-ring: rgba(228, 27, 95, .26); }
html[data-fun="fair"][data-theme="dark"] { --pop: #133140; --pop-seg: rgba(255, 211, 107, .1); --pop-on: rgba(255, 255, 255, .94); --pop-ink: #eef6f7; --pop-soft: #b9ccd2; }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] { --pop: #1c1218; --pop-seg: rgba(255, 92, 144, .1); --pop-on: rgba(255, 255, 255, .94); --pop-ink: #f6eaf0; --pop-soft: #cdb6c2; }
html[data-fun="fair"] .hd-pop { box-shadow: 0 30px 60px -26px rgba(60, 30, 10, .5), 0 0 0 1px var(--fun-line); }
html[data-fun="fair"][data-theme="dark"] .mega-cat small { background: rgba(255, 255, 255, .12); color: #fff; }
html[data-fun="fair"][data-theme="dark"] .hd-btn[aria-expanded="true"] { background: rgba(255, 211, 107, .2); }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] .hd-btn[aria-expanded="true"] { background: rgba(255, 92, 144, .2); }
@media (hover: hover) { html[data-fun="fair"][data-theme="dark"] .hd-btn:hover { background: rgba(255, 211, 107, .14); } html[data-fun="fair"][data-fun-alt][data-theme="dark"] .hd-btn:hover { background: rgba(255, 92, 144, .14); } }
html[data-fun="fair"][data-theme="dark"] .hd-seg button[aria-pressed="true"] { color: #10161d; }

/* the hero's coloured word: cherry by day, gold at night; Neon: hot pink, glowing at night */
html[data-fun="fair"]:not([data-theme="dark"]) .hero h1 em { color: var(--fun-ink); text-shadow: 0 2px 12px rgba(255, 255, 255, .6); }
html[data-fun="fair"][data-theme="dark"] .hero h1 em { color: var(--f-gold); }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] .hero h1 em { color: #ffd6e4; text-shadow: 0 0 6px #ff5c90, 0 0 22px rgba(255, 60, 130, .7); }
html[data-fun="fair"] .under path { stroke: var(--f-teal); }
html[data-fun="fair"][data-fun-alt] .under path { stroke: var(--f-gold); }
html[data-fun="fair"][data-theme="dark"] .under path { stroke: var(--fun-2); }
html[data-fun="fair"][data-fun-alt][data-theme="dark"] .under path { stroke: #7ff3f0; }

/* the readings table holds words, not numbers: line them up on the left */
.readings th, .readings td { text-align: left !important; }
.readings td:nth-child(2) { font-weight: 750; color: var(--fun-ink); }
[data-theme="dark"] .readings td:nth-child(2) { color: var(--f-gold); }
[data-theme="dark"][data-fun-alt] .readings td:nth-child(2) { color: var(--fun-2); }
