/* ============================================================
   idle-engine — "8-bit dusk"
   Cozy lo-fi pixel style. Colors come entirely from the theme (--bg/--panel/--accent/--text);
   This file only provides pixel-perfect shape, texture, and motion.
   ============================================================ */

:root {
  --bg: #0f1115; --panel: #1a1e26; --accent: #facc15; --text: #e5e7eb;
  /* Fixed pixel-look derivatives that do not depend on the theme. */
  --edge: rgba(0,0,0,.55);      /* Hard pixel edge and shadow. */
  --hi: rgba(255,255,255,.10);  /* Upper bevel highlight. */
  --u: 4px;                     /* Pixel unit for offsets. */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { image-rendering: pixelated; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pixelify Sans", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
}

/* --- Pixel background: scaled low-resolution scene canvas --- */
#scene {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%;
  image-rendering: pixelated;
}

/* --- Atmosphere: CRT scanlines --- */
#scanlines {
  position: absolute; inset: 0; pointer-events: none; z-index: 100; opacity: .15;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,.5) 2px 3px);
  mix-blend-mode: multiply;
}
body.embedded-preview #scanlines { opacity: .06; mix-blend-mode: normal; }

/* Layout: full-screen scene; the duck floats in the water and the shop sits in
   a side panel. --panel-w is the panel width; the duck centers in the rest. */
:root { --panel-w: 340px; }
#app { position: relative; z-index: 1; min-height: 100dvh; overflow: hidden; cursor: pointer; }

/* Top bar. */
header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding: 14px 16px;
}
#wallet-area { display: flex; align-items: flex-start; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* HUD: counter floating above, centered over the free area (viewport - panel). */
#hud {
  position: absolute; top: 58px; z-index: 30;
  left: calc((100vw - var(--panel-w)) / 2); transform: translateX(-50%);
  text-align: center; pointer-events: none; width: max-content;
}

/* The duck starts in the left third while the world moves around it. */
#clicker {
  position: absolute; z-index: 20;
  top: 61%; left: clamp(104px, 12vw, 190px);
  transform: translate(-50%, -50%); text-align: center;
}

/* Scrollable right-side panel. */
#panel {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 35;
  width: var(--panel-w); padding: 58px 14px 20px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-left: 2px solid var(--edge);
  backdrop-filter: blur(2px);
  display: flex; flex-direction: column; gap: 10px;
  cursor: default;
}
#panel > h2:first-child { margin-top: 4px; }
body[data-scene="day"] #panel { background: color-mix(in srgb, var(--bg) 66%, transparent); }
body[data-scene="sunset"] #panel { background: color-mix(in srgb, var(--bg) 74%, transparent); }
body[data-scene="night"] #panel,
body[data-scene="dawn"] #panel { background: color-mix(in srgb, var(--bg) 84%, transparent); }
body.embedded-preview #panel { backdrop-filter: none; }

/* Mobile and narrow screens: stack everything in normal flow. */
@media (max-width: 720px) {
  header { position: absolute; }
  #hud {
    position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
    margin: 0; width: max-content;
  }
  #clicker {
    position: absolute; left: 24%; top: 54dvh;
    transform: translate(-50%, -50%); margin: 0;
  }
  #panel {
    position: relative; width: auto; height: auto; margin-top: 72dvh; padding: 14px 12px 28px;
    border-left: none; border-top: 2px solid var(--edge); backdrop-filter: none;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
  }
  #app { display: flow-root; min-height: 100dvh; padding-bottom: 0; overflow: visible; }
}

/* --- Typography --- */
h1 {
  font-family: "Silkscreen", monospace; font-weight: 700;
  font-size: 1.15rem; letter-spacing: .5px; line-height: 1.3;
  color: var(--accent);
  text-shadow: var(--u) var(--u) 0 var(--edge);
}
h2 {
  font-family: "Silkscreen", monospace; font-size: .72rem;
  letter-spacing: 1px; text-transform: uppercase; opacity: .75; margin-bottom: 10px;
}

header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

/* --- Reusable pixel box: light top bevel, hard bottom shadow, no rounded corners --- */
.px {
  background: var(--panel);
  border: 2px solid var(--edge);
  box-shadow: inset 0 2px 0 var(--hi), var(--u) var(--u) 0 var(--edge);
}

