/* Dark theme: one slate ramp, one accent.
   ground #0F151D, surface #19212C, raised #243040, line #2B3747,
   ink #EAF0F7, muted #9AA8B9, accent #1F7AE0 (fill) / #62AEFF (text), hero #172B42 */
/* small answer feedback (individual transforms keep the cards' own tilt) */
@keyframes qz-pop { 0% { scale: 0.975; } 55% { scale: 1.018; } 100% { scale: 1; } }
@keyframes qz-shake { 0%, 100% { translate: 0; } 25% { translate: -4px; } 55% { translate: 3px; } 80% { translate: -1.5px; } }
@keyframes qz-mark { 0% { scale: 0.4; } 65% { scale: 1.15; } 100% { scale: 1; } }
@keyframes qz-in-a { from { opacity: 0; translate: 14px 0; } }
@keyframes qz-in-b { from { opacity: 0; translate: 14px 0; } }
@keyframes qz-fade { from { opacity: 0; } }
@keyframes qz-sheet { from { translate: 0 60%; opacity: 0.4; } }
@keyframes qz-up { from { opacity: 0; translate: 0 8px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

li:last-child, [data-theme] ol li:last-child:last-child { border-bottom-color: transparent !important; }
[data-theme="dark"] { color-scheme: dark; }
[data-theme="dark"] ::placeholder { color: #8292A5; opacity: 1; }

[data-theme="dark"] [data-topo] img { content: url(girih-dark.svg); }

/* grounds and surfaces */
[data-theme="dark"] [style*="background: rgb(237, 245, 253)"] { background: #243040 !important; }
[data-theme="dark"] [style*="background: rgb(237, 245, 253)"][data-root] { background: #0F151D !important; }
[data-theme="dark"] [style*="background: rgb(255, 255, 255)"]:not([style*="width: 24px"]) { background: #19212C !important; }
[data-theme="dark"] :is([style*="background: rgb(225, 240, 255)"], [style*="background: rgb(214, 233, 252)"], [style*="background: rgb(213, 223, 234)"]) { background: #243040 !important; }
[data-theme="dark"] :is([style*="background: rgb(191, 223, 253)"], [style*="background: rgb(169, 214, 255)"]) { background: #24496F !important; }
[data-theme="dark"] [style*="background: rgb(140, 203, 255)"] { background: #1E3A58 !important; }
[data-theme="dark"] [style*="background: rgb(124, 196, 255)"] { background: #1F4F80 !important; }
[data-theme="dark"] [style*="background: rgb(253, 228, 228)"] { background: #3A2228 !important; }
[data-theme="dark"] [style*="background: rgb(126, 147, 171)"] { background: #465568 !important; }

/* accent and answer fills */
[data-theme="dark"] :is([style*="background: rgb(0, 112, 224)"], [style*="background: rgb(12, 135, 245)"]) { background: #1F7AE0 !important; }
[data-theme="dark"] [style*="background: rgb(22, 163, 74)"] { background: #1C8F49 !important; }
[data-theme="dark"] [style*="background: rgb(196, 35, 44)"] { background: #C23A43 !important; }

/* text */
[data-theme="dark"] [style*="color: rgb(11, 31, 56)"] { color: #EAF0F7 !important; }
[data-theme="dark"] [style*="color: rgb(81, 101, 125)"] { color: #9AA8B9 !important; }
[data-theme="dark"] :is([style*="color: rgb(0, 98, 199)"], [style*="color: rgb(0, 82, 159)"]) { color: #62AEFF !important; }
[data-theme="dark"] [style*="color: rgb(143, 184, 224)"] { color: #5A6B80 !important; }
[data-theme="dark"] :is([style*="color: rgb(21, 128, 61)"], [style*="color: rgb(22, 163, 74)"]) { color: #5BD08A !important; }
[data-theme="dark"] :is([style*="color: rgb(196, 35, 44)"], [style*="color: rgb(176, 30, 38)"], [style*="color: rgb(165, 27, 35)"], [style*="color: rgb(138, 20, 27)"]) { color: #FF9A9A !important; }

/* ink-filled blocks */
[data-theme="dark"] [style*="background: rgb(11, 31, 56)"] { background: #24496F !important; color: #EAF0F7 !important; }

/* lines, fields, icons */
[data-theme="dark"] [style*="rgb(220, 232, 244)"] { border-color: #2B3747 !important; }
[data-theme="dark"] [style*="rgb(201, 223, 245)"] { border-color: #34455A !important; background: #121A24 !important; }
[data-theme="dark"] [style*="rgb(111, 175, 239)"] { border-color: #3D5B7C !important; }
[data-theme="dark"] svg:is([stroke="#0062C7"], [stroke="#0070E0"]) { stroke: #62AEFF; }
[data-theme="dark"] nav a[style*="color: rgb(0, 112, 224)"] { color: #62AEFF !important; }
[data-theme="dark"] nav svg [fill="#0070E0"] { fill: #62AEFF; }
[data-theme="dark"] nav svg [stroke="#FFFFFF"] { stroke: #19212C; }
[data-theme="dark"] nav svg[stroke="#51657D"], [data-theme="dark"] nav svg [stroke="#51657D"] { stroke: #9AA8B9; }
[data-theme="dark"] [style*="0px 0px 0px 5px"] { box-shadow: 0 0 0 5px #19212C !important; }

/* blue fields with the pattern: a calm deep blue, accent for what is on them */
[data-theme="dark"] :has(> img[src^="pattern"]) { background: #172B42 !important; }
[data-theme="dark"] :has(> img[src^="pattern"]) [style*="0px 0px 0px 9px"], [data-theme="dark"] :has(> img[src^="pattern"]) [style*="0px 0px 0px 7px"] { background: #1F7AE0 !important; box-shadow: 0 0 0 9px #172B42 !important; }
[data-theme="dark"] :has(> img[src^="pattern"]) [style*="0px 0px 0px 9px"] *, [data-theme="dark"] :has(> img[src^="pattern"]) [style*="0px 0px 0px 7px"] * { color: #FFFFFF !important; stroke: #FFFFFF; }
[data-theme="dark"] :has(> img[src^="pattern"]) > div > [style*="background: rgb(0, 98, 199)"],
[data-theme="dark"] :has(> img[src^="pattern"]) > div > [style*="background: rgb(0, 98, 199)"] { background: #24405F !important; }
[data-theme="dark"] :has(> img[src^="pattern"]) :is([style*="background: rgb(10, 99, 189)"]) { background: #0F1E2F !important; }
[data-theme="dark"] :has(> img[src^="pattern"]) :is(a, button)[style*="background: rgb(255, 255, 255)"],
[data-theme="dark"] :has(> img[src^="pattern"]) li > span[style*="background: rgb(255, 255, 255)"] { background: #1F7AE0 !important; color: #FFFFFF !important; }
[data-theme="dark"] :has(> img[src^="pattern"]) [role="img"] > span { background: #62AEFF !important; }

/* taking a quiz: the page itself is the ground */
[data-theme="dark"] [data-play]:has(> img[src^="pattern"]) { background: #0F151D !important; }
[data-theme="dark"] [data-play] > div > :is(a, [role="timer"])[style*="background: rgb(0, 98, 199)"] { background: #243040 !important; }
[data-theme="dark"] [data-play] > div > div > span[style*="background: rgb(255, 255, 255)"] { background: #62AEFF !important; }
[data-theme="dark"] [data-play] > div > div > span[style*="background: rgb(10, 99, 189)"] { background: #243040 !important; }
[data-theme="dark"] [data-play] [style*="background: rgb(124, 196, 255)"] { background: #24496F !important; }
[data-theme="dark"] [data-play] [style*="background: rgb(225, 240, 255)"] { background: #19212C !important; }
[data-theme="dark"] [data-play] [style*="background: rgb(225, 240, 255)"] > span[style*="width: 32px"] { background: #243040 !important; }
[data-theme="dark"] [data-play] :is([style*="background: rgb(22, 163, 74)"], [style*="background: rgb(196, 35, 44)"], [style*="background: rgb(34, 197, 94)"], [style*="background: rgb(239, 68, 68)"]) > span[style*="width: 32px"] { background: rgba(0, 0, 0, 0.25) !important; color: #FFFFFF !important; }
[data-theme="dark"] button[role="radio"][aria-checked="true"] > span[style*="width: 46px"] { background: rgba(0, 0, 0, 0.22) !important; color: #FFFFFF !important; }
[data-theme="dark"] [data-play] :is(a, button)[style*="background: rgb(11, 31, 56)"] { background: #1F7AE0 !important; color: #FFFFFF !important; }
[data-theme="dark"] [data-root] img[src^="pattern"] { opacity: 0.55; }

/* Main buttons everywhere: the look of the Duel button — a sheen from the
   top, a lit top edge and a soft drop. The colours stay as they are; in the
   dark the white buttons on blue cards turn into blue ones. */
:is(a, button, label):is([style*="background: rgb(0, 112, 224)"], [style*="background: rgb(12, 135, 245)"], [style*="background: rgb(31, 122, 224)"], [style*="background: rgb(22, 163, 74)"]):is([style*="height: 4"], [style*="height: 5"], [style*="height: 6"]):not(nav *, [role="radio"], [role="switch"]) {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, 0.05)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 8px 18px rgba(0, 98, 199, 0.24); }
:is(a, button, label)[style*="background: rgb(22, 163, 74)"]:is([style*="height: 4"], [style*="height: 5"], [style*="height: 6"]):not(nav *) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 8px 18px rgba(22, 120, 60, 0.24); }
[data-theme="dark"] :is(a, button, label):is([style*="background: rgb(0, 112, 224)"], [style*="background: rgb(12, 135, 245)"], [style*="background: rgb(31, 122, 224)"]):is([style*="height: 4"], [style*="height: 5"], [style*="height: 6"]):not(nav *, [role="radio"], [role="switch"]) {
  background: #1F6FD0 linear-gradient(180deg, #2F8AF0, #1F6FD0) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 20px rgba(0, 0, 0, 0.35); }
[data-theme="dark"] :is(a, button, label)[style*="background: rgb(22, 163, 74)"]:is([style*="height: 4"], [style*="height: 5"], [style*="height: 6"]):not(nav *) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 20px rgba(0, 0, 0, 0.35); }
/* white buttons on blue cards: a soft drop in the light, blue in the dark */
:has(> img[src^="pattern"]) :is(a, button):is([style*="background: rgb(255, 255, 255)"], [style*="background: rgb(255, 255, 254)"]):is([style*="height: 4"], [style*="height: 5"], [style*="height: 6"]) {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(0, 82, 159, 0.05)) !important;
  box-shadow: inset 0 -1px 0 rgba(0, 82, 159, 0.08), 0 8px 18px rgba(0, 40, 100, 0.2); }
[data-theme="dark"] :has(> img[src^="pattern"]) :is(a, button):is([style*="background: rgb(255, 255, 255)"], [style*="background: rgb(255, 255, 254)"]):is([style*="height: 4"], [style*="height: 5"], [style*="height: 6"]) {
  background: #1F6FD0 linear-gradient(180deg, #2F8AF0, #1F6FD0) !important; color: #FFFFFE !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 20px rgba(0, 0, 0, 0.35); }
[data-theme="dark"] :has(> img[src^="pattern"]) :is(a, button):is([style*="background: rgb(255, 255, 255)"], [style*="background: rgb(255, 255, 254)"]):is([style*="height: 4"], [style*="height: 5"], [style*="height: 6"]) svg { color: #FFFFFE; stroke: currentColor; }
/* soft (second) buttons beside them: the same sheen, edge and drop, quieter */
:is(a, button, label):is([style*="background: rgb(214, 233, 252)"], [style*="background: rgb(225, 240, 255)"]):is([style*="height: 4"], [style*="height: 5"], [style*="height: 6"]):not(nav *, [role="radio"], [role="switch"], [aria-pressed], [data-play] *) {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 60%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(0, 98, 199, 0.06), 0 6px 14px rgba(0, 70, 150, 0.12); }
[data-theme="dark"] :is(a, button, label):is([style*="background: rgb(214, 233, 252)"], [style*="background: rgb(225, 240, 255)"]):is([style*="height: 4"], [style*="height: 5"], [style*="height: 6"]):not(nav *, [role="radio"], [role="switch"], [aria-pressed], [data-play] *) {
  background: #243040 linear-gradient(180deg, #2C3A4D, #222D3B) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.3); }
/* taking a quiz (and a duel) in the dark: the question on a raised slate
   card with a faint edge; the answers below it, the timer in the same slate */
[data-theme="dark"] [data-play] [style*="border-radius: 34px"][style*="background: rgb(255, 255, 255)"] {
  background: #1A2330 linear-gradient(180deg, #202B3A, #19212C) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 12px 28px rgba(0, 0, 0, 0.4); }
[data-theme="dark"] [data-play] button[style*="background: rgb(225, 240, 255)"] {
  background: #19212C linear-gradient(180deg, #1E2836, #19212C) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 6px 16px rgba(0, 0, 0, 0.3) !important; }
[data-theme="dark"] [data-play] button[style*="background: rgb(225, 240, 255)"] > span[style*="width: 32px"] { background: #243040 !important; color: #62AEFF !important; }
/* search fields: while typing, a blue ring with a soft halo (over the glass) */
:is([data-search], label:has(> input[type="search"])):focus-within {
  box-shadow: inset 0 0 0 2px #0070E0, 0 0 0 4px rgba(0, 112, 224, 0.14), 0 8px 20px rgba(0, 98, 199, 0.14) !important; }
[data-theme="dark"] :is([data-search], label:has(> input[type="search"])):focus-within {
  box-shadow: inset 0 0 0 2px #62AEFF, 0 0 0 4px rgba(98, 174, 255, 0.16), 0 8px 20px rgba(0, 0, 0, 0.3) !important; }
/* home: the duel card stands off the dark ground — a lit blue gradient,
   a light edge and a deeper drop */
[data-theme="dark"] [data-duelcard] {
  background: linear-gradient(155deg, #21456E 0%, #17304D 55%, #132539 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(98, 174, 255, 0.16), 0 14px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.25) !important; }
[data-theme="dark"] [data-duelcard] > img[src^="pattern"] { opacity: 0.5; }
/* the dark category tiles: the pattern quieter on the blue one */
[data-theme="dark"] [data-d="cats"] > a > img[src^="pattern"] { opacity: 0.35; }
/* home: the day streak card as glass — the page shows through, frosted,
   with a lit edge, a sheen and a soft drop; the day tiles glass too */
[data-stcard] { background: var(--g-sheen), rgba(255, 255, 255, 0.42) !important; border: 0 !important;
  box-shadow: var(--g-edge), 0 10px 26px rgba(16, 70, 140, 0.14), 0 1px 3px rgba(16, 70, 140, 0.08) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.8) brightness(1.04); backdrop-filter: blur(22px) saturate(1.8) brightness(1.04); }
[data-theme="dark"] [data-stcard] { background: var(--g-sheen), rgba(30, 42, 58, 0.72) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 12px 28px rgba(0, 0, 0, 0.4) !important; }
[data-stcard] [role="img"] > span[style*="background: rgb(255, 255, 255)"] { background: rgba(255, 255, 255, 0.6) !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.95), 0 2px 6px rgba(16, 70, 140, 0.08); }
[data-theme="dark"] [data-stcard] [role="img"] > span[style*="background: rgb(25, 33, 44)"] { background: rgba(255, 255, 255, 0.05) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
