/* Monkey Jungle (free): deep in the rainforest under the canopy. Sunbeams through the leaves, vines swaying, a
   monkey swinging on a vine, fireflies, and big jungle leaves along the bottom; vines on the buttons, a leaf on the
   cards, a banana on the title and wooden-sign Head to Head tiles. Colours are in theme-flat.css. */

/* ---- the scene (built by buildJungle() in app.js) ---- */
[data-theme="jungle"] #stage-bg { background:
  radial-gradient(60% 40% at 70% 0%, rgba(255, 240, 150, .16), transparent 70%),
  linear-gradient(#04130a 0%, #0a2614 35%, #123a1f 70%, #1a4a26 100%); }

/* sunbeams slanting through the canopy, slowly brightening and fading */
.scene .jbeam { position: absolute; top: -10%; width: 14vw; height: 90vh; left: var(--x); transform: rotate(18deg); transform-origin: top;
  background: linear-gradient(rgba(255, 245, 170, .14), transparent 85%); filter: blur(4px);
  animation: beam var(--d) ease-in-out infinite alternate; animation-delay: var(--t); }
@keyframes beam { from { opacity: .25; } to { opacity: 1; } }

/* the canopy along the top */
.scene .canopy { position: absolute; left: 0; right: 0; top: 0; height: 12vh; }
.scene .canopy svg { width: 100%; height: 100%; display: block; }

/* vines hanging from the canopy, gently swaying */
.scene .vine { position: absolute; top: 0; left: var(--x); width: 3rem; height: var(--h); transform-origin: top center;
  animation: sway var(--d) ease-in-out infinite alternate; animation-delay: var(--t); }
.scene .vine svg { width: 100%; height: 100%; display: block; overflow: visible; }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }

/* a monkey swinging on a long vine */
.scene .swing { position: absolute; top: 0; left: 74%; width: 4rem; height: 26vh; transform-origin: top center;
  animation: swing 3.2s ease-in-out infinite alternate; }