/* --- clicker (canvas pixel) --- */
#clicker { text-align: center; padding: 8px 0 4px; }
#coin-wrap {
  --duck-y: 0px;
  position: relative; display: inline-block;
  transform: translateY(var(--duck-y));
  will-change: transform;
}
#coin {
  display: block; cursor: pointer; user-select: none;
  image-rendering: pixelated;
  filter: drop-shadow(3px 3px 0 var(--edge));
  animation: swimBody 1.1s steps(4, end) infinite;
  transform-origin: 50% 72%;
  transition: transform .06s steps(2);
}
body.embedded-preview #coin-wrap { will-change: auto; }
#coin:active { transform: scale(.9) translateY(4px); }
#coin:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
#duck-wake {
  position: absolute; z-index: -1; left: -26px; right: -26px; bottom: 8px;
  height: 18px; opacity: .8;
  border-top: 3px solid color-mix(in srgb, var(--text) 38%, transparent);
  border-left: 16px solid transparent; border-right: 16px solid transparent;
  animation: wakePulse 1.2s steps(5) infinite;
}
#duck-wake::before, #duck-wake::after {
  content: ""; position: absolute; top: 6px; width: 24px; height: 2px;
  background: color-mix(in srgb, var(--text) 32%, transparent);
}
#duck-wake::before { left: -10px; transform: rotate(-12deg); }
#duck-wake::after { right: -10px; transform: rotate(12deg); }
.gen-icon { image-rendering: pixelated; flex-shrink: 0; filter: drop-shadow(2px 2px 0 var(--edge)); }
@keyframes swimBody {
  0%,100% { transform: translateY(0) rotate(-.5deg); }
  25% { transform: translateY(-2px) rotate(0); }
  50% { transform: translateY(1px) rotate(.5deg); }
  75% { transform: translateY(-1px) rotate(0); }
}
@keyframes wakePulse {
  0% { transform: scaleX(.65); opacity: .8; }
  100% { transform: scaleX(1.18) translateY(5px); opacity: 0; }
}

#counter {
  font-family: "Silkscreen", monospace; font-weight: 700;
  font-size: 1.7rem; color: var(--text);
  font-variant-numeric: tabular-nums;
  text-shadow: 2px 2px 0 var(--edge), 0 0 8px var(--bg);
}
#rate {
  font-family: "Silkscreen", monospace; font-size: .72rem;
  opacity: .6; margin-top: 4px; letter-spacing: .5px;
}

/* --- Generator shop --- */
#shop { display: flex; flex-direction: column; gap: 10px; }
.gen {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--panel);
  border: 2px solid var(--edge);
  box-shadow: inset 0 2px 0 var(--hi), var(--u) var(--u) 0 var(--edge);
  padding: 12px 14px; color: var(--text); cursor: pointer; text-align: left;
  font-family: inherit; font-size: 1rem;
  transition: transform .06s steps(2), box-shadow .06s steps(2), filter .1s;
}
.gen:not(:disabled):hover { filter: brightness(1.12); }
.gen:not(:disabled):active {
  transform: translate(var(--u), var(--u));
  box-shadow: inset 0 2px 0 var(--hi), 0 0 0 var(--edge);
}
.gen:disabled { opacity: .4; cursor: default; filter: saturate(.4); }
.gen .info { flex: 1; min-width: 0; }
.gen .name { font-weight: 600; font-size: 1.05rem; }
.gen .name small { opacity: .55; font-size: .8rem; }
.gen .meta { font-family: "Silkscreen", monospace; font-size: .62rem; opacity: .6; margin-top: 2px; letter-spacing: .5px; }
.gen .price {
  font-family: "Silkscreen", monospace; font-weight: 700; font-size: .8rem;
  color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap;
  text-shadow: 1px 1px 0 var(--edge);
}

