/* dino «عالم الديناصورات» — baby-dino colour switches with body.dino-* (data.js theme.dino) */
:root, .dino-green {
  --bg: #f4fbef; --bg-2: #dff3d6; --surface: #ffffff; --surface-2: #f5fbf1;
  --text: #33402c; --muted: #6c7a62;
  --accent: #2f7a3a; --accent-2: #ffd27a; --accent-ink: #ffffff;
  --line: rgba(47, 122, 58, .24); --line-soft: rgba(47, 122, 58, .10);
  --dino: #7fcb6c; --dino-line: #4f9a45; --belly: #eaf7c9; --spot: #5aae4c; --spike: #f7b545;
}
.dino-blue {
  --bg: #f1f8ff; --bg-2: #dcedfc; --surface-2: #f3f8fe;
  --accent: #2366a6; --line: rgba(35, 102, 166, .24); --line-soft: rgba(35, 102, 166, .10);
  --dino: #74b9ee; --dino-line: #3f84bf; --belly: #e4f3ff; --spot: #4d98d6; --spike: #ffb35c;
}
.dino-orange {
  --bg: #fff7ef; --bg-2: #ffe7d2; --surface-2: #fff8f2;
  --accent: #b5521a; --accent-2: #ffd27a; --line: rgba(181, 82, 26, .24); --line-soft: rgba(181, 82, 26, .10);
  --dino: #ffa55e; --dino-line: #d4742c; --belly: #fff0d6; --spot: #ef8a3b; --spike: #6fc1a5;
}
body.dino { background: linear-gradient(180deg, var(--bg-2), var(--bg) 600px), var(--bg); }