.scene .swing .rope { position: absolute; left: calc(50% - 1px); top: 0; bottom: 2.2rem; width: 2px; background: #2f6b28; }
.scene .swing svg { position: absolute; left: 50%; bottom: 0; width: 3.4rem; height: 3.4rem; transform: translateX(-50%); overflow: visible; }
@keyframes swing { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }

/* fireflies drifting about */
.scene .fly { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #e8ff8a; box-shadow: 0 0 8px 3px rgba(220, 255, 120, .55);
  left: var(--x); top: var(--y); animation: firefly var(--d) ease-in-out infinite alternate, glow 2.4s ease-in-out infinite; animation-delay: var(--t); }
@keyframes firefly { to { transform: translate(var(--dx), var(--dy)); } }
@keyframes glow { 50% { opacity: .2; } }

/* the jungle floor: big leaves and ferns */
.scene .jfloor { position: absolute; left: 0; right: 0; bottom: calc(var(--tabh) + env(safe-area-inset-bottom)); height: 20vh; }
.scene .jfloor::after { content: ''; position: absolute; left: 0; right: 0; top: calc(100% - 1px); height: 8rem; background: #071a0e; }
.scene .jfloor svg { position: absolute; inset: auto 0 0 0; width: 100%; height: 100%; opacity: .75; }   /* soft, so buttons on top stay easy to read */
.scene .jfloor .leaf { animation: rustle 4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: bottom center; }
.scene .jfloor g:nth-of-type(2n) .leaf { animation-delay: -2s; }
@keyframes rustle { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }

/* ---- the app ---- */
[data-theme="jungle"] .logo .l2 { position: relative; color: #ffcf2e; filter: drop-shadow(0 0 10px rgba(255, 207, 46, .4)); }
/* a banana leaning on "Party" */
[data-theme="jungle"] .logo:not(.small) .l2::after { content: ''; position: absolute; right: -.55em; top: -.42em; width: .9em; height: .7em;
  transform: rotate(24deg); pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 44'%3E%3Cpath d='M6 10q4 26 26 30 18 2 26-10-16 6-28-2Q14 20 14 6z' fill='%23ffd23d' stroke='%231b1033' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M8 4l6 2-1 4-6-2z' fill='%235a3a1a' stroke='%231b1033' stroke-width='2'/%3E%3Cpath d='M18 18q8 14 26 14' fill='none' stroke='%23e0a800' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat; }
[data-theme="jungle"] :is(.title, .tag, .home .dim) { text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }

/* a leafy vine draped over the top of every main button */
[data-theme="jungle"] .btn:not(.ghost):not(.small) { position: relative; overflow: visible; }
[data-theme="jungle"] .btn:not(.ghost):not(.small)::before { content: ''; position: absolute; left: 4%; right: 4%; top: -8px; height: 20px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 22' preserveAspectRatio='none'%3E%3Cpath d='M0 8Q50 16 100 8T200 8' fill='none' stroke='%232f7a2a' stroke-width='3'/%3E%3Cg fill='%2357b84a' stroke='%231e5a1c' stroke-width='1'%3E%3Cpath d='M20 11q-8 8-2 11 6-3 2-11z'/%3E%3Cpath d='M58 12q8 7 3 10-6-2-3-10z'/%3E%3Cpath d='M100 8q-8 8-2 12 6-3 2-12z'/%3E%3Cpath d='M140 6q8 8 2 12-6-3-2-12z'/%3E%3Cpath d='M180 9q-8 8-2 11 6-3 2-11z'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
[data-theme="jungle"] .btn:not(.ghost) { box-shadow: 0 3px 0 color-mix(in srgb, var(--hot) 55%, black), 0 0 14px color-mix(in srgb, var(--hot) 30%, transparent); }
[data-theme="jungle"] .btn.alt { color: #2a1200; }
[data-theme="jungle"] .btn.gold { color: #0f2a08; }

/* a big leaf tucked into the corner of cards */
[data-theme="jungle"] .panel { position: relative; box-shadow: var(--shadow), inset 0 1px 0 rgba(180, 255, 150, .14); }
[data-theme="jungle"] .panel::after { content: ''; position: absolute; top: -.5rem; right: -.3rem; width: 3rem; height: 3rem; pointer-events: none; opacity: .85;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath d='M56 4Q20 6 10 34q-4 14 4 22 22-2 36-22Q60 18 56 4z' fill='%233f9a3a' stroke='%231e5a1c' stroke-width='2'/%3E%3Cpath d='M54 6Q34 26 14 54M44 18l-8-2M38 26l-10-2M30 36l-10-1M44 18l2 8M38 26l2 10M30 36l2 9' fill='none' stroke='%231e5a1c' stroke-width='1.6'/%3E%3C/svg%3E") top right / contain no-repeat; }

/* Head to Head tiles are wooden jungle signs */
[data-theme="jungle"] .topic { border: 0; color: #fff4dc;
  background: repeating-linear-gradient(0deg, transparent 0 22px, rgba(0, 0, 0, .18) 22px 24px),
    linear-gradient(90deg, #7a4a24, #8f5a2c 30%, #7a4a24 60%, #6b3f1e);
  box-shadow: 0 4px 0 #3e2410, inset 0 2px 0 rgba(255, 220, 160, .25), 0 0 16px color-mix(in srgb, var(--sc) 25%, transparent); }
[data-theme="jungle"] .topic .ic { width: 2.2rem; height: 2.2rem; padding: .4rem; border-radius: 50%; color: #fff; background: var(--sc);
  box-shadow: 0 0 0 2px #3e2410; }
[data-theme="jungle"] .topic small { color: #f0d7a8; }
[data-theme="jungle"] #splash { background: linear-gradient(#04130a, #1a4a26); }

@media (prefers-reduced-motion: reduce) {
  [data-theme="jungle"] .scene * { animation: none !important; }
  .scene .fly, .scene .jbeam { display: none; }
}