/* --- Visual lab: only visible with ?dev=1 --- */
[hidden] { display: none !important; }
#dev-tools {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px;
  background: color-mix(in srgb, var(--panel) 90%, #000);
  border: 2px solid var(--accent);
  box-shadow: inset 0 2px 0 var(--hi), var(--u) var(--u) 0 var(--edge);
}
.dev-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dev-heading h2 { color: var(--accent); opacity: 1; margin: 0; }
.dev-heading span {
  font-family: "Silkscreen", monospace; font-size: .54rem;
  letter-spacing: .4px; opacity: .58; text-transform: uppercase;
}
.dev-group { display: flex; flex-direction: column; gap: 6px; }
.dev-time-row, .dev-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.dev-time-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dev-gen-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 30px 34px 30px;
  align-items: center; gap: 4px;
  font-size: .82rem;
}
.dev-count { font-family: "Silkscreen", monospace; font-size: .65rem; text-align: center; }
.dev-button {
  min-height: 30px; padding: 6px 5px;
  border: 2px solid var(--edge); border-radius: 0;
  background: color-mix(in srgb, var(--panel) 72%, var(--text)); color: var(--text);
  box-shadow: inset 0 2px 0 var(--hi), 2px 2px 0 var(--edge);
  font-family: "Silkscreen", monospace; font-size: .56rem; cursor: pointer;
}
.dev-button:hover, .dev-button.is-active { color: #000; background: var(--accent); }
.dev-button:active { transform: translate(2px, 2px); box-shadow: none; }

/* --- botones cta pixel --- */
button.cta, #btn-prestige, #btn-wallet, #modal-ok, #wallet-gate-connect {
  font-family: "Silkscreen", monospace; font-weight: 700; font-size: .78rem;
  letter-spacing: .5px;
  background: var(--accent); color: #000;
  border: 2px solid var(--edge);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), var(--u) var(--u) 0 var(--edge);
  padding: 11px 16px; cursor: pointer;
  transition: transform .06s steps(2), box-shadow .06s steps(2);
}
button.cta:active, #btn-prestige:active, #btn-wallet:active, #modal-ok:active, #wallet-gate-connect:active {
  transform: translate(var(--u), var(--u));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 0 0 var(--edge);
}
#btn-prestige { width: 100%; }
#btn-wallet { font-size: .68rem; padding: 8px 12px; }
#wallet-gate-connect:disabled, #wallet-gate-skip:disabled { opacity: .48; cursor: wait; }

/* --- badges --- */
.badge {
  font-family: "Silkscreen", monospace; font-size: .6rem; letter-spacing: .5px;
  background: var(--accent); color: #000; padding: 5px 8px;
  border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--edge);
  display: inline-block; margin-top: 4px;
}

/* --- leaderboard --- */
#leaderboard { list-style: none; display: flex; flex-direction: column; gap: 5px; counter-reset: rank; }
#leaderboard li {
  counter-increment: rank;
  background: var(--panel); border: 2px solid var(--edge);
  box-shadow: inset 0 2px 0 var(--hi);
  padding: 8px 12px; font-size: .95rem;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
#leaderboard li::before {
  content: counter(rank);
  font-family: "Silkscreen", monospace; font-size: .7rem;
  color: var(--accent); min-width: 22px; opacity: .8;
}
#leaderboard li span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#leaderboard li span:last-of-type { font-family: "Silkscreen", monospace; font-size: .72rem; color: var(--accent); }
#leaderboard li.me { border-color: var(--accent); box-shadow: inset 0 2px 0 var(--hi), 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
#name-row { margin-top: 12px; }
#player-name {
  font-family: inherit; font-size: 1rem;
  background: var(--bg); border: 2px solid var(--edge); color: var(--text);
  padding: 10px 12px; width: 100%;
  box-shadow: inset 2px 2px 0 var(--edge);
}
#player-name:focus { outline: none; border-color: var(--accent); }

/* --- modal --- */
#modal { position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; padding: 20px; }
#modal[hidden] { display: none; }
#modal-box {
  background: var(--panel); border: 2px solid var(--edge);
  box-shadow: inset 0 2px 0 var(--hi), 8px 8px 0 var(--edge);
  padding: 26px 24px; max-width: 320px; text-align: center;
  display: flex; flex-direction: column; gap: 18px;
  animation: modalPop .18s steps(3);
}
#modal-text { font-size: 1.05rem; line-height: 1.5; }
@keyframes modalPop { from { transform: scale(.85); opacity: 0; } }

