/* Draggo card ($DEGG). Colours come from the brand art; swap them here to rebrand. */
:root {
  --bg: #e8e1fd;          /* lavender page */
  --hill-1: #b5b0fd;      /* periwinkle hills */
  --hill-2: #9c97ee;
  --ink: #14213d;         /* deep navy text */
  --muted: #5b6185;
  --purple: #666be6;      /* main dragon purple */
  --purple-deep: #4c50cf;
  --lilac: #c4bdfc;
  --wing: #b1b4f7;
  --cream: #fdf3d8;       /* horns, fangs */
  --cream-deep: #f1dfa6;
  --cave-1: #3f3e9a;
  --cave-2: #5b59c8;
  --card: #ffffff;
  --line: #e4defc;
  --good: #1f9d6b;
  --bad: #d64545;
  --shadow: 0 0.45rem 1.3rem rgba(102, 107, 230, 0.18), 0 0.12rem 0 rgba(102, 107, 230, 0.12);
  --heading: "Fredoka", "Baloo 2", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --body: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
  font-size: clamp(9px, 3.1vmin, 16px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 600;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
a { color: var(--purple-deep); }

.hills { position: fixed; left: 0; right: 0; bottom: 0; height: 34%; pointer-events: none; z-index: 0; }
.hills svg { width: 100%; height: 100%; display: block; }

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  height: 100%;
  max-height: 720px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem 0.7rem;
  overflow: hidden;
}

.panel { background: var(--card); border-radius: 1.15rem; box-shadow: var(--shadow); }

/* header */
.top { display: flex; align-items: center; gap: 0.55rem; min-height: 2.2rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; margin-right: auto; min-width: 0; }
.net-badge { font: 700 0.62rem/1 system-ui, sans-serif; letter-spacing: 0.08em; color: #7a4b00; background: #FDF3D8; border: 1px solid #f0d58f; border-radius: 999px; padding: 0.25rem 0.5rem; white-space: nowrap; }
.net-badge[hidden] { display: none; }
a.buy:not([href]) { cursor: default; text-decoration: none; }
.mascot { width: 2.2rem; height: 2.2rem; border-radius: 24%; display: block; box-shadow: 0 0.15rem 0.5rem rgba(102, 107, 230, 0.3); }
.title { font-family: var(--heading); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1; white-space: nowrap; }
.online { font-size: 0.78rem; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 0.35rem; }
.online .dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #3ccf8e; box-shadow: 0 0 0 0.18rem rgba(60, 207, 142, 0.2); }
.me-chip {
  display: flex; align-items: center; gap: 0.35rem; max-width: 45%;
  background: var(--card); border: 0; border-radius: 999px; box-shadow: var(--shadow);
  padding: 0.22rem 0.6rem 0.22rem 0.22rem; font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.me-chip:not(:has(img:not([hidden]))) { padding-left: 0.6rem; }
.me-chip #meHandle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 1.5rem; height: 1.5rem; border-radius: 50%; object-fit: cover; }
.chev { color: var(--muted); font-size: 0.7rem; }

/* the hoard: a cave panel with the dragon at work */
.hoard {
  position: relative; flex: none; height: 6.6rem; border-radius: 1.15rem; overflow: hidden;
  background: linear-gradient(120deg, var(--cave-1) 0%, var(--cave-2) 100%);
  box-shadow: var(--shadow);
  display: flex; align-items: center;
}
.cave {
  position: absolute; top: 0; right: 0; height: 100%; width: 60%;
  object-fit: cover; object-position: 28% 42%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 34%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 34%);
}
.hoard-text { position: relative; padding: 0 0.95rem; min-width: 0; max-width: 62%; }
.label { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lilac); }
.hoard-amount {
  font-family: var(--heading); font-weight: 700; font-size: 2.3rem; line-height: 1.05;
  color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap;
  text-shadow: 0 0.12rem 0 rgba(20, 33, 61, 0.25);
}
.hoard-amount small { font-size: 0.5em; color: var(--cream); margin-left: 0.18em; }
.sub { font-size: 0.72rem; color: var(--lilac); line-height: 1.3; }

.sparkles i {
  position: absolute; width: 0.9rem; height: 0.9rem; color: var(--cream); opacity: 0.85;
  transform-origin: center; pointer-events: none;
}
.sparkles i svg { width: 100%; height: 100%; display: block; }
.sparkles i:nth-child(1) { right: 22%; top: 18%; }
.sparkles i:nth-child(2) { right: 9%; top: 52%; width: 0.65rem; height: 0.65rem; }
.sparkles i:nth-child(3) { right: 36%; top: 64%; width: 0.55rem; height: 0.55rem; color: var(--lilac); }
.mining .sparkles i { animation: twinkle 1.4s ease-in-out infinite; }
.mining .sparkles i:nth-child(2) { animation-delay: 0.45s; }
.mining .sparkles i:nth-child(3) { animation-delay: 0.9s; }
.mining .cave { animation: knock 0.7s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { transform: scale(0.6) rotate(0deg); opacity: 0.35; } 50% { transform: scale(1.25) rotate(20deg); opacity: 1; } }
@keyframes knock { 0%, 70%, 100% { transform: translate(0, 0); } 78% { transform: translate(-1px, 1px); } 86% { transform: translate(1px, -1px); } }

/* next egg + action */
.egg { padding: 0.65rem 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; flex: none; }
.block { display: flex; flex-direction: column; gap: 0.3rem; }
.block-row { display: flex; align-items: center; gap: 0.45rem; }
.chip {
  font-family: var(--body); font-size: 0.64rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.22rem 0.55rem; border-radius: 999px; white-space: nowrap;
  color: #fff; background: var(--purple);
}
.chip.open { color: var(--ink); background: var(--cream); box-shadow: inset 0 0 0 1.5px var(--cream-deep); }
.chip.tiny { font-size: 0.56rem; padding: 0.14rem 0.42rem; text-align: center; }
.block-num { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.countdown-wrap { margin-left: auto; display: flex; align-items: baseline; gap: 0.35rem; white-space: nowrap; }
.cd-label { font-size: 0.72rem; color: var(--muted); }
.countdown { font-family: var(--heading); font-weight: 700; font-size: 1.35rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.countdown.drawing { color: var(--purple); font-size: 1rem; }
.bar { height: 0.36rem; border-radius: 999px; background: #efebff; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--wing), var(--purple)); border-radius: inherit; transition: width 0.25s linear; }
.block-meta { font-size: 0.76rem; color: var(--muted); display: flex; gap: 0.6rem; flex-wrap: wrap; }
.block-meta b { color: var(--ink); font-weight: 800; }

.prelaunch { text-align: center; }
.pre-title { font-family: var(--heading); font-weight: 700; font-size: 1.25rem; color: var(--purple-deep); }
.pre-sub { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }

.action { display: flex; flex-direction: column; gap: 0.35rem; }
.pane { display: flex; flex-direction: column; gap: 0.35rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  border: 0; border-radius: 999px; cursor: pointer; font-family: var(--heading); font-weight: 700; font-size: 1rem;
  padding: 0.6rem 1.1rem; min-height: 2.6rem;
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.08s ease;
}
.btn:focus-visible, input:focus-visible, .me-chip:focus-visible { outline: 3px solid var(--wing); outline-offset: 2px; }
.btn.primary { background: var(--purple); color: #fff; box-shadow: 0 0.22rem 0 var(--purple-deep), 0 0.5rem 1.1rem rgba(102, 107, 230, 0.3); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.primary:active { transform: translateY(0.18rem); box-shadow: 0 0.04rem 0 var(--purple-deep), 0 0.3rem 0.8rem rgba(102, 107, 230, 0.3); }
.btn.ghost { background: #f3f0ff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.small { padding: 0.4rem 0.85rem; min-height: 2.1rem; font-size: 0.86rem; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.xlogo { font-weight: 800; }
.hint { font-size: 0.72rem; color: var(--muted); line-height: 1.35; }
.error { font-size: 0.74rem; color: var(--bad); font-weight: 700; }
.note { font-size: 0.72rem; line-height: 1.35; color: #6a4b00; background: var(--cream); border-radius: 0.7rem; padding: 0.32rem 0.6rem; box-shadow: inset 0 0 0 1.5px var(--cream-deep); }
.fallback-link { font-size: 0.8rem; text-align: center; font-weight: 700; }
.ready { font-family: var(--heading); font-weight: 700; font-size: 1.02rem; color: var(--good); text-align: center; padding: 0.45rem; background: #effbf5; border-radius: 0.8rem; }

.field { display: flex; gap: 0.4rem; }
.field input {
  flex: 1; min-width: 0; background: #f7f5ff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 0.45rem 0.8rem; font-size: 0.82rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink);
}
.field input::placeholder { color: #9a9cc0; font-family: var(--body); }
.field input.bad { border-color: var(--bad); }

.mine-row { display: flex; align-items: center; gap: 0.75rem; }
.btn.mine { min-width: 7.8rem; font-size: 1.1rem; }
.btn.mine.on { background: var(--cream); color: var(--ink); box-shadow: 0 0.22rem 0 var(--cream-deep), 0 0.5rem 1.1rem rgba(102, 107, 230, 0.2); }
.pick { width: 1.15rem; height: 1.15rem; display: inline-block; transform-origin: 75% 80%; }
.pick svg { width: 100%; height: 100%; display: block; }
.mining .pick { animation: swing 0.7s ease-in-out infinite; }
@keyframes swing { 0%, 100% { transform: rotate(0deg); } 55% { transform: rotate(-32deg); } 70% { transform: rotate(6deg); } }
.mine-stats { min-width: 0; }
.rate { font-family: var(--heading); font-weight: 700; font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.status { font-size: 0.76rem; color: var(--muted); }
.status.in { color: var(--good); font-weight: 800; }
.ticker {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.64rem; color: #9a9cc0;
  white-space: nowrap; overflow: hidden; height: 1em; line-height: 1em;
}
.ticker b { color: var(--purple); font-weight: 700; }

.odds {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.85rem;
  font-size: 0.76rem; color: var(--muted);
  padding-top: 0.45rem; border-top: 1.5px dashed var(--line);
}
.odds b { color: var(--ink); font-weight: 800; }
.odds .boost { color: #fff; background: var(--purple); border-radius: 999px; padding: 0.02rem 0.4rem; font-weight: 800; font-size: 0.72rem; }
.buy { font-weight: 800; text-decoration: none; color: var(--purple-deep); }
.buy:hover { text-decoration: underline; }

/* how it works (pre-launch) */
.how { list-style: none; margin: 0; padding: 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; flex: none; }
.how li { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.55rem; align-items: start; font-size: 0.82rem; line-height: 1.35; }
.how li span { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-family: var(--heading); font-weight: 700; font-size: 0.85rem; color: #fff; background: var(--purple); }

/* feed */
.feed { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.2rem; padding: 0.55rem 0.4rem 0.35rem 0.75rem; }
.feed-title { font-size: 0.64rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.feed-list { list-style: none; margin: 0; padding: 0 0.35rem 0 0; overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--lilac) transparent; scrollbar-gutter: stable; }
.feed-list li {
  display: grid; grid-template-columns: 3.3rem 1fr auto; align-items: center; gap: 0.45rem;
  padding: 0.26rem 0.1rem; border-bottom: 1.5px solid #f2efff; font-size: 0.78rem;
}
.feed-list li:last-child { border-bottom: 0; }
.feed-list li.feed-empty { display: block; grid-template-columns: none; color: var(--muted); font-weight: 600; padding: 0.6rem 0.2rem; border-bottom: 0; }
.feed-list li.me { background: #f1efff; border-radius: 0.5rem; }
.feed-list .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 800; }
.feed-list .who .addr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; font-weight: 600; }
.feed-list .who .what { color: var(--muted); font-weight: 600; }
.feed-list .amt { font-variant-numeric: tabular-nums; color: var(--purple-deep); text-align: right; white-space: nowrap; font-weight: 800; }
.feed-list .amt a { color: inherit; text-decoration: none; }
.feed-list .amt a:hover { text-decoration: underline; }
.feed-list .muted { color: var(--muted); font-weight: 600; }
.feed-empty { color: var(--muted); font-size: 0.8rem; padding: 0.4rem 0; }

/* win banner */
.win {
  position: absolute; left: 0.85rem; right: 0.85rem; top: 3.1rem; z-index: 5;
  padding: 0.7rem 0.8rem; border-radius: 1.15rem;
  background: var(--card); box-shadow: 0 0.9rem 2.2rem rgba(63, 62, 154, 0.35), inset 0 0 0 2px var(--lilac);
  display: flex; gap: 0.7rem; align-items: center;
  animation: pop 0.35s ease-out;
}
.win-mascot { width: 3.2rem; height: 3.2rem; border-radius: 24%; flex: none; animation: hop 0.9s ease-in-out 2; }
.win-body { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.win-text { font-family: var(--heading); font-weight: 700; font-size: 1.1rem; color: var(--ink); line-height: 1.2; }
.win-actions { display: flex; gap: 0.5rem; }
@keyframes pop { from { transform: translateY(-0.6rem) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-0.35rem) rotate(-6deg); } }

/* account sheet */
.sheet { position: absolute; inset: 0; z-index: 6; background: rgba(63, 62, 154, 0.28); display: flex; align-items: flex-start; justify-content: center; padding: 0.8rem; }
.sheet-inner {
  width: 100%; background: var(--card); border-radius: 1.15rem; box-shadow: 0 1rem 2.4rem rgba(63, 62, 154, 0.35);
  padding: 0.8rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--heading); font-weight: 700; font-size: 1.05rem; }
.sheet-label { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 800; }
.toggle { display: flex; align-items: center; gap: 0.5rem; font-size: 0.84rem; cursor: pointer; }
.toggle input { width: 1.05rem; height: 1.05rem; accent-color: var(--purple); }
.sheet-foot { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.2rem; }
.site { text-align: center; font-size: 0.7rem; color: var(--muted); }

/* full page on a big screen: float the card */
@media (min-height: 600px) and (min-width: 520px) {
  .card { height: min(100%, 720px); }
}

/* phones (X opens the card as a full page): size type by width, use the whole screen */
@media (max-aspect-ratio: 4/5) {
  :root { font-size: clamp(12px, 4vw, 17px); }
  .card { max-height: none; padding-top: max(0.8rem, env(safe-area-inset-top)); padding-bottom: max(0.7rem, env(safe-area-inset-bottom)); }
  .hoard { height: 8rem; }
  .hoard-amount { font-size: 2.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
