/* Dino Valley (id "dinovalley", premium): a lost valley at a warm misty morning. Giant ferns and cycads, a smoking volcano far off,
   a waterfall off the cliff, long-necks grazing, pterosaurs over, little dinosaurs darting about the nest and the fossils. The app:
   chipped stone slabs in split-log frames with rope lashings, planks tied across the cards, a ridge of rocks and leaves along the
   bottom bar. The scene is SCENES.dinovalley in theme-dinovalley.js; its style items use the code "dv". */

:root {
  /* a ridge of stones with fern tips along the top of the bottom bar */
  --dv-ridge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 16'%3E%3Cg stroke='%231b1033' stroke-width='1.300' stroke-linejoin='round'%3E%3Cpath d='M2 16Q0 7 7 6q3-5 9-3 7-1 7 6 2 3 1 7z' fill='%238f8474'/%3E%3Cpath d='M24 16q1-9 8-8 4-4 10-1 5 2 4 9z' fill='%23a59a86'/%3E%3Cpath d='M46 16q0-6 5-6 3-5 9-4 6 2 7 10z' fill='%2379705f'/%3E%3Cpath d='M68 16q-1-7 6-8 5-3 10 0 7 1 6 8z' fill='%239a8f7c'/%3E%3C/g%3E%3Cg fill='%235fa33c' stroke='%231b1033' stroke-width='.9' stroke-linejoin='round'%3E%3Cpath d='M23 9q-5-4-6-8 5 1 7 5 1-4 5-5-1 5-4 8z'/%3E%3Cpath d='M67 8q-3-4-3-7 4 2 5 5 2-3 5-3-2 4-5 6z'/%3E%3C/g%3E%3C/svg%3E");
  /* the plank tied across the top of a card */
  --dv-plank: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14'%3E%3Cpath d='M2 2l116-1 1 6-1 5-116 1-1-5z' fill='%23a57a48' stroke='%231b1033' stroke-width='1.500' stroke-linejoin='round'/%3E%3Cpath d='M6 5q24-2 50 0t58-1M8 9q30 1 52-1t52 2' fill='none' stroke='%236e4c2c' stroke-width='1'/%3E%3Cg fill='%23e8d3a0' stroke='%231b1033' stroke-width='.9'%3E%3Crect x='12' y='-.5' width='7' height='15' rx='1.500'/%3E%3Crect x='101' y='-.5' width='7' height='15' rx='1.500'/%3E%3C/g%3E%3Cpath d='M12 4h7M12 8h7M12 11h7M101 4h7M101 8h7M101 11h7' stroke='%238a6238' stroke-width='.9'/%3E%3C/svg%3E");
  /* a three-toed footprint pressed in a stone (a topic tile's top right) */
  --dv-print: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 24'%3E%3Cpath d='M4 13Q3 5 11 3q9-3 17 0 6 3 5 10-1 7-9 8-8 2-15 0-5-2-5-8z' fill='%23c9bda6' stroke='%231b1033' stroke-width='1.800' stroke-linejoin='round'/%3E%3Cpath d='M18 19q-5-1-5-4 0-2 2-3l-5-5q2-1 3 0l4 3 0-6q1-1 2 0l1 6 4-3q2-1 3 0l-5 5q3 1 2 3 0 4-6 4z' fill='%236d6658'/%3E%3C/svg%3E");
  /* stone studs lashed with rope at a main button's corners, and the moss on them */
  --dv-corners-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='%23c9bda6' stroke='%231b1033' stroke-width='1.200' stroke-linejoin='round'%3E%3Cpath d='M2 8l3-5 6-1 3 4-1 7-5 2-5-2z'/%3E%3Cpath d='M26 6l5-4 6 2 1 6-3 5-6 0-3-4z'/%3E%3Cpath d='M2 29l4-3 6 1 2 5-3 6-6 0-3-4z'/%3E%3Cpath d='M26 30l4-4 6 2 2 6-4 4-6-1-2-3z'/%3E%3C/g%3E%3Cpath d='M4 6l9 3M4 10l8 3M28 4l8 6M27 8l7 5M3 31l10 2M4 35l8 2M28 29l8 3M27 33l8 3' stroke='%23e8d3a0' stroke-width='1.300' stroke-linecap='round'/%3E%3C/svg%3E");
  --dv-corners-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='%237fc24a'%3E%3Cpath d='M3 5q2-3 6-3 2 2 0 4-4 2-6-1z'/%3E%3Cpath d='M30 36q3-3 6-2 2 2 0 4-3 1-6-2z'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---- colours ---- */
[data-theme="dinovalley"] {
  --bg-0: #0f2416; --bg-1: #16321e; --bg-2: #214528;
  --card: rgba(26, 44, 26, .95); --card-2: rgba(240, 225, 190, .1); --panel-edge: rgba(222, 196, 140, .55);
  --ink: #fdf6e3; --ink-dim: #cfd8b8; --on-hot: #ffffff;
  --hot: #d9622b; --cool: #1f8f7a; --amber: #e8a526; --gold: #e8a526; --good: #6fd65c; --bad: #ff6a5a; --seen: #a8e68a;
  --title-1: #fdf6e3; --title-2: #ffb347;
  --mine: rgba(217, 98, 43, .3); --mine-edge: rgba(217, 98, 43, .62); --fact-bg: rgba(127, 194, 74, .14); --fact-edge: rgba(127, 194, 74, .45);
  --shadow: 0 8px 24px rgba(6, 18, 8, .55);
  --scrim: rgba(8, 20, 10, .66); --off: rgba(240, 225, 190, .2); --press: rgba(0, 0, 0, .3);
  /* painted stones for the topic tiles */
  --s-general: #d9622b; --s-geography: #1f8f7a; --s-history: #a8682c; --s-science: #2f7fa8;
  --s-nature: #4f9a34; --s-music: #c04a6a; --s-film_tv: #7a5aa8; --s-sport: #cf8a14;
  --s-arts_lit: #4a6aa8; --s-food: #d0602c; --s-tech_games: #2a8f98; --s-words: #3a8a5c;
  /* bottom-bar icon colours (look3d.js TAB_ICONS): stone, wood, fern, lava, river */
  --tb-blue-1: #a8ecd8; --tb-blue-2: #1f8f7a; --tb-pink-1: #ffc8a0; --tb-pink-2: #d9622b; --tb-green-1: #d0f09a; --tb-green-2: #4f9a34;
  --tb-gold-1: #ffe29a; --tb-gold-2: #e09a1a; --tb-purple-1: #d8d0b8; --tb-purple-2: #7a6e5a; --tb-red-1: #ffb08a; --tb-red-2: #d04a1e;
  --tb-cream-1: #fff6e0; --tb-cream-2: #d8c8a4; --tb-orange-1: #ffc48a; --tb-orange-2: #e0701e; --tb-brown-1: #b58a58; --tb-brown-2: #6e4c2c;
}
[data-theme="dinovalley"] #splash { background: linear-gradient(#f4c98e, #e9a86a 26%, #5f9478 58%, #1f4a2a); }

/* ---- the scene ---- */
[data-theme="dinovalley"] #stage-bg { background: #e9c49a; }
.dv-scene { position: absolute; inset: 0; overflow: hidden; --b: calc(var(--tabh) + env(safe-area-inset-bottom)); pointer-events: none; }
.dv-scene img { display: block; -webkit-user-drag: none; }
.dv-sky { position: absolute; inset: 0; background: radial-gradient(38% 20% at 26% 30%, rgba(255, 244, 214, .95), rgba(255, 226, 170, .4) 46%, transparent 74%), linear-gradient(#6fb4c2, #a4cdc0 26%, #f2dcb4 44%, #f8cf9e 52%, #4e8a4a 53%); }
/* one sheet in world units, as tall as the space above the bottom bar, centred; every piece is placed in it by percent */
.dv-world { position: absolute; left: 50%; bottom: var(--b); height: calc(100% - var(--b)); aspect-ratio: 880 / 660; transform: translateX(-50%); }
.dv-world > * { position: absolute; }
.dv-layer { max-width: none; }
.dv-ground { position: absolute; left: 0; right: 0; bottom: 0; height: var(--b); background: linear-gradient(#3f7a34, #2c5a28); }
/* clouds and mist: two copies of a strip, sliding for ever */
.dv-drift { left: -60%; width: 440%; overflow: hidden; }
.dv-drift i { position: absolute; inset: 0; background-repeat: repeat-x; background-size: 50% 100%; animation: dv-slide 150s linear infinite; }
.dv-drift.b i { animation-duration: 95s; animation-direction: reverse; }
@keyframes dv-slide { to { transform: translateX(-50%); } }
/* the volcano: its glow breathing, its lava pulsing, smoke rising */
.dv-lava { animation: dv-pulse 5.5s ease-in-out infinite; }
@keyframes dv-pulse { 0%, 100% { opacity: .62; } 50% { opacity: 1; } }
.dv-glow { border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 170, 70, .8), rgba(255, 110, 40, .32) 48%, transparent); mix-blend-mode: screen; animation: dv-pulse 5.5s ease-in-out infinite; }
.dv-smoke { width: 5.6%; aspect-ratio: 1; opacity: 0; animation: dv-rise 22s linear infinite; will-change: transform, opacity; }
.dv-smoke img { width: 100%; height: 100%; filter: blur(1.2px); }
@keyframes dv-rise { 0% { transform: translate(0, 0) scale(.42) rotate(0); opacity: 0; } 6% { opacity: .85; } 55% { opacity: .62; } 100% { transform: translate(-340%, -420%) scale(2.2) rotate(50deg); opacity: 0; } }
/* a picture strip of N frames, played by steps */
.dv-reel { background-repeat: no-repeat; background-size: calc(var(--n) * 100%) 100%; animation: dv-reel var(--t, 1s) steps(var(--n), jump-none) infinite; }
.dv-reel.pp { animation-direction: alternate; }
@keyframes dv-reel { from { background-position-x: 0%; } to { background-position-x: 100%; } }
/* the water's ripples, three pictures fading through each other */
.dv-ripple { animation: dv-fade 6s linear infinite; }
.dv-ripple.b { animation-delay: -2s; }
.dv-ripple.c { animation-delay: -4s; }
@keyframes dv-fade { 0%, 100% { opacity: 0; } 16.700%, 33.300% { opacity: 1; } 50% { opacity: 0; } }
.dv-spray { border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .7), rgba(255, 255, 255, .22) 56%, transparent); animation: dv-spray 3.6s ease-in-out infinite alternate; }
@keyframes dv-spray { to { transform: scale(1.14, 1.3) translateY(-5%); opacity: .7; } }
/* everything that moves about: the script places it, in world units */
.dv-mover { left: 0; top: 0; will-change: transform; }
.dv-mover i { display: block; width: 100%; height: 100%; }
.dv-mover .idle { display: none; position: absolute; inset: 0; }
.dv-rap.st .idle { display: block; }
.dv-rap.st .run { visibility: hidden; }
.dv-mover .sh { position: absolute; left: 12%; right: 12%; bottom: -3%; height: 14%; border-radius: 50%; background: rgba(20, 40, 16, .32); filter: blur(2px); z-index: -1; }
.dv-egg { transform-origin: 50% 94%; animation: dv-rock 7s ease-in-out infinite; }
@keyframes dv-rock { 0%, 62%, 100% { transform: rotate(0); } 66% { transform: rotate(-10deg); } 70% { transform: rotate(9deg); } 74% { transform: rotate(-7deg); } 78% { transform: rotate(6deg); } 82% { transform: rotate(-3deg); } 86% { transform: rotate(0); } }

/* ---- the app ---- */
/* no stage spotlights in the valley: the light here is the morning sun */
[data-theme="dinovalley"] .hbeam { display: none; }
/* the title: "Party" cut in pale stone, the second word in lava, with a thick dark edge */
[data-theme="dinovalley"] .logo .l1 { color: #fdf6e3; text-shadow: 0 2px 0 #6e4c2c, 0 3px 8px rgba(6, 18, 8, .7); }
[data-theme="dinovalley"] .logo .l2 { color: transparent; background: linear-gradient(180deg, #fff1b8 14%, #ffc24a 48%, #f0762a 54%, #c8421e 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 #2a1a0e); }
[data-theme="dinovalley"] :is(.title, .tag, .dim, .label) { text-shadow: 0 0 5px #0f2416, 0 1px 3px #0f2416, 0 2px 10px rgba(6, 18, 8, .9); }
[data-theme="dinovalley"] .hname .ptitle { filter: drop-shadow(0 0 1.5px #16321e) drop-shadow(0 0 1.5px #16321e) drop-shadow(0 1px 3px #16321e); }

/* main buttons: a stone slab in a log frame, a lashed stone at each corner with moss on it */
[data-theme="dinovalley"] .btn:not(.ghost):not(.small) { position: relative; overflow: visible; }
:root[data-theme="dinovalley"] .btn:not(.ghost) { border-radius: 12px 9px 13px 8px / 9px 13px 8px 12px;
  background: radial-gradient(60% 90% at 26% 0, rgba(255, 255, 255, .24), transparent 70%), linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 45%, rgba(42, 22, 8, .24)), var(--hot);
  box-shadow: inset 0 0 0 2px rgba(255, 244, 214, .3), inset 0 0 0 4px #7a5230, inset 0 0 0 5px rgba(27, 16, 51, .5), 0 5px 0 color-mix(in srgb, var(--hot) 50%, #2a1a0e), 0 12px 20px -6px rgba(6, 18, 8, .6); }
[data-theme="dinovalley"] .btn:not(.ghost):not(.small)::before, [data-theme="dinovalley"] .btn:not(.ghost):not(.small)::after {
  content: ''; position: absolute; inset: 1px; z-index: 2; pointer-events: none; box-sizing: border-box; background: none;
  border: 12px solid transparent; border-image: var(--dv-corners-a) 40% / 12px no-repeat; border-radius: 0; }
[data-theme="dinovalley"] .btn:not(.ghost):not(.small)::after { border-image-source: var(--dv-corners-b); animation: dv-moss 5s ease-in-out infinite; }
@keyframes dv-moss { 50% { opacity: .55; } }

/* cards: planks lashed across the top, a rope-coloured line round the edge */
[data-theme="dinovalley"] .panel { position: relative; margin-top: .55rem; }
:root[data-theme="dinovalley"] :is(.panel, .sheetbox) { background: linear-gradient(180deg, rgba(255, 244, 214, .07), rgba(255, 255, 255, 0) 40%), var(--card);
  box-shadow: inset 0 0 0 1.5px rgba(222, 196, 140, .55), 0 14px 28px -10px rgba(6, 18, 8, .75); }
[data-theme="dinovalley"] .panel::before { content: ''; position: absolute; left: 7%; right: 7%; top: -.5rem; height: .9rem; pointer-events: none; z-index: 1;
  background: var(--dv-plank) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 2px rgba(6, 18, 8, .5)); }

/* Head to Head tiles: painted standing stones, rough at the edge, a footprint stone in the corner */
[data-theme="dinovalley"] .topic { position: relative; overflow: visible; border: 0; border-radius: 16px 10px 18px 9px / 10px 16px 9px 18px;
  background: radial-gradient(70% 60% at 24% 12%, rgba(255, 255, 255, .22), transparent 70%), linear-gradient(170deg, color-mix(in srgb, var(--sc) 80%, #fff4d6), var(--sc) 55%, color-mix(in srgb, var(--sc) 72%, #2a1a0e));
  box-shadow: inset 0 0 0 3px rgba(201, 189, 166, .85), inset 0 0 0 4.5px rgba(27, 16, 51, .45), inset 0 -6px 0 rgba(42, 26, 14, .3); }
[data-theme="dinovalley"] .topic::after { content: ''; position: absolute; top: .35rem; right: .45rem; width: 1.45rem; height: .95rem; pointer-events: none; background: var(--dv-print) center / contain no-repeat; }
[data-theme="dinovalley"] .topic span, [data-theme="dinovalley"] .topic small { text-shadow: 0 1px 3px rgba(30, 20, 8, .75); }

/* the bottom bar: a split-log deck, a ridge of stones and fern tips along its edge, the home button lit from under like the volcano */
[data-theme="dinovalley"] #tabbar { overflow: visible; background: repeating-linear-gradient(90deg, rgba(42, 26, 14, .55) 0 2px, transparent 2px 3.4rem), repeating-linear-gradient(180deg, rgba(255, 220, 160, .05) 0 3px, transparent 3px 9px), linear-gradient(180deg, #7a5230, #5e3e24 60%, #452c18); border-top: 2px solid #1b1033; box-shadow: 0 -8px 20px -8px rgba(6, 18, 8, .7); }
[data-theme="dinovalley"] #tabbar::before { content: ''; position: absolute; left: 0; right: 0; top: -11px; height: 14px; pointer-events: none; background: var(--dv-ridge) 0 0 / 84px 14px repeat-x; }
[data-theme="dinovalley"] #tabbar button.homebtn::before { background: linear-gradient(180deg, #7a5230, #5e3e24); box-shadow: 0 -2px 0 #1b1033, 0 -4px 14px rgba(255, 140, 60, .55); }
[data-theme="dinovalley"] #tabbar button { color: #fdf0d6; }
[data-theme="dinovalley"] #tabbar button.on { color: #ffc24a; }

/* ---- Dino Valley style items (code "dv") ---- */
/* the win celebration: eggs, bones and ferns tumbling down (style-bundles.js draws them) */
.confetti.fx-dv i { position: absolute; top: -12%; width: calc(2.4rem * var(--s, 1)); height: auto; background: none; animation: fall 3.4s linear infinite; }
/* chat bubble "Fossil Slab": a slab of pale sandstone with a rope line and a little curled shell pressed in the corner */
html body .bubble.bub-dv.bub-dv { color: #3a2a18; border: 2px solid #8a6238;
  background: radial-gradient(14% 30% at 92% 80%, rgba(138, 98, 56, .34), transparent 72%), radial-gradient(40% 50% at 10% 8%, rgba(255, 255, 255, .5), transparent 70%), linear-gradient(170deg, #efe2c4, #d8c8a4); }
html body .bubble.bub-dv.bub-dv small { color: #6e4c2c; opacity: 1; }

/* answer buttons "Valley Stones": a chipped slab in the answer's colour, in a log frame, lashed stones at the corners */
body.btns-dv .abtn, .btns-dv-demo { position: relative; overflow: visible !important; color: #fff !important; text-shadow: 0 1px 2px rgba(42, 22, 8, .85) !important; border: 2px solid #1b1033 !important; border-radius: 13px 8px 14px 7px / 8px 14px 7px 13px !important;
  background: radial-gradient(60% 90% at 24% 0, rgba(255, 255, 255, .22), transparent 70%), linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 45%, rgba(42, 22, 8, .26)), var(--c) !important;
  box-shadow: inset 0 0 0 3px #7a5230, inset 0 0 0 4.5px rgba(27, 16, 51, .5), 0 5px 0 color-mix(in srgb, var(--c) 42%, #2a1a0e), 0 10px 16px -6px rgba(6, 18, 8, .6) !important; }
body.btns-dv .abtn::before, body.btns-dv .abtn::after, .btns-dv-demo::before { content: ''; position: absolute; inset: 0; width: auto; height: auto; z-index: 2; background: none; border-radius: 0; opacity: 1; pointer-events: none; box-sizing: border-box; border: 13px solid transparent; border-image: var(--dv-corners-a) 40% / 13px no-repeat; }
/* the chipped edge: the slab's outline is cut, so its lip and shadow come from the row round it */
body.btns-dv .abtn { clip-path: polygon(2% 8%, 8% 1%, 34% 0, 62% 2%, 91% 0, 98% 6%, 100% 34%, 99% 68%, 100% 90%, 95% 99%, 63% 100%, 31% 98%, 6% 100%, 1% 92%, 0 62%, 1% 30%); }
body.btns-dv .ans { filter: drop-shadow(0 4px 0 #3a2616) drop-shadow(0 7px 7px rgba(6, 18, 8, .45)); }
body.btns-dv .abtn::after { border-image-source: var(--dv-corners-b); animation: dv-moss 5s ease-in-out infinite; }
body.btns-dv .abtn:active { transform: translateY(4px); box-shadow: inset 0 0 0 3px #7a5230, 0 1px 0 color-mix(in srgb, var(--c) 42%, #2a1a0e) !important; }
.btns-dv-demo { --c: #d9622b; }

@media (prefers-reduced-motion: reduce) {
  [data-theme="dinovalley"] .dv-scene *, [data-theme="dinovalley"] .btn::after, body.btns-dv .abtn::after { animation: none !important; }
}