/* --- Optional wallet onboarding --- */
body.wallet-gate-open { overflow: hidden; }
#wallet-gate {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center; padding: 20px;
  background: rgba(7, 10, 18, .84);
}
#wallet-gate[hidden] { display: none; }
#wallet-gate-box {
  width: min(540px, 100%);
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 18px 22px;
  padding: 28px;
  background: var(--panel); border: 3px solid var(--edge);
  box-shadow: inset 0 3px 0 var(--hi), 10px 10px 0 var(--edge);
  animation: walletGateIn .2s steps(4);
}
.wallet-gate-mark {
  position: relative; width: 64px; height: 64px;
  background: var(--accent); border: 3px solid var(--edge);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.35), 4px 4px 0 var(--edge);
}
.wallet-gate-mark::before, .wallet-gate-mark::after, .wallet-gate-mark span {
  content: ""; position: absolute; background: var(--edge);
}
.wallet-gate-mark::before { left: 13px; right: 13px; top: 18px; height: 5px; }
.wallet-gate-mark::after { left: 13px; right: 13px; top: 31px; height: 5px; }
.wallet-gate-mark span { width: 7px; height: 7px; right: 11px; bottom: 10px; }
.wallet-gate-copy { align-self: center; }
.wallet-gate-copy h2 {
  margin: 0 0 10px; color: var(--accent); opacity: 1;
  font-size: .92rem; line-height: 1.45;
}
#wallet-gate-text { font-size: 1.08rem; line-height: 1.42; }
#wallet-gate-privacy { margin-top: 10px; font-size: .85rem; line-height: 1.4; opacity: .66; }
#wallet-gate-status {
  grid-column: 1 / -1; min-height: 22px;
  font-family: "Silkscreen", monospace; font-size: .62rem; line-height: 1.45;
  color: var(--accent);
}
#wallet-gate-status:empty { display: none; }
#wallet-gate-status[data-state="warning"] { color: #ffb86b; }
.wallet-gate-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#wallet-gate-connect { width: 100%; }
#wallet-gate-skip {
  width: 100%; padding: 11px 16px; cursor: pointer;
  font-family: "Silkscreen", monospace; font-size: .72rem; font-weight: 700;
  color: var(--text); background: transparent; border: 2px solid color-mix(in srgb, var(--text) 38%, transparent);
  box-shadow: 4px 4px 0 var(--edge);
}
#wallet-gate-skip:active { transform: translate(4px, 4px); box-shadow: none; }
#wallet-gate-later {
  grid-column: 1 / -1; text-align: center;
  font-size: .78rem; opacity: .5;
}
@keyframes walletGateIn { from { transform: translateY(12px); opacity: 0; } }

/* --- Description below the game --- */
#about-game {
  position: relative; z-index: 90; margin-top: 0;
  min-height: 0; background: var(--bg); border-top: 4px solid var(--accent);
  box-shadow: 0 -8px 0 var(--edge);
}
.about-inner { width: min(1080px, 100%); margin: 0 auto; padding: 72px 32px 56px; }
.about-intro {
  display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px;
  align-items: start; padding-bottom: 44px;
}
#about-title {
  margin: 0; color: var(--accent); opacity: 1;
  font-size: 1.35rem; line-height: 1.5; text-transform: none;
  text-shadow: 3px 3px 0 var(--edge);
}
#about-description { max-width: 60ch; font-size: 1.18rem; line-height: 1.55; opacity: .82; }
.about-columns {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 2px solid color-mix(in srgb, var(--text) 22%, transparent);
  border-bottom: 2px solid color-mix(in srgb, var(--text) 22%, transparent);
}
.about-play, .about-drops { padding: 34px 0 36px; }
.about-play { padding-right: 42px; }
.about-drops { padding-left: 42px; border-left: 2px solid color-mix(in srgb, var(--text) 22%, transparent); }
.about-columns h3 {
  margin-bottom: 22px; color: var(--accent);
  font-family: "Silkscreen", monospace; font-size: .76rem; line-height: 1.4; text-transform: uppercase;
}
#about-steps { list-style: none; counter-reset: about-step; display: grid; gap: 18px; }
#about-steps li { counter-increment: about-step; position: relative; padding-left: 42px; font-size: 1rem; line-height: 1.42; }
#about-steps li::before {
  content: counter(about-step); position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px; display: grid; place-items: center;
  color: #111; background: var(--accent); border: 2px solid var(--edge);
  font-family: "Silkscreen", monospace; font-size: .58rem; font-weight: 700;
}
#about-drops-description { font-size: 1.08rem; line-height: 1.5; }
.about-wallet-note {
  margin-top: 24px; padding: 14px 0 0 18px;
  border-left: 4px solid var(--accent); font-size: .9rem; line-height: 1.45; opacity: .68;
}

