/* =========================================================
   themes.css — three dinosaur themes (body[data-theme=…]).
   Picked by theme.js. Each theme only overrides colours, fonts and
   decorations; the layout and the game stay the same.
   ========================================================= */

/* Shared decoration layer (filled by theme.js) */
.scene{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:0}
.topbar,main,.layout,.site-foot{position:relative;z-index:1}
.walker{position:absolute;bottom:-4px;left:0;font-size:26px;line-height:1;animation:walk 22s linear infinite;pointer-events:none}
.topbar{overflow:hidden}
@keyframes walk{
  0%{transform:translateX(105vw)}
  100%{transform:translateX(-80px)}
}
.walker span{display:inline-block;animation:bob .5s ease-in-out infinite alternate}
@keyframes bob{from{transform:translateY(0) rotate(-3deg)}to{transform:translateY(-3px) rotate(3deg)}}
.particle{position:absolute;top:-40px;will-change:transform;opacity:.0}
@media (prefers-reduced-motion:reduce){.walker,.particle,.walker span{animation:none!important}.particle{display:none}}

/* ---------- 1. JUNGLE · "Jurassic Jungle" ---------- */
body[data-theme="jungle"]{
  --bg:#0c1a10;--panel:rgba(20,40,24,.88);--line:#2f5a35;--text:#f0f7e8;--muted:#a9c4a0;
  --correct:#3f9d3a;--close:#e0a526;--wrong:#2c3b2c;--accent:#8fd14f;
  background:
    radial-gradient(900px 420px at 15% -5%, rgba(143,209,79,.25), transparent 60%),
    radial-gradient(700px 380px at 95% 0%, rgba(54,120,60,.35), transparent 60%),
    linear-gradient(180deg,#10261a 0%,#0b1a0f 55%,#081208 100%);
  font-family:"Nunito",system-ui,sans-serif;
}
body[data-theme="jungle"] .topbar{background:rgba(9,26,14,.82);border-bottom:2px solid #3d7a3a}
body[data-theme="jungle"] .topbar h1,body[data-theme="jungle"] .doc h2{font-family:"Lilita One",system-ui;font-weight:400;letter-spacing:.5px;font-size:24px;color:#c7f08a;text-shadow:0 2px 0 #1e4a1c}
body[data-theme="jungle"] .hint{border-radius:16px;border-width:2px}
body[data-theme="jungle"] .cell{border-radius:14px}
body[data-theme="jungle"] .cell.name-cell{background:#1c3420}
body[data-theme="jungle"] .guess-form button,body[data-theme="jungle"] .hint-buy,body[data-theme="jungle"] .share-btn{background:linear-gradient(180deg,#a6e05c,#6bb534);color:#10260a;box-shadow:0 4px 0 #3d7a1f}
body[data-theme="jungle"] .particle{animation:leaf linear infinite}
@keyframes leaf{
  0%{transform:translate(0,-40px) rotate(0);opacity:0}
  10%{opacity:.75}
  100%{transform:translate(80px,110vh) rotate(540deg);opacity:.2}
}

/* ---------- 2. FOSSIL · "Museum Dig" (light) ---------- */
body[data-theme="fossil"]{
  --bg:#efe2c4;--panel:#fbf4e3;--line:#c9b089;--text:#3b2a17;--muted:#7a6346;
  --correct:#4f8a3c;--close:#d08a1c;--wrong:#d9c7a4;--accent:#9a5b22;
  color-scheme:light;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23d9c39c' fill-opacity='.45'%3E%3Cpath d='M20 30a5 5 0 1 1 7-4l18 18a5 5 0 1 1-4 7L23 33a5 5 0 0 1-3-3z'/%3E%3Cpath d='M80 85a5 5 0 1 1 7-4l18 18a5 5 0 1 1-4 7L83 88a5 5 0 0 1-3-3z'/%3E%3Ccircle cx='95' cy='25' r='2.5'/%3E%3Ccircle cx='30' cy='95' r='2'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg,#f4e9cf,#e6d3ab);
  font-family:"Nunito",system-ui,sans-serif;
}
body[data-theme="fossil"] .topbar{background:rgba(244,233,207,.92);border-bottom:3px double #b8915c}
body[data-theme="fossil"] .topbar h1,body[data-theme="fossil"] .doc h2{font-family:"Rye",Georgia,serif;font-weight:400;font-size:24px;color:#6b3d14}
body[data-theme="fossil"] .topbar a,body[data-theme="fossil"] .mode-switch a{color:#6b4a2a}
body[data-theme="fossil"] .hint{border:2px dashed #c9a46c;background:#fffaf0}
body[data-theme="fossil"] .hint.unlocked{border-style:solid;border-color:#9a5b22;box-shadow:0 6px 18px rgba(120,80,30,.18)}
body[data-theme="fossil"] .cell{color:#3b2a17;box-shadow:inset 0 -3px 0 rgba(0,0,0,.08)}
body[data-theme="fossil"] .cell.correct,body[data-theme="fossil"] .cell.close{color:#fff}
body[data-theme="fossil"] .cell.wrong{color:#6d5a40}
body[data-theme="fossil"] .cell.name-cell{background:#f1e2c2;color:#3b2a17}
body[data-theme="fossil"] .guess-form input,body[data-theme="fossil"] .autocomplete-list{background:#fffaf0;color:#3b2a17;border-color:#c9a46c}
body[data-theme="fossil"] .guess-form button,body[data-theme="fossil"] .hint-buy,body[data-theme="fossil"] .share-btn{background:#9a5b22;color:#fff8ea;box-shadow:0 4px 0 #6b3d14}
body[data-theme="fossil"] .silhouette-wrap{background:linear-gradient(135deg,#e9d6ad,#d9bf8c)}
body[data-theme="fossil"] .silhouette-img.is-real{filter:drop-shadow(0 2px 0 rgba(255,255,255,.4));opacity:.9}
body[data-theme="fossil"] .modal,body[data-theme="fossil"] .history-item{background:#fffaf0}
body[data-theme="fossil"] .particle{animation:dust ease-in-out infinite}
@keyframes dust{
  0%{transform:translate(0,30vh) scale(.6);opacity:0}
  30%{opacity:.5}
  100%{transform:translate(40px,-10vh) scale(1);opacity:0}
}

/* ---------- 3. VOLCANO · "Last Day of the Cretaceous" ---------- */
body[data-theme="volcano"]{
  --bg:#0d0710;--panel:rgba(30,16,26,.9);--line:#4a2433;--text:#fde8dc;--muted:#c49a8c;
  --correct:#2fa35a;--close:#ff8a1f;--wrong:#2e1d27;--accent:#ff6a2b;
  background:
    radial-gradient(1100px 380px at 50% 112%, rgba(255,92,31,.55), transparent 65%),
    radial-gradient(600px 300px at 80% -10%, rgba(120,60,160,.35), transparent 60%),
    linear-gradient(180deg,#120a1c 0%,#1a0b14 60%,#2a0d0a 100%);
  background-attachment:fixed;
  font-family:"Nunito",system-ui,sans-serif;
}
body[data-theme="volcano"] .topbar{background:rgba(16,8,18,.8);border-bottom:2px solid #ff6a2b55}
body[data-theme="volcano"] .topbar h1,body[data-theme="volcano"] .doc h2{font-family:"Bungee",system-ui;font-weight:400;font-size:22px;background:linear-gradient(90deg,#ffd166,#ff6a2b,#e63946);-webkit-background-clip:text;background-clip:text;color:transparent}
body[data-theme="volcano"] .hint.unlocked{box-shadow:0 0 18px rgba(255,106,43,.35)}
body[data-theme="volcano"] .cell.close{color:#2a0f00}
body[data-theme="volcano"] .cell.correct{box-shadow:0 0 12px rgba(47,163,90,.45)}
body[data-theme="volcano"] .guess-form button,body[data-theme="volcano"] .hint-buy,body[data-theme="volcano"] .share-btn{background:linear-gradient(180deg,#ff9a3c,#e8461e);color:#fff;box-shadow:0 0 16px rgba(255,106,43,.45)}
body[data-theme="volcano"] .silhouette-img.is-real{filter:invert(1) drop-shadow(0 0 12px rgba(255,120,40,.8))}
body[data-theme="volcano"] .particle.meteor{top:-10vh;width:2px;height:90px;background:linear-gradient(180deg,transparent,#ffd166,#ff6a2b);border-radius:2px;animation:meteor linear infinite}
@keyframes meteor{
  0%{transform:translate(0,0) rotate(-35deg);opacity:0}
  5%{opacity:1}
  60%{opacity:0}
  100%{transform:translate(-60vw,120vh) rotate(-35deg);opacity:0}
}
body[data-theme="volcano"] .particle.ember{top:auto;bottom:-10px;width:5px;height:5px;border-radius:50%;background:#ff8a1f;box-shadow:0 0 8px #ff6a2b;animation:ember ease-out infinite}
@keyframes ember{
  0%{transform:translate(0,0);opacity:0}
  15%{opacity:.9}
  100%{transform:translate(30px,-70vh);opacity:0}
}

/* Win celebration (all themes) */
.celebrate{position:fixed;top:-40px;font-size:28px;z-index:60;pointer-events:none;animation:fall 2.6s cubic-bezier(.3,.6,.4,1) forwards}
@keyframes fall{to{transform:translateY(110vh) rotate(360deg);opacity:.2}}

/* ---------- Jungle → extinction (default theme) ----------
   theme.js sets --doom (0 = lush jungle, 1 = volcanic end of the Cretaceous)
   from the share of attempts used; doom-2 / doom-3 / extinct are steps. */
body[data-theme="jungle"]{--doom:0}
.scene-layer{position:absolute;inset:0}
.doom-sky{
  background:
    radial-gradient(1100px 420px at 50% 115%, rgba(255,92,31,.65), transparent 65%),
    radial-gradient(700px 300px at 85% -5%, rgba(140,40,30,.5), transparent 60%),
    linear-gradient(180deg,#1c0b0b 0%,#2a0e0a 60%,#3a120a 100%);
  opacity:var(--doom);transition:opacity 1.4s ease}
.leaf-layer{opacity:calc(1 - var(--doom));transition:opacity 1.4s ease}
.fire-layer{opacity:var(--doom);transition:opacity 1.4s ease}
.fire-layer .meteor{top:-10vh;width:2px;height:90px;background:linear-gradient(180deg,transparent,#ffd166,#ff6a2b);border-radius:2px;animation:meteor linear infinite}
.fire-layer .ember{top:auto;bottom:-10px;width:5px;height:5px;border-radius:50%;background:#ff8a1f;box-shadow:0 0 8px #ff6a2b;animation:ember ease-out infinite}
body[data-theme="jungle"] .topbar,body[data-theme="jungle"] .hint,body[data-theme="jungle"] .cell{transition:background-color 1.2s,border-color 1.2s,box-shadow 1.2s}
body[data-theme="jungle"].doom-2{--accent:#e9b23b;--line:#6a5a2a;--close:#ef8f1f}
body[data-theme="jungle"].doom-2 .topbar{border-bottom-color:#b8862a}
body[data-theme="jungle"].doom-2 .topbar h1{color:#f3cf6b;text-shadow:0 2px 0 #5a3a10}
body[data-theme="jungle"].doom-3{--accent:#ff6a2b;--line:#6a2a22;--panel:rgba(40,16,14,.9);--wrong:#3a2622;--muted:#d0a090}
body[data-theme="jungle"].doom-3 .topbar{background:rgba(26,10,10,.85);border-bottom-color:#ff6a2b}
body[data-theme="jungle"].doom-3 .topbar h1{color:#ffb070;text-shadow:0 0 10px rgba(255,106,43,.6)}
body[data-theme="jungle"].doom-3 .guess-form button,body[data-theme="jungle"].doom-3 .hint-buy{background:linear-gradient(180deg,#ff9a3c,#e8461e);color:#fff;box-shadow:0 4px 0 #8a2a10}
body[data-theme="jungle"].extinct .walker{display:none}

/* The meteorite (lost game) */
.meteorite{position:fixed;z-index:70;font-size:64px;pointer-events:none;left:0;top:0;
  animation:meteorite 1.15s cubic-bezier(.5,0,.9,.6) forwards;filter:drop-shadow(0 0 18px #ff8a1f)}
@keyframes meteorite{
  from{transform:translate(105vw,-15vh) rotate(0) scale(.6)}
  to{transform:translate(46vw,48vh) rotate(-20deg) scale(1.4)}
}
.impact{position:fixed;inset:0;z-index:69;pointer-events:none;
  background:radial-gradient(circle at 50% 55%, rgba(255,255,230,.95), rgba(255,140,40,.7) 25%, rgba(120,20,0,.0) 70%);
  animation:impact 1.3s ease-out forwards}
@keyframes impact{0%{opacity:0}8%{opacity:1}100%{opacity:0}}
body.shake .layout,body.shake .topbar{animation:shakeScreen .6s ease}
@keyframes shakeScreen{0%,100%{transform:none}20%{transform:translate(-8px,4px)}40%{transform:translate(7px,-5px)}60%{transform:translate(-5px,3px)}80%{transform:translate(3px,-2px)}}
@media (prefers-reduced-motion:reduce){.meteorite,.impact{display:none}body.shake .layout,body.shake .topbar{animation:none}}