/* ---------- intro (rendered art layers in art/*.webp) ---------- */
.d-intro { padding: 0; background: #7fa85a; display: grid; place-items: center; }
.d-fill { position: absolute; inset: -30px; background: #7fa85a url(art/bg.webp) center / cover; filter: blur(20px); transform: scale(1.06); }
.d-stage { position: relative; width: min(100vw, 100dvh * .6); height: 100dvh; overflow: hidden; display: flex; flex-direction: column; align-items: center; color: #fff; }
.d-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
.d-motes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.d-motes i { position: absolute; bottom: -12px; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle, #fff8c8, rgba(255,240,150,0) 70%); animation: dMote linear infinite; }
@keyframes dMote { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .95; } 100% { transform: translate(24px, -105dvh); opacity: 0; } }

.d-greet { position: relative; z-index: 3; text-align: center; margin-top: max(4dvh, calc(env(safe-area-inset-top) + 18px)); padding-inline: 16px; transition: opacity .5s, transform .5s var(--ease); text-shadow: 0 2px 12px rgba(20, 60, 10, .7), 0 0 3px rgba(20,60,10,.5); }
.d-hello { margin: 0; font: 600 17px/1.5 var(--f-ui); }
.d-line { margin: 2px 0 0; font: 900 clamp(26px, 8vw, 34px)/1.35 var(--f-display); text-wrap: balance; }

.d-hatch { --w: min(92vw, 400px, 44dvh); position: absolute; z-index: 3; left: 50%; bottom: 9dvh; width: var(--w); height: calc(var(--w) * 1.25); transform: translateX(-50%); }
.d-hatch > * { position: absolute; }
.d-hatch > :not(.d-egg) { pointer-events: none; }
.d-egg { left: 13%; bottom: 0; width: 74%; aspect-ratio: 480 / 576; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transform-origin: 50% 100%; animation: dWobble 2.8s ease-in-out infinite; filter: drop-shadow(0 14px 10px rgba(30, 50, 10, .45)); touch-action: manipulation; }
.d-egg:focus-visible { outline-offset: 8px; border-radius: 40%; }
.d-egg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.d-egg-b { opacity: 0; transition: opacity .35s; }
@keyframes dWobble { 0%, 60%, 100% { transform: rotate(0); } 68% { transform: rotate(-2.2deg); } 76% { transform: rotate(2deg); } 84% { transform: rotate(-1.2deg); } }
.d-egg.is-tap { animation: dShake .45s ease-in-out; }
@keyframes dShake { 15% { transform: rotate(-7deg) scale(1.03); } 35% { transform: rotate(6deg) scale(1.03); } 55% { transform: rotate(-4deg); } 75% { transform: rotate(3deg); } }
.d-intro.s1 .d-egg-b { opacity: .45; } .d-intro.s2 .d-egg-b { opacity: .8; } .d-intro.s3 .d-egg-b { opacity: 1; }

.d-cap { left: 13%; bottom: 0; width: 74%; aspect-ratio: 480 / 576; background: url(art/egg-crack.webp) center / 100% 100% no-repeat; opacity: 0; pointer-events: none; transform-origin: 50% 40%;
  clip-path: polygon(0 0, 100% 0, 100% 46%, 90% 54%, 78% 44%, 64% 54%, 50% 44%, 36% 54%, 22% 44%, 10% 54%, 0 46%); filter: drop-shadow(0 8px 6px rgba(30,50,10,.3)); }
.d-shell { left: 7%; bottom: -2%; width: 86%; height: auto; z-index: 3; opacity: 0; transform: scale(.7); transform-origin: 50% 100%; transition: opacity .3s .15s, transform .6s var(--spring) .15s; filter: drop-shadow(0 12px 8px rgba(30,50,10,.4)); }
.d-baby { left: 18%; width: 64%; bottom: 16%; z-index: 2; transform: translateY(58%) scale(.8); opacity: 0; transform-origin: 50% 100%; transition: transform .9s var(--spring) .35s, opacity .2s .3s; }
.d-baby img { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 6px rgba(30,50,10,.3)); }
.d-baby-b { position: absolute !important; left: 0; top: 0; opacity: 0; transition: opacity .4s; }
.d-sign { left: 8%; top: -6%; width: 84%; z-index: 1; opacity: 0; transform: translateY(26%) scale(.6); transform-origin: 50% 100%; transition: transform .9s var(--spring) .6s, opacity .3s .55s; }
.d-sign img { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 8px rgba(30,50,10,.35)); }
.d-sign-txt { position: absolute; left: 9%; right: 9%; top: 15%; height: 37%; display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff4d9; }
.d-sign-age { flex: none; display: grid; place-items: center; width: clamp(46px, 14vw, 62px); aspect-ratio: 1; border-radius: 50%; background: var(--dino); color: #fff; font: 900 clamp(28px, 9vw, 40px)/1 var(--f-display); box-shadow: inset 0 0 0 3px rgba(255,255,255,.55), 0 3px 0 rgba(0,0,0,.18); text-shadow: 0 2px 0 rgba(0,0,0,.2); padding-top: 3px; }
.d-sign-col { display: grid; justify-items: center; min-width: 0; line-height: 1.15; text-align: center; }
.d-sign-name { font: 900 clamp(26px, 8.4vw, 38px)/1.15 var(--f-display); overflow-wrap: anywhere; text-shadow: 0 2px 0 #5a3512, 0 0 8px rgba(60,30,5,.5); }
.d-sign-sub { font: 700 clamp(11.5px, 3.3vw, 14px)/1.3 var(--f-ui); color: #ffe7b8; text-shadow: 0 1px 0 #5a3512; }

.d-hint { position: absolute; z-index: 5; bottom: 3.2dvh; inset-inline: 0; margin: 0; display: grid; justify-items: center; gap: 6px; font: 700 15px/1.4 var(--f-ui); color: #fff; text-shadow: 0 1px 8px rgba(20,50,10,.7); animation: dHint 1.8s ease-in-out infinite; transition: opacity .3s; }
@keyframes dHint { 50% { opacity: .65; transform: translateY(-3px); } }
.d-pips { display: flex; gap: 8px; }
.d-pips i { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,.45); transition: background-color .3s, transform .3s var(--spring); }
.d-pips i.on { background: var(--spike); transform: scale(1.3); }
.d-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* hatched state */
.d-intro.is-hatched .d-greet { opacity: 0; transform: translateY(-14px); }
.d-intro.is-hatched .d-hint { opacity: 0; animation: none; }
.d-intro.is-hatched .d-egg { opacity: 0; pointer-events: none; animation: none; transition: opacity .15s; }
.d-intro.is-hatched .d-cap { animation: dCap 1.2s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes dCap { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(26%, -150%) rotate(38deg); } }
.d-intro.is-hatched .d-shell { opacity: 1; transform: none; }
.d-intro.is-hatched .d-baby { opacity: 1; transform: none; }
.d-intro.is-hatched .d-sign { opacity: 1; transform: none; }
.d-intro.is-hatched .d-baby, .d-intro.is-hatched .d-sign { animation: dSway 3.6s ease-in-out 1.8s infinite; }
@keyframes dSway { 50% { translate: 0 -5px; } }
.d-intro.is-cheer .d-baby-a { opacity: 0; } .d-intro.is-cheer .d-baby-b { opacity: 1; }
.d-intro.is-cheer .d-baby { animation: dCheer 1.2s ease-in-out infinite; }
@keyframes dCheer { 50% { translate: 0 -8px; } }

.d-confetti { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.d-confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; opacity: .95; animation: dFall linear forwards; }
.d-confetti i.leaf { width: 14px; height: 8px; border-radius: 0 100% 0 100%; }
@keyframes dFall { to { transform: translate3d(var(--dx), 110dvh, 0) rotate(var(--rot)); } }

/* ---------- details card skin ---------- */
.dino .card-frame { border: 3px solid var(--line); border-radius: 34px; box-shadow: 0 16px 40px rgba(47, 90, 40, .12); }
.dino .card-frame::before { content: ''; position: absolute; inset: 8px; border-radius: 26px; border: 2px dashed var(--line-soft); pointer-events: none; }
.dino .card-hero img { width: 190px; height: auto; margin-inline: auto; filter: drop-shadow(0 6px 6px rgba(40,80,30,.25)); }
.dino .cd { border-radius: 22px; }
.dino .facts li { border-radius: 20px; }

@media (prefers-reduced-motion: reduce) {
  .d-egg, .d-hint, .d-motes i, .d-intro.is-hatched .d-baby, .d-intro.is-hatched .d-sign, .d-intro.is-cheer .d-baby { animation: none !important; }
  .d-motes { display: none; }
  .d-shell, .d-baby, .d-sign, .d-egg-b { transition-duration: .01s !important; transition-delay: 0s !important; }
  .d-intro.is-hatched .d-cap { animation: none; opacity: 0; }
}