/* --- Seven-day public launch route --- */
#launch-roadmap {
  position: relative; z-index: 90;
  color: var(--text); background: var(--panel);
  border-top: 2px solid color-mix(in srgb, var(--text) 20%, transparent);
}
.roadmap-inner { width: min(1180px, 100%); margin: 0 auto; padding: 72px 32px 78px; }
.roadmap-heading { display: grid; grid-template-columns: .42fr .78fr 1.2fr; gap: 34px; align-items: start; }
#roadmap-kicker {
  margin: 4px 0 0; color: var(--accent);
  font-family: "Silkscreen", monospace; font-size: .66rem; line-height: 1.5; text-transform: uppercase;
}
#roadmap-title { margin: 0; font-size: 1.28rem; line-height: 1.5; text-shadow: 3px 3px 0 var(--edge); }
#roadmap-description { margin: 0; max-width: 58ch; font-size: 1.04rem; line-height: 1.55; opacity: .76; }
#roadmap-days {
  list-style: none; margin: 42px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 2px solid var(--edge); box-shadow: 8px 8px 0 var(--edge);
}
#roadmap-days li {
  min-height: 228px; padding: 18px 16px 20px;
  background: var(--bg); border-right: 2px solid var(--edge);
}
#roadmap-days li:last-child { border-right: 0; }
.roadmap-day {
  display: inline-block; margin-bottom: 22px; padding: 5px 7px;
  color: #111; background: var(--accent);
  font-family: "Silkscreen", monospace; font-size: .52rem; line-height: 1.4;
}
#roadmap-days strong { display: block; min-height: 42px; color: var(--text); font-family: "Silkscreen", monospace; font-size: .66rem; line-height: 1.45; }
#roadmap-days p { margin: 14px 0 0; font-size: .86rem; line-height: 1.45; opacity: .68; }
#roadmap-note { margin: 26px 0 0; padding-left: 16px; border-left: 4px solid var(--accent); font-size: .84rem; line-height: 1.5; opacity: .66; }

#site-footer {
  position: relative; z-index: 90; display: flex; justify-content: space-between; gap: 24px;
  padding: 26px max(24px, calc((100vw - 1180px) / 2)); color: var(--text); background: var(--bg);
  border-top: 2px solid var(--edge); font-size: .82rem;
}
#site-footer p { margin: 0; opacity: .55; }
#site-footer nav { display: flex; gap: 20px; }
#site-footer a { color: var(--accent); font-family: "Silkscreen", monospace; font-size: .58rem; text-decoration: none; }
#site-footer a:hover, #site-footer a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }

/* --- Tier skins for holders and whales --- */
body.theme-holder #coin { filter: drop-shadow(3px 3px 0 var(--edge)) drop-shadow(0 0 12px var(--accent)); }
body.theme-holder #counter { color: var(--accent); }
body.theme-whale h1::after { content: " 🐋"; }

/* --- Floating numbers on click --- */
.float {
  position: absolute; pointer-events: none; z-index: 50;
  font-family: "Silkscreen", monospace; font-weight: 700; font-size: 1rem;
  color: var(--accent); text-shadow: 2px 2px 0 var(--edge);
  animation: floatUp .8s steps(8) forwards;
}
@keyframes floatUp { to { transform: translateY(-52px); opacity: 0; } }

/* --- Pixel particles on click --- */
.particle {
  position: absolute; pointer-events: none; z-index: 49;
  width: 5px; height: 5px; background: var(--accent);
  box-shadow: 1px 1px 0 var(--edge);
  animation: particleFly .5s steps(5) forwards;
}
@keyframes particleFly {
  to { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}

/* --- Stats and audio button --- */
#stats {
  font-family: "Silkscreen", monospace; font-size: .6rem;
  opacity: .45; margin-top: 6px; letter-spacing: .5px;
}
#drop-status {
  display: flex; justify-content: center; gap: 8px; margin: 9px auto 0;
  width: max-content; max-width: 280px; padding: 5px 8px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 2px solid color-mix(in srgb, var(--text) 22%, transparent);
  box-shadow: 2px 2px 0 var(--edge);
  font-family: "Silkscreen", monospace; font-size: .55rem;
  pointer-events: none;
}
#drop-label { color: var(--accent); }
#drop-detail { opacity: .72; }
#drop-status[data-state="eligible"] { border-color: var(--accent); }
#btn-audio {
  font-family: "Silkscreen", monospace; font-size: .62rem; font-weight: 700;
  background: var(--panel); color: var(--text);
  border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--edge);
  padding: 6px 9px; cursor: pointer;
}
#btn-audio:active { transform: translate(2px, 2px); box-shadow: none; }

