:root {
  --bg: #000;
  --surface: #0b0c0f;
  --surface-2: #131519;
  --line: #22252c;
  --line-2: #2f333b;
  --text: #f3f1eb;
  --muted: #8d919a;
  --faint: #5b5f68;

  --amber: #ffb547;
  --amber-ink: #1a1204;
  --alive: #45d483;
  --warn: #ffb547;
  --danger: #ff5a4e;

  --r-common: #4e5460;
  --r-uncommon: #1f9d63;
  --r-rare: #2f63d6;
  --r-epic: #8744d4;
  --r-legendary: #e5ad2f;

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--display);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
/* creature art is a circle on black corners: clip it so the corners never show on grey cards */
.pet-art img, .egg-hero .pet-art img, .sp img, .pcell img, .live-list img, .dlg-body img, .tomb-list img, .medallion-wrap img { border-radius: 50%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.pad { padding: 24px; }
[hidden] { display: none !important; }

/* ---------- header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 12px var(--gutter);
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.logo img { border-radius: 50%; }
.nav { display: flex; gap: 22px; margin-left: 12px; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); }
.net {
  margin-left: auto;
  font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--amber); border: 1px solid rgba(255, 181, 71, 0.4); border-radius: 99px; padding: 6px 9px; white-space: nowrap;
}
#connectBtn { margin-left: auto; }
.net:not([hidden]) + #connectBtn { margin-left: 0; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 99px;
  font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--amber); color: var(--amber-ink); }
.btn-primary:hover:not(:disabled) { background: #ffc46b; }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--muted); }
.btn-danger { background: var(--danger); color: #1a0402; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 56px; padding: 0 30px; font-size: 18px; }
.btn.busy { pointer-events: none; opacity: 0.8; }
.btn-pulse { animation: ring 1.5s ease-out infinite; }
.btn-danger.btn-pulse { animation-name: ring-red; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 181, 71, 0.65); } 100% { box-shadow: 0 0 0 16px rgba(255, 181, 71, 0); } }
@keyframes ring-red { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 78, 0.7); } 100% { box-shadow: 0 0 0 16px rgba(255, 90, 78, 0); } }

/* ---------- hero */
main { padding: 0 var(--gutter); max-width: 1240px; margin: 0 auto; }
.hero { display: grid; justify-items: center; text-align: center; padding: clamp(28px, 5vw, 56px) 0 28px; }
.eyebrow { margin: 0 0 16px; font: 600 13px/1 var(--mono); color: var(--amber); letter-spacing: 0.02em; }
.hero h1 { font-size: clamp(40px, 7vw, 92px); letter-spacing: -0.03em; line-height: 0.98; }
.lede { max-width: 32em; font-size: clamp(16px, 1.6vw, 20px); color: #c9c7c1; margin: 18px auto 0; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero-cta .btn { min-width: 280px; height: 60px; font-size: 19px; }
.hero-hint { margin: 10px 0 0; font-size: 14px; color: var(--muted); min-height: 1.5em; }
.odds { text-decoration: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 18px 0 0; font: 12px var(--mono); color: var(--muted); }
.odds span { display: inline-flex; align-items: center; gap: 6px; }
.odds i { width: 8px; height: 8px; border-radius: 50%; background: var(--rc); }

/* the fan: six medallions around a wobbling egg; sizes/offsets are in % of the stage width */
.stage { position: relative; width: 100%; max-width: 1100px; aspect-ratio: 100 / 36; container-type: inline-size; margin: 12px 0 8px; }
.med {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: calc(var(--s) * var(--k, 1) * 1cqw); aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%;
  translate: calc(-50% + var(--x) * var(--kx, 1) * 1cqw) calc(-50% + var(--y) * var(--k, 1) * 1cqw);
  rotate: var(--r); animation: bob 4.2s ease-in-out var(--d) infinite; transition: scale 0.2s;
}
.med:nth-child(3), .med:nth-child(4) { z-index: 2; }
.med:hover { scale: 1.08; z-index: 5; }
.med img { width: 100%; border-radius: 50%; box-shadow: 0 0 36px -6px var(--rc), 0 14px 30px rgba(0, 0, 0, 0.6); transition: opacity 0.35s, transform 0.35s; }
.med img.swap { opacity: 0; transform: scale(0.85); }
@keyframes bob { 50% { transform: translateY(-5%); } }
.egg-center { position: absolute; left: 50%; top: 50%; z-index: 3; width: 30cqw; translate: -50% -48%; display: block; padding: 0; border: 0; background: none; cursor: pointer; }
.egg-center:hover img { animation-duration: 0.9s; }
.egg-center::before { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: var(--amber); filter: blur(40px); opacity: 0.35; z-index: -1; animation: breathe 3s ease-in-out infinite; }
/* soft round fade hides the art's black corners without blending into the medallions behind */
.egg-center img { width: 100%; -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent); mask-image: radial-gradient(closest-side, #000 72%, transparent); transform-origin: 50% 80%; animation: eggwobble 3.4s ease-in-out infinite; }
@keyframes eggwobble { 0%, 68%, 100% { transform: rotate(0); } 72% { transform: rotate(-7deg); } 77% { transform: rotate(6deg); } 82% { transform: rotate(-4deg); } 87% { transform: rotate(2deg); } 92% { transform: rotate(0); } }
/* egg/grave art sits on black: blend it into whatever surface it's on */
.obj { mix-blend-mode: lighten; }
.pet-art img.obj { border-radius: 0; }

.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px;
  font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--rc, var(--r-common)); color: #fff;
}
[data-r="common"] { --rc: var(--r-common); }
[data-r="uncommon"] { --rc: var(--r-uncommon); }
[data-r="rare"] { --rc: var(--r-rare); }
[data-r="epic"] { --rc: var(--r-epic); }
[data-r="legendary"] { --rc: var(--r-legendary); }
.chip[data-r="legendary"] { color: #221703; }
.chip-genesis { background: transparent; color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.chip-adult { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ---------- the pot: a scoreboard, not a dashboard */
.pot { padding: 40px 0 0; margin-top: 8px; border-top: 1px solid var(--line); --gold: var(--r-legendary); --silver: #c3c7cf; --bronze: #c98a52; }
.pot p { margin: 0; }
.pot-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.pot-label { font: 500 14px var(--mono); color: var(--muted); }
.pot-num { font-size: clamp(56px, 9vw, 120px); font-weight: 600; line-height: 1; letter-spacing: -0.05em; color: var(--gold); margin: 6px 0 8px !important; white-space: nowrap; }
.pot-num .unit { font-size: 0.24em; margin-left: 0.35em; letter-spacing: 0; color: var(--muted); }
.pot-num.bump { animation: bump 0.6s ease-out; }
@keyframes bump { 30% { transform: scale(1.04); } }
.pot-note { font-size: 14px; color: var(--faint); }
.pot-draw { text-align: right; }
.led { font-size: clamp(34px, 4.4vw, 56px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--danger); margin: 6px 0 8px !important; }

.pot-bar, .pot-split { display: grid; grid-template-columns: 55fr 12.5fr 12.5fr 20fr; gap: 4px; }
.pot-bar { margin-top: 28px; }
.pot-bar i { height: 6px; border-radius: 3px; }
.pot-bar i:nth-child(1), .pot-split > div:nth-child(1) { --c: var(--gold); }
.pot-bar i:nth-child(2), .pot-split > div:nth-child(2) { --c: var(--silver); }
.pot-bar i:nth-child(3), .pot-split > div:nth-child(3) { --c: var(--bronze); }
.pot-bar i:nth-child(4), .pot-split > div:nth-child(4) { --c: var(--alive); }
.pot-bar i { background: var(--c); }
.pot-split { margin-top: 10px; }
.pot-split > div { display: grid; gap: 2px; min-width: 0; }
.pot-split b { font: 600 20px var(--mono); letter-spacing: -0.03em; color: var(--c); white-space: nowrap; }
.pot-split span { font-size: 13px; color: var(--muted); }
.pot-line { margin-top: 28px !important; font-size: 17px; color: var(--muted); }
.pot-line b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.pot-line .t-ok { color: var(--alive); }
.pot-line .t-low { color: var(--danger); }

/* ---------- rarity glow */
.glow { position: relative; isolation: isolate; }
.glow::before {
  content: ""; position: absolute; inset: 4%; border-radius: 50%; z-index: -1;
  background: var(--rc); filter: blur(46px); opacity: 0.45; transition: background 0.5s, opacity 0.5s;
}
.glow[data-r="common"]::before { opacity: 0.18; }
.glow[data-r="legendary"]::before { opacity: 0.7; animation: breathe 3s ease-in-out infinite; }
.glow[data-r="epic"]::before { opacity: 0.6; }
@keyframes breathe { 50% { opacity: 0.4; transform: scale(0.94); } }
.is-dead .glow::before { opacity: 0 !important; }

.notice { margin-top: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 15px; color: var(--muted); }

/* ---------- sections */
section { padding: 72px 0 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); }
.section-sub { margin: -8px 0 24px; max-width: 40em; }

/* ---------- play */
.play { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.play .section-head { grid-column: 1 / -1; margin-bottom: 4px; }
.lookup { display: flex; gap: 8px; }
.lookup input {
  width: min(360px, 60vw); height: 34px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font: 13px var(--mono);
}
.lookup input:focus { outline: none; border-color: var(--muted); }

.pet-card {
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface);
  display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 32px; padding: 28px;
  min-height: 380px; position: relative; overflow: hidden;
}
.pet-card.is-dead .pet-art img { filter: grayscale(1) brightness(0.55); }
.pet-art { position: relative; align-self: start; }
.pet-art img { width: 100%; aspect-ratio: 1; }
.pet-art.rolling img { animation: wobble 0.5s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) scale(1.02); } }
.pet-info { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pet-info h3 { font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -0.03em; }
.pet-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.pet-bio { color: #c9c7c1; margin: 0; font-size: 17px; max-width: 34em; }
.pet-owner { font: 12px var(--mono); color: var(--faint); word-break: break-all; }

.life { display: grid; gap: 8px; }
.life-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.life-top .label { color: var(--muted); font-size: 14px; }
.life-time { font: 600 clamp(30px, 3.6vw, 44px)/1 var(--mono); letter-spacing: -0.04em; }
.life-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.life-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--alive); transform-origin: left; transition: transform 1s linear; }
.life-time { color: var(--alive); text-shadow: 0 0 22px rgba(69, 212, 131, 0.45); }
.life-bar > span { box-shadow: 0 0 14px rgba(69, 212, 131, 0.6); }
.life.mid .life-time { color: var(--warn); text-shadow: 0 0 22px rgba(255, 181, 71, 0.5); }
.life.mid .life-bar > span { background: var(--warn); box-shadow: 0 0 14px rgba(255, 181, 71, 0.6); }
.life.low .life-time { color: var(--danger); text-shadow: 0 0 22px rgba(255, 90, 78, 0.6); animation: blink 1s steps(2) infinite; }
.life.low .life-bar > span { background: var(--danger); box-shadow: 0 0 14px rgba(255, 90, 78, 0.7); }
.is-dead .life-time { color: var(--muted); text-shadow: none; animation: none; }
@keyframes blink { 50% { opacity: 0.55; } }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; }
.facts > div:first-child { border-radius: 11px 0 0 11px; }
.facts > div:last-child { border-radius: 0 11px 11px 0; }
.facts div { background: var(--surface); padding: 12px 14px; }
.facts b { display: block; font: 600 17px var(--mono); }
.facts span { font-size: 12px; color: var(--muted); }
.has-tip { position: relative; cursor: help; outline: none; }
.tip-i { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 3px; border-radius: 50%; border: 1px solid var(--line-2); font: 600 9px/1 var(--mono); font-style: normal; color: var(--muted); vertical-align: 1px; }
.tip {
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 10; width: 240px; translate: -50% 4px; margin: 0;
  padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2);
  font-size: 13px; line-height: 1.45; color: var(--text); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0; pointer-events: none; transition: opacity 0.15s, translate 0.15s;
}
.has-tip:hover .tip, .has-tip:focus .tip, .has-tip:focus-within .tip { opacity: 1; translate: -50% 0; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.hint { font-size: 14px; color: var(--muted); }
.hint.warn { color: var(--warn); }
.hint.bad { color: var(--danger); }

.reel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 190px; height: 112px; border-radius: 18px; overflow: hidden;
  background: rgba(0, 0, 0, 0.88); border: 2px solid var(--amber);
  box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.6), 0 0 50px rgba(255, 181, 71, 0.5);
}
.reel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(#000 0%, transparent 28%, transparent 72%, #000 100%); pointer-events: none; }
.reel-strip { display: flex; flex-direction: column; }
.reel-strip span { height: 112px; flex: none; display: grid; place-items: center; font: 700 64px/1 var(--mono); color: var(--amber); letter-spacing: -0.04em; }
.reel.spinning .reel-strip { animation: reel 0.45s linear infinite; }
@keyframes reel { to { transform: translateY(-50%); } }
.reel.won { animation: win 0.5s ease-out 2; }
.reel.big { border-color: var(--r-legendary); box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.6), 0 0 90px rgba(229, 173, 47, 0.9); }
.reel.big .reel-strip span { color: var(--r-legendary); }
.reel-label { position: absolute; left: 50%; transform: translateX(-50%); top: calc(50% + 66px); padding: 4px 12px; border-radius: 99px; background: rgba(0, 0, 0, 0.85); white-space: nowrap; text-align: center; font: 700 14px var(--mono); letter-spacing: 0.12em; color: var(--r-legendary); text-shadow: 0 0 14px rgba(229, 173, 47, 0.8); }
@keyframes win { 50% { transform: translate(-50%, -50%) scale(1.08); } }
.pet-empty { grid-column: 1 / -1; display: grid; place-items: center; text-align: center; gap: 16px; color: var(--muted); }
.egg-hero { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 32px; grid-column: 1 / -1; align-items: center; }
.egg-hero img { width: 100%; }
.egg-hero.rolling img { animation: shake 0.35s ease-in-out infinite; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

.side-cards { display: grid; gap: 20px; align-content: start; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; display: grid; gap: 12px; }
.card h3 { font-size: 18px; letter-spacing: -0.01em; }
.card p { margin: 0; font-size: 14px; color: var(--muted); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--muted); font: 12px var(--mono); }
.claim-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tomb-list { display: flex; gap: 10px; flex-wrap: wrap; }
.tomb-list figure { margin: 0; width: 64px; text-align: center; font-size: 11px; color: var(--muted); }
.tomb-list img { filter: grayscale(1) brightness(0.6); border-radius: 50%; }

