/* Dungeon Quest (id "dungeon", premium): a fantasy dungeon crawl, friendly and adventurous (a dark theme). A great underground hall
   of cool blue stone lit warm by torches, a red carpet up to a raised portcullis, banners, glowing crystals, a gold hoard with a red
   dragon asleep on it, a skeleton guard on his rounds, another waving, slimes squishing about. The app: oak-plank buttons bound in
   iron with gold rivets, stone-block cards under an iron strap with a gold lock plate, Head to Head tiles as painted stone plaques
   with a torch on each, portcullis spikes along the iron-bound bottom bar.
   The scene is SCENES.dungeon in theme-dungeon.js; its style items use the code "dq". */

:root {
  /* the cards' stone blocks */
  --dq-stone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 40'%3E%3Cg fill='none' stroke='%230a1024' stroke-opacity='.35' stroke-width='1.200'%3E%3Cpath d='M0 .6h64M0 20.600h64M32 .6v20M0 20.600v20M64 20.600v20'/%3E%3C/g%3E%3Cg fill='none' stroke='%23cfd8ff' stroke-opacity='.06' stroke-width='1'%3E%3Cpath d='M1 2h30M33 2h30M1 22h62'/%3E%3C/g%3E%3Cg fill='%23cfd8ff' fill-opacity='.05'%3E%3Ccircle cx='12' cy='10' r='2'/%3E%3Ccircle cx='47' cy='13' r='1.400'/%3E%3Ccircle cx='22' cy='31' r='1.600'/%3E%3Ccircle cx='54' cy='33' r='1'/%3E%3C/g%3E%3C/svg%3E");
  /* an iron strap across the top of a card, gold rivets and a lock plate */
  --dq-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 16'%3E%3Cpath d='M2 4h116v8H2z' fill='%235a6178' stroke='%231b1033' stroke-width='1.400' stroke-linejoin='round'/%3E%3Cpath d='M3 5.600h114' stroke='%239aa3b8' stroke-width='1.100'/%3E%3Cpath d='M3 10.600h114' stroke='%233a3f50' stroke-width='1'/%3E%3Ccircle cx='8' cy='8' r='2.2' fill='%23e0a526' stroke='%231b1033' stroke-width='.9'/%3E%3Ccircle cx='7.3' cy='7.3' r='0.8' fill='%23fff3c0'/%3E%3Ccircle cx='22' cy='8' r='2.2' fill='%23e0a526' stroke='%231b1033' stroke-width='.9'/%3E%3Ccircle cx='21.3' cy='7.3' r='0.8' fill='%23fff3c0'/%3E%3Ccircle cx='36' cy='8' r='2.2' fill='%23e0a526' stroke='%231b1033' stroke-width='.9'/%3E%3Ccircle cx='35.3' cy='7.3' r='0.8' fill='%23fff3c0'/%3E%3Ccircle cx='84' cy='8' r='2.2' fill='%23e0a526' stroke='%231b1033' stroke-width='.9'/%3E%3Ccircle cx='83.3' cy='7.3' r='0.8' fill='%23fff3c0'/%3E%3Ccircle cx='98' cy='8' r='2.2' fill='%23e0a526' stroke='%231b1033' stroke-width='.9'/%3E%3Ccircle cx='97.3' cy='7.3' r='0.8' fill='%23fff3c0'/%3E%3Ccircle cx='112' cy='8' r='2.2' fill='%23e0a526' stroke='%231b1033' stroke-width='.9'/%3E%3Ccircle cx='111.3' cy='7.3' r='0.8' fill='%23fff3c0'/%3E%3Cpath d='M50 1.500h20v13q-10 2-20 0z' fill='%23e0a526' stroke='%231b1033' stroke-width='1.200' stroke-linejoin='round'/%3E%3Cpath d='M52 3.200h16' stroke='%23fff3c0' stroke-width='1'/%3E%3Ccircle cx='60' cy='7.200' r='1.800' fill='%231b1033'/%3E%3Cpath d='M59.300 8h1.400l.5 3.600h-2.400z' fill='%231b1033'/%3E%3C/svg%3E");
  /* the portcullis spikes along the top of the bottom bar */
  --dq-ridge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 18'%3E%3Cpath d='M0 11h96v6H0z' fill='%235a6178' stroke='%231b1033' stroke-width='1.400'/%3E%3Cpath d='M0 12.500h96' stroke='%239aa3b8' stroke-width='1'/%3E%3Cpath d='M6 11V4.500' stroke='%231b1033' stroke-width='3'/%3E%3Cpath d='M6 11V5' stroke='%239aa3b8' stroke-width='1.200'/%3E%3Cpath d='M6 .4l2.600 4.400h-5.200z' fill='%239aa3b8' stroke='%231b1033' stroke-width='.9' stroke-linejoin='round'/%3E%3Cpath d='M18 11V4.500' stroke='%231b1033' stroke-width='3'/%3E%3Cpath d='M18 11V5' stroke='%239aa3b8' stroke-width='1.200'/%3E%3Cpath d='M18 .4l2.600 4.400h-5.200z' fill='%239aa3b8' stroke='%231b1033' stroke-width='.9' stroke-linejoin='round'/%3E%3Cpath d='M30 11V4.500' stroke='%231b1033' stroke-width='3'/%3E%3Cpath d='M30 11V5' stroke='%239aa3b8' stroke-width='1.200'/%3E%3Cpath d='M30 .4l2.600 4.400h-5.200z' fill='%239aa3b8' stroke='%231b1033' stroke-width='.9' stroke-linejoin='round'/%3E%3Cpath d='M42 11V4.500' stroke='%231b1033' stroke-width='3'/%3E%3Cpath d='M42 11V5' stroke='%239aa3b8' stroke-width='1.200'/%3E%3Cpath d='M42 .4l2.600 4.400h-5.200z' fill='%239aa3b8' stroke='%231b1033' stroke-width='.9' stroke-linejoin='round'/%3E%3Cpath d='M54 11V4.500' stroke='%231b1033' stroke-width='3'/%3E%3Cpath d='M54 11V5' stroke='%239aa3b8' stroke-width='1.200'/%3E%3Cpath d='M54 .4l2.600 4.400h-5.200z' fill='%239aa3b8' stroke='%231b1033' stroke-width='.9' stroke-linejoin='round'/%3E%3Cpath d='M66 11V4.500' stroke='%231b1033' stroke-width='3'/%3E%3Cpath d='M66 11V5' stroke='%239aa3b8' stroke-width='1.200'/%3E%3Cpath d='M66 .4l2.600 4.400h-5.200z' fill='%239aa3b8' stroke='%231b1033' stroke-width='.9' stroke-linejoin='round'/%3E%3Cpath d='M78 11V4.500' stroke='%231b1033' stroke-width='3'/%3E%3Cpath d='M78 11V5' stroke='%239aa3b8' stroke-width='1.200'/%3E%3Cpath d='M78 .4l2.600 4.400h-5.200z' fill='%239aa3b8' stroke='%231b1033' stroke-width='.9' stroke-linejoin='round'/%3E%3Cpath d='M90 11V4.500' stroke='%231b1033' stroke-width='3'/%3E%3Cpath d='M90 11V5' stroke='%239aa3b8' stroke-width='1.200'/%3E%3Cpath d='M90 .4l2.600 4.400h-5.200z' fill='%239aa3b8' stroke='%231b1033' stroke-width='.9' stroke-linejoin='round'/%3E%3Ccircle cx='0' cy='14' r='1.300' fill='%23e0a526' stroke='%231b1033' stroke-width='.6'/%3E%3Ccircle cx='12' cy='14' r='1.300' fill='%23e0a526' stroke='%231b1033' stroke-width='.6'/%3E%3Ccircle cx='24' cy='14' r='1.300' fill='%23e0a526' stroke='%231b1033' stroke-width='.6'/%3E%3Ccircle cx='36' cy='14' r='1.300' fill='%23e0a526' stroke='%231b1033' stroke-width='.6'/%3E%3Ccircle cx='48' cy='14' r='1.300' fill='%23e0a526' stroke='%231b1033' stroke-width='.6'/%3E%3Ccircle cx='60' cy='14' r='1.300' fill='%23e0a526' stroke='%231b1033' stroke-width='.6'/%3E%3Ccircle cx='72' cy='14' r='1.300' fill='%23e0a526' stroke='%231b1033' stroke-width='.6'/%3E%3Ccircle cx='84' cy='14' r='1.300' fill='%23e0a526' stroke='%231b1033' stroke-width='.6'/%3E%3Ccircle cx='96' cy='14' r='1.300' fill='%23e0a526' stroke='%231b1033' stroke-width='.6'/%3E%3C/svg%3E");
  /* a torch in its bracket (a topic tile's top right) */
  --dq-crest: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 36'%3E%3Cpath d='M13 2q8 7 3.600 13.600-3.600 2.400-7.200 0Q5 9 13 2z' fill='%23ff9a2a' stroke='%231b1033' stroke-width='1.300' stroke-linejoin='round'/%3E%3Cpath d='M13 7q4 3.600 1.800 6.600-1.800 1.200-3.600 0Q9.400 10.600 13 7z' fill='%23ffe27a'/%3E%3Cpath d='M9.500 17h7l-1.400 15h-4.200z' fill='%238a5a2e' stroke='%231b1033' stroke-width='1.300' stroke-linejoin='round'/%3E%3Cpath d='M11 20h4M11.200 24h3.600' stroke='%235e3a1c' stroke-width='1'/%3E%3Cpath d='M6 17.500h14' stroke='%231b1033' stroke-width='3.400' stroke-linecap='round'/%3E%3Cpath d='M6 17.500h14' stroke='%239aa3b8' stroke-width='1.600' stroke-linecap='round'/%3E%3Cpath d='M13 32v3' stroke='%231b1033' stroke-width='3'/%3E%3Cpath d='M7 34h12' stroke='%231b1033' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M7 34h12' stroke='%235a6178' stroke-width='1.400' stroke-linecap='round'/%3E%3C/svg%3E");
  /* iron corner straps on a main button, and the glint on them */
  --dq-corners-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg transform=''%3E%3Cpath d='M2.500 16V5q0-2.500 2.500-2.500h11' fill='none' stroke='%231b1033' stroke-width='5.400' stroke-linecap='round'/%3E%3Cpath d='M2.500 16V5q0-2.500 2.500-2.500h11' fill='none' stroke='%235a6178' stroke-width='3.200' stroke-linecap='round'/%3E%3Cpath d='M3.500 14V5.600q0-2 2-2h8.400' fill='none' stroke='%239aa3b8' stroke-width='1' stroke-linecap='round'/%3E%3Ccircle cx='9.500' cy='2.700' r='1.500' fill='%23e0a526' stroke='%231b1033' stroke-width='.7'/%3E%3Ccircle cx='2.700' cy='9.500' r='1.500' fill='%23e0a526' stroke='%231b1033' stroke-width='.7'/%3E%3C/g%3E%3Cg transform='translate(40 0) scale(-1 1)'%3E%3Cpath d='M2.500 16V5q0-2.500 2.500-2.500h11' fill='none' stroke='%231b1033' stroke-width='5.400' stroke-linecap='round'/%3E%3Cpath d='M2.500 16V5q0-2.500 2.500-2.500h11' fill='none' stroke='%235a6178' stroke-width='3.200' stroke-linecap='round'/%3E%3Cpath d='M3.500 14V5.600q0-2 2-2h8.400' fill='none' stroke='%239aa3b8' stroke-width='1' stroke-linecap='round'/%3E%3Ccircle cx='9.500' cy='2.700' r='1.500' fill='%23e0a526' stroke='%231b1033' stroke-width='.7'/%3E%3Ccircle cx='2.700' cy='9.500' r='1.500' fill='%23e0a526' stroke='%231b1033' stroke-width='.7'/%3E%3C/g%3E%3Cg transform='translate(0 40) scale(1 -1)'%3E%3Cpath d='M2.500 16V5q0-2.500 2.500-2.500h11' fill='none' stroke='%231b1033' stroke-width='5.400' stroke-linecap='round'/%3E%3Cpath d='M2.500 16V5q0-2.500 2.500-2.500h11' fill='none' stroke='%235a6178' stroke-width='3.200' stroke-linecap='round'/%3E%3Cpath d='M3.500 14V5.600q0-2 2-2h8.400' fill='none' stroke='%239aa3b8' stroke-width='1' stroke-linecap='round'/%3E%3Ccircle cx='9.500' cy='2.700' r='1.500' fill='%23e0a526' stroke='%231b1033' stroke-width='.7'/%3E%3Ccircle cx='2.700' cy='9.500' r='1.500' fill='%23e0a526' stroke='%231b1033' stroke-width='.7'/%3E%3C/g%3E%3Cg transform='translate(40 40) scale(-1 -1)'%3E%3Cpath d='M2.500 16V5q0-2.500 2.500-2.500h11' fill='none' stroke='%231b1033' stroke-width='5.400' stroke-linecap='round'/%3E%3Cpath d='M2.500 16V5q0-2.500 2.500-2.500h11' fill='none' stroke='%235a6178' stroke-width='3.200' stroke-linecap='round'/%3E%3Cpath d='M3.500 14V5.600q0-2 2-2h8.400' fill='none' stroke='%239aa3b8' stroke-width='1' stroke-linecap='round'/%3E%3Ccircle cx='9.500' cy='2.700' r='1.500' fill='%23e0a526' stroke='%231b1033' stroke-width='.7'/%3E%3Ccircle cx='2.700' cy='9.500' r='1.500' fill='%23e0a526' stroke='%231b1033' stroke-width='.7'/%3E%3C/g%3E%3C/svg%3E");
  --dq-corners-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg transform=''%3E%3Ccircle cx='9.100' cy='2.200' r='.7' fill='%23fff8de'/%3E%3Cpath d='M4 3.400h3' stroke='%23fff' stroke-opacity='.8' stroke-width='.8' stroke-linecap='round'/%3E%3C/g%3E%3Cg transform='translate(40 0) scale(-1 1)'%3E%3Ccircle cx='9.100' cy='2.200' r='.7' fill='%23fff8de'/%3E%3Cpath d='M4 3.400h3' stroke='%23fff' stroke-opacity='.8' stroke-width='.8' stroke-linecap='round'/%3E%3C/g%3E%3Cg transform='translate(0 40) scale(1 -1)'%3E%3Ccircle cx='9.100' cy='2.200' r='.7' fill='%23fff8de'/%3E%3Cpath d='M4 3.400h3' stroke='%23fff' stroke-opacity='.8' stroke-width='.8' stroke-linecap='round'/%3E%3C/g%3E%3Cg transform='translate(40 40) scale(-1 -1)'%3E%3Ccircle cx='9.100' cy='2.200' r='.7' fill='%23fff8de'/%3E%3Cpath d='M4 3.400h3' stroke='%23fff' stroke-opacity='.8' stroke-width='.8' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---- colours ---- */
[data-theme="dungeon"] {
  --bg-0: #0a0f22; --bg-1: #121a36; --bg-2: #1c2648;
  --card: rgba(28, 36, 66, .96); --card-2: rgba(207, 216, 255, .08); --panel-edge: rgba(224, 165, 38, .6);
  --ink: #f4ecd8; --ink-dim: #c4cbe0; --on-hot: #ffffff;
  --hot: #9a5a2a; --cool: #3f5a96; --amber: #f2a63a; --gold: #e0a526; --good: #6fdc4a; --bad: #ff6b5a; --seen: #8fd8ff;
  --title-1: #f4ecd8; --title-2: #ffcf4a;
  --mine: rgba(154, 90, 42, .36); --mine-edge: rgba(224, 165, 38, .75); --fact-bg: rgba(56, 200, 255, .14); --fact-edge: rgba(143, 216, 255, .45);
  --shadow: 0 8px 24px rgba(4, 6, 20, .6);
  --scrim: rgba(6, 8, 22, .72); --off: rgba(244, 236, 216, .18); --press: rgba(0, 0, 0, .32);
  /* the plaques' painted grounds */
  --s-general: #b3262e; --s-geography: #2f8a6a; --s-history: #9a6a2a; --s-science: #2f6fb8;
  --s-nature: #3f8a3a; --s-music: #7a3fa8; --s-film_tv: #4a52a8; --s-sport: #c07a1a;
  --s-arts_lit: #a8326a; --s-food: #b8582a; --s-tech_games: #1f8aa8; --s-words: #5a7a3a;
  /* bottom-bar icon colours (look3d.js TAB_ICONS): crystal blue, dragon red, slime green, gold, amethyst, bone, torch flame, oak */
  --tb-blue-1: #a8e4ff; --tb-blue-2: #2f6fb8; --tb-pink-1: #ffb0a0; --tb-pink-2: #b3262e; --tb-green-1: #c4f5a8; --tb-green-2: #3f9a3a;
  --tb-gold-1: #ffe68a; --tb-gold-2: #d0901a; --tb-purple-1: #d8c4ff; --tb-purple-2: #6a3fc0; --tb-red-1: #ffa898; --tb-red-2: #b3262e;
  --tb-cream-1: #fff8e6; --tb-cream-2: #d8cba8; --tb-orange-1: #ffcf7a; --tb-orange-2: #e0701a; --tb-brown-1: #c08a5a; --tb-brown-2: #5e3a1c;
}
[data-theme="dungeon"] #splash { background: linear-gradient(#070b1c, #121a36 40%, #26345e 62%, #3a2a24); }

/* ---- the scene ---- */
[data-theme="dungeon"] #stage-bg { background: #0c1124; }
.dq-scene { position: absolute; inset: 0; overflow: hidden; --b: calc(var(--tabh) + env(safe-area-inset-bottom)); pointer-events: none; }
.dq-scene img { display: block; -webkit-user-drag: none; }
/* above and below the hall's picture: the dark of the vault, the flagstones under the bottom bar */
.dq-vault { position: absolute; inset: 0; background: radial-gradient(70% 40% at 50% 46%, rgba(255, 170, 80, .16), transparent 70%), linear-gradient(#0a0f22, #141c3a 40%, #2a3358 60%, #3a4470); }
.dq-ground { position: absolute; left: 0; right: 0; bottom: 0; height: var(--b); background: linear-gradient(#4a5482, #2c3458); }
/* one sheet in world units, as tall as the space above the bottom bar, centred; every piece is placed in it by percent */
.dq-world { position: absolute; left: 50%; bottom: var(--b); height: calc(100% - var(--b)); aspect-ratio: 880 / 660; transform: translateX(-50%); }
.dq-world > * { position: absolute; }
.dq-layer, .dq-cut { max-width: none; }
/* the dragon asleep: breathing slow and deep, little z's floating up off its nose */
.dq-dragon { transform-origin: 50% 92%; animation: dq-breathe 4.600s ease-in-out infinite; }
.dq-dragon img { width: 100%; height: 100%; }
@keyframes dq-breathe { 0%, 100% { transform: scale(1, 1); } 45% { transform: scale(1.012, 1.045); } }
.dq-zzz b { position: absolute; left: 30%; bottom: 0; font: 900 1em/1 system-ui, sans-serif; font-size: 34cqh; color: #e6ecff; text-shadow: 0 0 4px rgba(150, 180, 255, .9), 0 1px 0 #1b1033; opacity: 0; animation: dq-z 4.600s ease-out infinite; }
.dq-zzz { container-type: size; }
.dq-zzz b:nth-child(2) { animation-delay: 1.530s; font-size: 44cqh; }
.dq-zzz b:nth-child(3) { animation-delay: 3.060s; font-size: 54cqh; }
@keyframes dq-z { 0% { opacity: 0; transform: translate(0, 0) rotate(-10deg); } 15% { opacity: .95; } 100% { opacity: 0; transform: translate(60%, -150%) rotate(12deg); } }
/* a picture strip of N frames, played by steps: the skeletons' walk and wave, the slimes' squish */
.dq-reel { display: block; width: 100%; height: 100%; background-repeat: no-repeat; background-size: calc(var(--n) * 100%) 100%; animation: dq-reel var(--t, 1s) steps(var(--n), jump-none) infinite; }
@keyframes dq-reel { from { background-position-x: 0%; } to { background-position-x: 100%; } }
.dq-walk { left: 0; top: 0; will-change: transform; }
.dq-walk.rest .dq-reel { animation-play-state: paused; }
.dq-walk.blue i { filter: hue-rotate(95deg) saturate(1.2); }
.dq-walk::after, .dq-stand::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: -4%; height: 10%; border-radius: 50%; background: rgba(4, 6, 20, .45); z-index: -1; }
/* the lights: torches flickering, the crystals breathing slowly, the gold glinting */
.dq-glow { will-change: opacity; mix-blend-mode: screen; }
.dq-glow.t { animation: dq-flicker 2.300s steps(1) infinite; }
.dq-glow.c { animation: dq-pulse 5.500s ease-in-out infinite; }
.dq-glow.g { animation: dq-twinkle 3.100s ease-in-out infinite; }
@keyframes dq-flicker { 0% { opacity: .9; } 14% { opacity: 1; } 29% { opacity: .78; } 43% { opacity: .97; } 58% { opacity: .84; } 72% { opacity: 1; } 86% { opacity: .88; } }
@keyframes dq-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes dq-twinkle { 0%, 100% { opacity: .3; } 20% { opacity: 1; } 40% { opacity: .5; } 70% { opacity: .9; } }
/* embers off the torches, dust in the light */
.dq-motes { inset: 0; overflow: hidden; }
.dq-motes i { position: absolute; width: 3px; height: 3px; border-radius: 50%; animation: dq-rise 12s linear infinite; }
.dq-motes i.ember { background: #ffb24a; box-shadow: 0 0 6px 2px rgba(255, 150, 60, .7); }
.dq-motes i.dust { width: 2px; height: 2px; background: rgba(230, 236, 255, .7); box-shadow: 0 0 3px rgba(200, 215, 255, .6); }
@keyframes dq-rise { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: 1; } 85% { opacity: .8; } 100% { opacity: 0; transform: translate(var(--dx), -160px); } }

/* ---- the app ---- */
/* no stage spotlights here: the light is the torches */
[data-theme="dungeon"] .hbeam { display: none; }
/* the title: "Party" in old ivory, the second word in polished gold, with a thick dark edge */
[data-theme="dungeon"] .logo .l1 { color: #f4ecd8; text-shadow: 0 0 2px #1b1033, 0 2px 0 #2a2030, 0 3px 10px rgba(255, 170, 80, .45); }
[data-theme="dungeon"] .logo .l2 { color: transparent; background: linear-gradient(180deg, #fff6c8 10%, #ffd24a 44%, #e0a526 54%, #8a5a0a 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(1.2px 0 0 #1b1033) drop-shadow(-1.2px 0 0 #1b1033) drop-shadow(0 1.2px 0 #1b1033) drop-shadow(0 -1.2px 0 #1b1033) drop-shadow(0 3px 0 #2a1a12); }
[data-theme="dungeon"] :is(.logo .beta, .codechip, .bigcode, .me .pts, .pl .sc, .stat b, .rank .pt, .crumb, .agree a, .linkbtn) { color: #ffcf4a; }

/* main buttons: oak planks bound in iron, a gold line inside the iron, iron straps at the corners */
[data-theme="dungeon"] .btn:not(.ghost):not(.small) { position: relative; overflow: visible; }
:root[data-theme="dungeon"] .btn:not(.ghost) { border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 240, 210, .18), rgba(255, 255, 255, 0) 40%, rgba(20, 8, 2, .3)), repeating-linear-gradient(90deg, rgba(0, 0, 0, .2) 0 1.500px, rgba(255, 220, 170, .06) 1.500px 2.500px, transparent 2.500px 1.700rem), var(--hot);
  box-shadow: inset 0 0 0 1.500px #1b1033, inset 0 0 0 4.500px #5a6178, inset 0 0 0 5.500px #9aa3b8, inset 0 0 0 7px #e0a526, inset 0 0 0 8px rgba(27, 16, 51, .55), 0 5px 0 #20263c, 0 12px 18px -6px rgba(0, 0, 0, .6); }
[data-theme="dungeon"] .btn:not(.ghost):not(.small)::before, [data-theme="dungeon"] .btn:not(.ghost):not(.small)::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; box-sizing: border-box; background: none;
  border: 12px solid transparent; border-image: var(--dq-corners-a) 40% / 12px no-repeat; border-radius: 0; }
[data-theme="dungeon"] .btn:not(.ghost):not(.small)::after { border-image-source: var(--dq-corners-b); animation: dq-glint 4.200s ease-in-out infinite; }
@keyframes dq-glint { 50% { opacity: .25; } }

/* cards: stone blocks in a gold-lined iron frame, an iron strap with a lock plate across the top */
[data-theme="dungeon"] .panel { position: relative; margin-top: .6rem; }
:root[data-theme="dungeon"] :is(.panel, .sheetbox) { background: var(--dq-stone) 0 0 / 64px 40px, radial-gradient(90% 60% at 50% 0, rgba(255, 180, 90, .12), transparent 72%), radial-gradient(80% 60% at 50% 120%, rgba(0, 0, 0, .3), transparent 70%), var(--card);
  box-shadow: inset 0 0 0 1.500px #e0a526, inset 0 0 0 4.500px #2a3048, inset 0 0 0 5.500px rgba(154, 163, 184, .55), 0 12px 24px -10px rgba(0, 0, 0, .7); }
[data-theme="dungeon"] .panel::before { content: ''; position: absolute; left: 6%; right: 6%; top: -.55rem; height: 1rem; pointer-events: none; z-index: 1;
  background: var(--dq-band) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }

/* Head to Head tiles: painted stone plaques, each its own colour with a torch's warm light on it, iron-rimmed, a torch on the corner */
[data-theme="dungeon"] .topic { position: relative; overflow: visible; border: 0; border-radius: 9px;
  background: radial-gradient(70% 70% at 70% 10%, rgba(255, 190, 100, .35), transparent 60%), var(--dq-stone) 0 0 / 48px 30px, linear-gradient(180deg, color-mix(in srgb, var(--sc) 82%, #fff3d6), var(--sc) 55%, color-mix(in srgb, var(--sc) 60%, #0a0f22));
  box-shadow: inset 0 0 0 2px #1b1033, inset 0 0 0 4.500px #5a6178, inset 0 0 0 5.500px #9aa3b8, inset 0 0 0 7px #e0a526, inset 0 0 0 8.500px #1b1033, inset 0 0 14px 6px rgba(10, 6, 20, .35), 0 4px 0 #20263c, 0 9px 14px -6px rgba(0, 0, 0, .6); }
[data-theme="dungeon"] .topic::after { content: ''; position: absolute; top: -.45rem; right: .3rem; width: 1.05rem; height: 1.45rem; pointer-events: none; background: var(--dq-crest) center / contain no-repeat; filter: drop-shadow(0 0 6px rgba(255, 160, 70, .7)); }
[data-theme="dungeon"] .topic span, [data-theme="dungeon"] .topic small { text-shadow: 0 1px 3px rgba(10, 6, 20, .85); }

/* the bottom bar: dark stone under an iron beam, the portcullis spikes along its top, the home button lit like a torch */
[data-theme="dungeon"] #tabbar { overflow: visible; background: var(--dq-stone) 0 0 / 64px 40px, linear-gradient(180deg, #2c3456, #1e2542 55%, #141a30); border-top: 2px solid #1b1033; box-shadow: inset 0 3px 0 #5a6178, inset 0 4px 0 #9aa3b8, inset 0 5px 0 rgba(27, 16, 51, .7), 0 -8px 22px -8px rgba(0, 0, 0, .7); }
[data-theme="dungeon"] #tabbar::before { content: ''; position: absolute; left: 0; right: 0; top: -16px; height: 17px; pointer-events: none; background: var(--dq-ridge) 0 0 / 88px 16px repeat-x; }
[data-theme="dungeon"] #tabbar button.homebtn::before { background: linear-gradient(180deg, #a8662e, #7a4a22); box-shadow: 0 -2px 0 #1b1033, 0 0 0 2px #e0a526 inset, 0 -4px 18px rgba(255, 160, 70, .7); }
[data-theme="dungeon"] #tabbar button { color: #f4ecd8; text-shadow: 0 1px 2px rgba(10, 6, 20, .9); }
[data-theme="dungeon"] #tabbar button.on { color: #ffcf4a; }

/* ---- Dungeon Quest style items (code "dq") ---- */
/* the win celebration: gold coins and gems pouring down (style-bundles.js draws them) */
.confetti.fx-dq i { position: absolute; top: -12%; width: calc(2.2rem * var(--s, 1)); height: auto; background: none; animation: fall 3.2s linear infinite; }
/* chat bubble "Iron-Bound Scroll": a parchment scroll held at each end by an iron band with gold rivets */
html body .bubble.bub-dq.bub-dq { position: relative; color: #2e2214; border: 2px solid #8a6a3a; border-radius: 6px;
  background: radial-gradient(120% 90% at 50% 50%, #f6ead0 55%, #e2cfa4), #f2e4c4; box-shadow: inset 7px 0 0 #5a6178, inset 9px 0 0 #e0a526, inset -7px 0 0 #5a6178, inset -9px 0 0 #e0a526, 0 0 0 1.500px #1b1033, 0 3px 6px rgba(0, 0, 0, .35); padding-left: 1.05rem; padding-right: 1.05rem; }
html body .bubble.bub-dq.bub-dq small { color: #6b5236; opacity: 1; }

/* answer buttons "Iron-Bound Boards": the answer's colour in oak boards, two iron bands across with gold rivets */
body.btns-dq .abtn, .btns-dq-demo { position: relative; overflow: visible !important; color: #fff !important; text-shadow: 0 1px 2px rgba(10, 6, 20, .85) !important; border: 2px solid #1b1033 !important; border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 45%, rgba(10, 6, 20, .28)), repeating-linear-gradient(90deg, rgba(0, 0, 0, .18) 0 1.500px, transparent 1.500px 1.600rem), var(--c) !important;
  box-shadow: inset 0 0 0 2.500px #5a6178, inset 0 0 0 3.500px #9aa3b8, inset 0 0 0 5px #e0a526, 0 5px 0 #20263c, 0 10px 14px -6px rgba(0, 0, 0, .55) !important; }
body.btns-dq .abtn::before, .btns-dq-demo::before { content: ''; position: absolute; inset: 0; width: auto; height: auto; z-index: 2; border: 0; border-radius: 0; opacity: 1; pointer-events: none;
  background: linear-gradient(90deg, transparent 14px, #5a6178 14px 22px, transparent 22px calc(100% - 22px), #5a6178 calc(100% - 22px) calc(100% - 14px), transparent calc(100% - 14px)) 0 0 / 100% 100% no-repeat,
    radial-gradient(circle at 18px 9px, #e0a526 0 2px, #1b1033 2.400px 2.900px, transparent 3.200px), radial-gradient(circle at 18px calc(100% - 9px), #e0a526 0 2px, #1b1033 2.400px 2.900px, transparent 3.200px),
    radial-gradient(circle at calc(100% - 18px) 9px, #e0a526 0 2px, #1b1033 2.400px 2.900px, transparent 3.200px), radial-gradient(circle at calc(100% - 18px) calc(100% - 9px), #e0a526 0 2px, #1b1033 2.400px 2.900px, transparent 3.200px); }
body.btns-dq .abtn::after { content: none; }
body.btns-dq .abtn:active { transform: translateY(4px); box-shadow: inset 0 0 0 2.500px #5a6178, inset 0 0 0 5px #e0a526, 0 1px 0 #20263c !important; }
.btns-dq-demo { --c: #b3262e; }

@media (prefers-reduced-motion: reduce) {
  [data-theme="dungeon"] .dq-scene *, [data-theme="dungeon"] .btn::after { animation: none !important; }
}