/* --- Floating bonus: golden egg crossing the river --- */
#bonus {
  position: absolute; left: 100vw; z-index: 60;
  background: none; border: none; padding: 8px; cursor: pointer;
  animation: bonusCross 11s linear forwards, bonusBob 1.2s steps(4) infinite;
  filter: drop-shadow(2px 2px 0 var(--edge)) drop-shadow(0 0 10px #ffd84d);
}
#bonus canvas { image-rendering: pixelated; display: block; }
#bonus:active { transform: scale(.85); }
@keyframes bonusCross { to { left: -100px; } }
@keyframes bonusBob { 50% { margin-top: -6px; } }

/* --- Holder drop: visual only; real transfers happen on the backend --- */
.holder-drop {
  position: absolute; left: var(--drop-x); top: -90px; z-index: 24;
  width: 54px; height: 76px; pointer-events: none;
  filter: drop-shadow(3px 3px 0 var(--edge));
  animation: holderDropFall 4.2s steps(32) forwards;
}
.drop-chute {
  display: block; width: 52px; height: 22px;
  background: var(--accent); border: 3px solid var(--edge);
  clip-path: polygon(50% 0, 88% 18%, 100% 100%, 0 100%, 12% 18%);
}
.drop-lines {
  display: block; width: 34px; height: 25px; margin: 0 auto;
  border-left: 2px solid var(--text); border-right: 2px solid var(--text);
}
.drop-crate {
  display: block; width: 30px; height: 24px; margin: -2px auto 0;
  background: #9a6438; border: 3px solid var(--edge);
  box-shadow: inset 0 0 0 3px #d39a54;
}
@keyframes holderDropFall {
  0% { transform: translateY(0) rotate(-3deg); }
  45% { transform: translateY(36vh) rotate(3deg); }
  82% { transform: translateY(66vh) rotate(-2deg); opacity: 1; }
  100% { transform: translateY(70vh) scale(.8); opacity: 0; }
}

/* --- Active frenzy: the world visually speeds up --- */
body.frenzy #counter { color: var(--accent); animation: frenzyPulse .5s steps(2) infinite; }
body.frenzy #coin { filter: drop-shadow(3px 3px 0 var(--edge)) drop-shadow(0 0 16px var(--accent)); }
@keyframes frenzyPulse { 50% { opacity: .75; } }

/* --- Evolution toast --- */
.burst {
  position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%); z-index: 105;
  font-family: "Silkscreen", monospace; font-size: 1rem; text-align: center;
  color: var(--accent); text-shadow: 3px 3px 0 var(--edge);
  padding: 12px 18px; background: var(--panel); border: 2px solid var(--edge);
  box-shadow: 6px 6px 0 var(--edge);
  animation: burstIn .2s steps(3), burstOut .3s steps(3) 1.1s forwards;
}
@keyframes burstIn { from { transform: translate(-50%, -50%) scale(.6); opacity: 0; } }
@keyframes burstOut { to { transform: translate(-50%, -80%) scale(1); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #coin, #duck-wake, #stars, .holder-drop { animation: none; }
}

@media (max-width: 720px) {
  #about-game { margin-top: 0; min-height: 0; }
  .about-inner { padding: 48px 20px 64px; }
  .about-intro, .about-columns { grid-template-columns: 1fr; gap: 0; }
  .about-intro { padding-bottom: 34px; }
  #about-title { margin-bottom: 20px; font-size: 1.08rem; }
  #about-description { font-size: 1.04rem; }
  .about-play { padding-right: 0; }
  .about-drops { padding-left: 0; border-left: 0; border-top: 2px solid color-mix(in srgb, var(--text) 22%, transparent); }
  .roadmap-inner { padding: 52px 20px 58px; }
  .roadmap-heading { grid-template-columns: 1fr; gap: 18px; }
  #roadmap-title { font-size: 1.05rem; }
  #roadmap-days { grid-template-columns: 1fr; }
  #roadmap-days li { min-height: 0; border-right: 0; border-bottom: 2px solid var(--edge); }
  #roadmap-days li:last-child { border-bottom: 0; }
  #roadmap-days strong { min-height: 0; }
  #site-footer { flex-direction: column; padding: 24px 20px 30px; }
  #wallet-gate-box { grid-template-columns: 52px minmax(0, 1fr); gap: 16px; padding: 20px; }
  .wallet-gate-mark { width: 48px; height: 48px; }
  .wallet-gate-mark::before { left: 9px; right: 9px; top: 13px; }
  .wallet-gate-mark::after { left: 9px; right: 9px; top: 25px; }
  .wallet-gate-actions { grid-template-columns: 1fr; }
}
