/* Eggly opening (intro.js + egg-art.js): a dark cinematic title (night sky, rune altar, crypto eggs with rarity auras,
   the Secret BTC egg), a four-card tutorial and the first-farm coach. Scene and card art are one canvas loop; the DOM
   moves by transform / opacity only; every size from 280 px up (docs/PROTOCOL-LAYOUT.md). */
.intro {
  --i-gold: #ffc23a; --i-ink: #120a24; --i-text: #ece6ff; --i-muted: #b8acd9;
  position: fixed; inset: 0; z-index: 90; overflow: hidden; overflow: clip; color: #fff; display: flex; flex-direction: column;
  font: 500 15px/1.4 Fredoka, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; touch-action: pan-y;
  background: #07040f;
}
html.has-token .intro, html.intro-off .intro { display: none; }
body.intro-on { overflow: hidden; }
body.intro-on .toast { z-index: 130; }
.intro button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.i-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* title */
.i-title { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: clamp(4px, 1.2vh, 12px);
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom)); text-align: center; }
.i-age { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 14px; padding: 3px 9px; border-radius: 999px; font: 700 12px/1.3 Fredoka, sans-serif;
  color: #ffd9a8; border: 1.5px solid rgba(255, 190, 120, .55); background: rgba(10, 6, 24, .55); }
.i-hero { width: 100%; flex: 1 1 auto; min-height: clamp(170px, 34vh, 420px); max-height: 52vh; }
.i-logo { position: relative; width: min(86vw, 520px, 62vh); margin-top: clamp(-36px, -3vh, -8px); }
.i-logo svg { display: block; width: 100%; height: auto; overflow: visible; }
.i-flare { position: absolute; left: 50%; top: 50%; width: 140%; aspect-ratio: 3 / 1; translate: -50% -50%; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 236, 190, .9), rgba(255, 160, 60, .35) 45%, transparent); mix-blend-mode: screen; }
.i-tag { margin: 0; max-width: 24em; font-size: clamp(14px, 4.1vw, 18px); font-weight: 600; color: var(--i-text); letter-spacing: .01em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
.i-cta { display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(100%, 340px); margin-top: clamp(2px, 1vh, 10px); }
.i-play { position: relative; width: 100%; padding: 12px 18px 13px; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 1px;
  color: #2a1400 !important; background: linear-gradient(180deg, #fff1a8 0%, #ffcf3a 38%, #f59a12 72%, #ffbf3a 100%) !important;
  box-shadow: 0 0 0 2px #5a2c00, 0 6px 0 #8a4300, 0 12px 28px rgba(255, 140, 30, .35), inset 0 2px 0 rgba(255, 255, 255, .7), inset 0 -3px 0 rgba(160, 70, 0, .45); }
.i-play > span { font: 400 clamp(22px, 7vw, 28px)/1 "Lilita One", Fredoka, sans-serif; letter-spacing: .05em; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.i-play > small { font: 700 12px/1.2 Fredoka, sans-serif; color: #5a2c00; letter-spacing: .02em; }
.i-play:active { transform: translateY(4px) !important; box-shadow: 0 0 0 2px #5a2c00, 0 2px 0 #8a4300, 0 6px 14px rgba(255, 140, 30, .3), inset 0 2px 0 rgba(255, 255, 255, .7); }
.i-play:disabled { filter: saturate(.6); }
.i-play.breathe { animation: iBreathe 2.4s ease-in-out infinite; }
@keyframes iBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
.i-play::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .6) 50%, transparent 65%) -200% 0 / 200% 100% no-repeat; animation: iShine 3.4s ease-in-out 1.6s infinite; }
@keyframes iShine { 0%, 55% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.i-link { padding: 8px 10px; font-weight: 600 !important; color: var(--i-muted) !important; }
.i-link b { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.i-ticker { width: calc(100% + 32px); margin: 2px -16px 0; overflow: hidden; padding: 6px 0;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.i-tick-in { display: flex; gap: 8px; width: max-content; animation: iTick 26s linear infinite; }
@keyframes iTick { to { transform: translateX(-50%); } }
.i-coin { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 999px; white-space: nowrap;
  background: rgba(20, 12, 44, .72); border: 1px solid rgba(255, 255, 255, .12); font-size: 12px; }
.i-coin img { width: 18px; height: 18px; }
.i-coin b { font-weight: 700; color: #fff; }
.i-coin i { font-style: normal; font-weight: 600; }

/* tutorial */
.i-tut { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; min-height: 0;
  padding: max(10px, env(safe-area-inset-top)) 0 max(14px, env(safe-area-inset-bottom)); }
.i-top-row { width: min(100%, 480px); display: flex; justify-content: space-between; align-items: center; padding: 0 12px; min-height: 40px; }
.i-skip, .i-back { padding: 8px 10px; font-weight: 600 !important; color: var(--i-muted) !important; }
.i-viewport { position: relative; width: min(100%, 480px); flex: 1; min-height: 0; overflow: hidden; overflow: clip; }
.i-track { display: flex; height: 100%; will-change: transform; }
.i-slide { flex: 0 0 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(6px, 1.6vh, 16px);
  padding: 0 20px; text-align: center; min-height: 0; }
.i-art { position: relative; width: 100%; max-width: 380px; height: clamp(160px, 38vh, 320px); flex: none; }
.i-art-c { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none;
  -webkit-mask: radial-gradient(closest-side, #000 80%, transparent); mask: radial-gradient(closest-side, #000 80%, transparent); }
.i-slide h2 { margin: 0; font: 400 clamp(26px, 8vw, 36px)/1.05 "Lilita One", Fredoka, sans-serif; letter-spacing: .02em; color: #ffc23a;
  text-shadow: 2px 0 var(--i-ink), -2px 0 var(--i-ink), 0 2px var(--i-ink), 0 -2px var(--i-ink), 1.5px 1.5px var(--i-ink), -1.5px 1.5px var(--i-ink), 1.5px -1.5px var(--i-ink), -1.5px -1.5px var(--i-ink), 0 4px 0 var(--i-ink), 0 0 22px rgba(255, 150, 40, .45); }
.i-slide p { margin: 0; max-width: 21em; font-size: clamp(15px, 4.3vw, 17px); color: var(--i-text); }
.i-slide p b { color: #ffd27a; }
.i-dots { display: flex; gap: 8px; margin: 10px 0 12px; }
.i-dots i { width: 9px; height: 9px; border-radius: 9px; background: rgba(255, 255, 255, .25); transition: width .35s cubic-bezier(.3, 1.5, .5, 1), background .3s; }
.i-dots i.on { width: 26px; background: var(--i-gold); box-shadow: 0 0 10px rgba(255, 180, 60, .7); }
.i-tut .i-cta { margin: 0; padding: 0 16px; width: min(100%, 372px); }
.i-agree { display: flex; align-items: flex-start; gap: 8px; text-align: left; font-size: 13px; color: var(--i-muted); max-width: 21em; }
.i-agree input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: #f5a623; flex: none; }
.i-agree a { color: #fff; }
.a-count { position: absolute; left: 0; right: 0; top: 0; z-index: 1; text-align: center; pointer-events: none;
  font: 400 clamp(46px, 15vw, 70px)/1 "Lilita One", sans-serif; color: #ffd23f;
  text-shadow: 3px 0 var(--i-ink), -3px 0 var(--i-ink), 0 3px var(--i-ink), 0 -3px var(--i-ink), 2px 2px var(--i-ink), -2px 2px var(--i-ink), 2px -2px var(--i-ink), -2px -2px var(--i-ink), 0 5px 0 var(--i-ink), 0 0 26px rgba(255, 170, 40, .7); }
.a-count small { display: block; margin-top: 2px; font: 700 13px/1.2 Fredoka, sans-serif; color: #fff; letter-spacing: .08em; text-shadow: 0 2px 4px rgba(0, 0, 0, .8); }

/* coach (signed in, first farm): a spotlight hole + a bubble, one tap per step */
.coach { position: fixed; inset: 0; z-index: 95; -webkit-tap-highlight-color: transparent; }
.coach-hole { position: absolute; left: 0; top: 0; border-radius: 16px; pointer-events: none; box-shadow: 0 0 0 200vmax rgba(8, 5, 26, .72);
  transition: transform .45s cubic-bezier(.3, 1.25, .5, 1), width .45s cubic-bezier(.3, 1.25, .5, 1), height .45s cubic-bezier(.3, 1.25, .5, 1); }
.coach-hole::after { content: ""; position: absolute; inset: -6px; border-radius: 20px; border: 3px solid #ffc23a; animation: cPulse 1.4s ease-out infinite; }
@keyframes cPulse { 0% { opacity: .9; transform: scale(.96); } 100% { opacity: 0; transform: scale(1.12); } }
.coach-tip { position: absolute; left: 16px; right: 16px; max-width: 340px; margin: 0 auto; padding: 14px 16px 12px; border-radius: 18px; color: #fff;
  background: linear-gradient(180deg, #2a1d55, #150d30); border: 2px solid rgba(255, 194, 58, .6); box-shadow: 0 12px 30px rgba(0, 0, 0, .5), 0 0 24px rgba(255, 160, 40, .2);
  font: 500 15px/1.4 Fredoka, system-ui, sans-serif; transition: top .4s cubic-bezier(.3, 1.2, .5, 1), opacity .25s; }
.coach-tip b { display: block; margin-bottom: 2px; font: 400 20px/1.15 "Lilita One", Fredoka, sans-serif; color: #ffc23a; }
.coach-tip .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.coach-tip .row small { color: #b8acd9; font-size: 13px; }
.coach-tip button { font: 700 15px/1 Fredoka, sans-serif; padding: 10px 18px; border-radius: 12px; border: 0; cursor: pointer; color: #2a1400;
  background: linear-gradient(180deg, #fff1a8, #ffc23a 50%, #f59a12); box-shadow: 0 3px 0 #8a4300; }

@media (max-height: 560px) {
  .i-hero { min-height: 120px; }
  .i-ticker { display: none; }
  .i-art { height: clamp(120px, 34vh, 200px); }
}
@media (prefers-reduced-motion: reduce) {
  .i-play.breathe, .i-play::after, .i-tick-in, .coach-hole::after { animation: none !important; }
}