/* ---------- board */
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 99px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.board-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: auto; max-height: 620px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { position: sticky; top: 0; background: var(--surface); text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); z-index: 1; }
td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--surface-2); }
tr.me td { background: rgba(255, 181, 71, 0.06); }
.pcell { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.pcell img { width: 40px; height: 40px; flex: none; }
.pcell b { display: block; font-weight: 700; }
.pcell small { color: var(--faint); font: 11px var(--mono); }
td.num { font-family: var(--mono); white-space: nowrap; }
.t-low { color: var(--danger); }
.t-mid { color: var(--warn); }
.t-ok { color: var(--alive); }
.safe { font: 600 11px var(--mono); color: var(--alive); }
.dead-img { filter: grayscale(1) brightness(0.55); }
.empty-row { padding: 32px 16px; color: var(--muted); text-align: center; }
.season-block { padding: 18px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.season-block:last-child { border-bottom: 0; }
.season-block h4 { margin: 0; font-size: 17px; }
.winners { display: grid; gap: 6px; font-size: 14px; }
.winners div { display: flex; justify-content: space-between; gap: 12px; }

.live { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 18px; max-height: 620px; overflow: auto; }
.live h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.live h3::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--alive); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.live-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.live-list li { display: flex; gap: 10px; align-items: center; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.live-list li:last-child { border-bottom: 0; }
.live-list img { width: 28px; height: 28px; flex: none; }
.live-list .when { margin-left: auto; color: var(--faint); font: 11px var(--mono); white-space: nowrap; }
.live-list .plus { color: var(--amber); font-family: var(--mono); }
.live-list .big { color: var(--r-legendary); font-family: var(--mono); font-weight: 700; text-shadow: 0 0 12px rgba(229, 173, 47, 0.6); }
.live-list li.fresh { animation: fresh 1.2s ease-out; }
@keyframes fresh { from { background: rgba(255, 181, 71, 0.18); } }
.live-list .rip { color: var(--danger); }

/* ---------- creatures */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line-2); background: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted);
}
.chip-btn i { width: 9px; height: 9px; border-radius: 50%; background: var(--rc); }
.chip-btn[aria-pressed="true"] { color: var(--text); border-color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sp {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 12px 12px 14px; cursor: pointer; text-align: left; display: grid; gap: 8px;
  transition: border-color 0.15s, transform 0.15s;
}
.sp:hover { border-color: var(--rc); transform: translateY(-2px); box-shadow: 0 10px 40px -12px var(--rc); }
.sp[data-r="epic"], .sp[data-r="legendary"] { border-color: color-mix(in srgb, var(--rc) 55%, transparent); box-shadow: 0 0 30px -10px var(--rc); }
.sp[data-r="legendary"] { background: radial-gradient(90% 70% at 50% 35%, color-mix(in srgb, var(--rc) 22%, transparent), var(--surface)); }
.sp img { width: 100%; aspect-ratio: 1; }
.sp b { font-size: 14px; line-height: 1.2; }
.sp small { display: flex; justify-content: space-between; font: 11px var(--mono); color: var(--faint); }
.sp small em { font-style: normal; color: var(--alive); }

.dlg {
  border: 1px solid var(--line-2); border-radius: 20px; background: var(--surface); color: var(--text);
  padding: 28px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
}
.dlg::backdrop { background: rgba(0, 0, 0, 0.75); }
.dlg-x { position: absolute; right: 14px; top: 10px; border: 0; background: none; font-size: 28px; color: var(--muted); cursor: pointer; }
.dlg-body { display: grid; gap: 14px; }
.dlg-body img { width: min(320px, 70vw); margin: 0 auto; }
.dlg-body h3 { font-size: 32px; }
.wallets { display: grid; gap: 8px; }
.share-dlg { justify-items: center; text-align: center; }
.share-dlg .share-prev { width: 100%; max-width: 460px; border-radius: 12px; border: 1px solid var(--line-2); }
.share-steps { margin: 0; padding: 0 0 0 1.3em; text-align: left; display: grid; gap: 8px; color: #c9c7c1; font-size: 16px; max-width: 420px; }
.share-steps li::marker { color: var(--amber); font-family: var(--mono); }
kbd { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 7px; border: 1px solid var(--line-2); border-bottom-width: 3px; background: var(--surface-2); font: 600 14px var(--mono); color: var(--text); vertical-align: 1px; }
.share-dlg .btn-lg { width: 100%; max-width: 420px; }
.wallets .btn { width: 100%; }
.dlg-body p { margin: 0; color: #c9c7c1; font-size: 17px; }

/* ---------- rules */
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; counter-reset: r; }
.rule-list li { background: var(--surface); padding: 24px; counter-increment: r; }
.rule-list li::before { content: "0" counter(r); display: block; font: 600 13px var(--mono); color: var(--amber); margin-bottom: 14px; }
.rule-list h3 { font-size: 21px; margin-bottom: 8px; }
.rule-list p { margin: 0; color: var(--muted); font-size: 15px; }
.fineprint { color: var(--faint); font-size: 13px; max-width: 60em; margin: 20px 0 0; }

.foot { margin-top: 96px; padding: 28px var(--gutter); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; }
.foot a { color: var(--muted); }

.more { display: flex; justify-content: center; margin-top: 20px; }

/* ---------- mobile dock */
.dock {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
  display: none; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 18px;
  background: rgba(16, 17, 21, 0.94); backdrop-filter: blur(12px); border: 1px solid var(--line-2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7); transition: translate 0.25s, opacity 0.25s;
}
.dock.away { translate: 0 140%; opacity: 0; }
.dock img { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.dock .dk-txt { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.dock b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock .dk-sub { font: 12px var(--mono); color: var(--muted); }
.dock .btn { height: 44px; padding: 0 16px; font-size: 14px; }

/* ---------- "someone just…" pops */
.pops { position: fixed; left: 16px; bottom: 16px; z-index: 45; display: grid; gap: 8px; width: min(340px, calc(100vw - 32px)); pointer-events: none; }
.pop {
  pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 10px; justify-self: start;
  padding: 7px 16px 7px 7px; border-radius: 99px; background: rgba(19, 21, 25, 0.96); border: 1px solid var(--line-2);
  font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: popin 0.45s cubic-bezier(0.16, 1, 0.3, 1), popout 0.4s ease-in 4.6s forwards;
}
.pop img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.pop em { font-style: normal; font-family: var(--mono); color: var(--amber); }
.pop.big { border-color: var(--r-legendary); box-shadow: 0 0 30px -6px var(--r-legendary); }
.pop.big em { color: var(--r-legendary); font-weight: 700; }
.pop.rip { border-color: rgba(255, 90, 78, 0.5); }
.pop.rip img { filter: grayscale(1) brightness(0.6); }
.pop .rip-t { color: var(--danger); }
@keyframes popin { from { opacity: 0; transform: translateY(12px) scale(0.9); } }
@keyframes popout { to { opacity: 0; transform: translateY(8px); } }

/* ---------- egg roulette (case opening) */
.roulette {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  background: rgba(0, 0, 0, 0.94); backdrop-filter: blur(6px); padding: 24px 0; overflow-y: auto;
}
.roulette[hidden] { display: none; }
.rl-status { margin: 0; font: 600 14px var(--mono); color: var(--amber); letter-spacing: 0.04em; }
.rl-window {
  --item: 150px; position: relative; width: 100%; overflow: hidden; padding: 64px 0;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.rl-strip { display: flex; gap: 18px; width: max-content; will-change: transform; }
.rl-item { flex: none; width: var(--item); aspect-ratio: 1; border-radius: 50%; transition: opacity 0.5s, scale 0.5s; }
.rl-item img { width: 100%; border-radius: 50%; box-shadow: 0 0 26px -6px var(--rc); }
.roulette.spin .rl-strip { animation: rl-loop var(--loop-t, 0.9s) linear infinite; filter: blur(1.5px); }
@keyframes rl-loop { to { transform: translateX(calc(var(--loop) * -1px)); } }
.rl-marker {
  position: absolute; left: 50%; top: 40px; bottom: 40px; width: 3px; translate: -50% 0; border-radius: 2px; z-index: 2;
  background: var(--amber); box-shadow: 0 0 16px var(--amber);
}
.rl-marker::before, .rl-marker::after { content: ""; position: absolute; left: 50%; translate: -50% 0; border: 9px solid transparent; }
.rl-marker::before { top: -4px; border-top-color: var(--amber); }
.rl-marker::after { bottom: -4px; border-bottom-color: var(--amber); }
.roulette.landed .rl-item { opacity: 0.25; }
.roulette.landed .rl-item.win { opacity: 1; scale: 1.28; }
.roulette.landed .rl-item.win img { box-shadow: 0 0 44px 0 var(--rc); }
.roulette.landed .rl-marker { opacity: 0; transition: opacity 0.4s; }
.rl-result { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 0 20px; max-width: 520px; opacity: 0; translate: 0 12px; transition: opacity 0.5s 0.2s, translate 0.5s 0.2s; }
.roulette.landed .rl-result { opacity: 1; translate: 0 0; }
.rl-result h3 { font-size: clamp(32px, 5vw, 48px); }
.rl-result p { margin: 0; color: #c9c7c1; font-size: 17px; }
.rl-result .rl-life { font: 600 18px var(--mono); color: var(--alive); }
.rl-result .actions { justify-content: center; margin-top: 6px; }
.rl-result .rl-legend { font: 700 13px var(--mono); letter-spacing: 0.14em; color: var(--r-legendary); }

/* ---------- toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; font-size: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); animation: tin 0.2s ease-out; }
.toast.bad { border-color: rgba(255, 90, 78, 0.6); }
.toast.good { border-color: rgba(69, 212, 131, 0.6); }
.toast a { color: var(--amber); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive */
@media (max-width: 1020px) {
  .play, .board-grid { grid-template-columns: 1fr; }
  .rule-list { grid-template-columns: repeat(2, 1fr); }
  .live { max-height: 360px; }
}
@media (max-width: 720px) {
  body { padding-bottom: 84px; }
  section { padding-top: 48px; }
  .nav { display: none; }
  .net { display: none !important; }
  #connectBtn { margin-left: auto !important; height: 38px; padding: 0 14px; font-size: 14px; }
  .dock:not([hidden]) { display: flex; }
  .toasts { bottom: 88px; }
  .rl-window { --item: 104px; }
  .rl-strip { gap: 12px; }
  .pops { left: 50%; translate: -50% 0; bottom: auto; top: 76px; justify-items: center; }
  .pop { justify-self: center; }

  .hero { padding-top: 22px; }
  .lede { margin-top: 12px; }
  .stage { aspect-ratio: 100 / 60; margin: 4px 0; }
  .med { --k: 1.6; --kx: 1.12; }
  .med:nth-child(1), .med:nth-child(6) { display: none; }
  .egg-center { width: 46cqw; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1; min-width: 0; height: 56px; font-size: 17px; padding: 0 12px; }
  .odds { gap: 4px 10px; font-size: 11px; }

  .pot { padding-top: 28px; }
  .pot-top { flex-wrap: nowrap; align-items: flex-start; }
  .pot-num { font-size: 44px; }
  .pot-num .unit { display: block; margin: 6px 0 0; font-size: 13px; }
  .led { font-size: 26px; }
  .pot-note { font-size: 12px; }
  .pot-bar { margin-top: 20px; }
  .pot-split { grid-template-columns: 1fr 1fr; gap: 10px 16px; }
  .pot-split b { font-size: 17px; }
  .pot-line { font-size: 15px; margin-top: 20px !important; }
  .section-head { margin-bottom: 16px; }
  .pet-card, .egg-hero { grid-template-columns: 1fr; padding: 18px; gap: 16px; min-height: 0; }
  .pet-art, .egg-hero .pet-art { max-width: 240px; width: 100%; margin: 0 auto; }
  .egg-hero > img { max-width: 200px; margin: 0 auto; }
  .pet-info { text-align: center; align-items: center; }
  .pet-tags, .actions { justify-content: center; }
  .actions .btn-lg { width: 100%; }
  .facts { width: 100%; }
  .life { width: 100%; }
  .life-top { text-align: left; }
  .lookup input { width: 100%; }
  .lookup { width: 100%; }

  .tabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; padding: 7px 12px; }
  .table-wrap { max-height: none; }
  .board .hide-m { display: none; }
  th, td { padding: 10px 12px; }
  .pcell { min-width: 0; }
  .board tbody tr:nth-child(n+16) { display: none; }
  .live { max-height: none; }
  .live-list li:nth-child(n+9) { display: none; }

  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sp { padding: 6px 6px 8px; gap: 4px; }
  .sp b { font-size: 12px; }
  .sp small { display: none; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .filters::-webkit-scrollbar { display: none; }
  .chip-btn { flex: none; }
  .rule-list { grid-template-columns: 1fr; }
  .rule-list li { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
