:root {
  --bg: #1a2c38;          /* page */
  --deep: #0f212e;        /* nav, buttons inside cards */
  --card: #213743;
  --card-2: #2f4553;
  --line: #2f4553;
  --text: #ffffff;
  --muted: #b1bad3;
  --faint: #7f8ba6;
  --accent: #2fd27a;
  --accent-ink: #06140c;
  --up: #2fd27a;
  --down: #ff6b7a;
  --live: #ffb23e;
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum", "cv11";
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.error { color: var(--down); }
.inline-link { color: var(--accent); }
.inline-link:hover { text-decoration: underline; }
.icon { display: inline-flex; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon svg { width: 1.15em; height: 1.15em; display: block; }

/* ---------- loading screen: the logo die, tumbling in 3D ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; background: var(--bg); transition: opacity .4s ease, visibility .4s; }
.splash.done { opacity: 0; visibility: hidden; }
.dice-stage { --size: 76px; --half: 38px; --beat: .75s; display: grid; justify-items: center; padding-top: 70px; }
/* The hop and squash happen in 2D; the 3D spin lives inside. Two hops per full spin. */
.dice-hop { perspective: 520px; animation: dice-hop var(--beat) infinite; transform-origin: 50% 100%; }
.dice-tilt { transform-style: preserve-3d; transform: rotateX(-26deg) rotateY(34deg); }
.dice-cube { position: relative; width: var(--size); height: var(--size); transform-style: preserve-3d; animation: dice-spin calc(var(--beat) * 2) infinite; }
.face, .fill { position: absolute; inset: 0; }
.face {
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); place-items: center; padding: 11px;
  border-radius: 15px;
  background: radial-gradient(circle at 30% 25%, #ffffff, #e3e8e5);
  box-shadow: inset 0 0 0 1.5px rgba(15, 33, 46, .14);
  backface-visibility: hidden;
}
.face i { width: 12px; height: 12px; border-radius: 50%; background: #0f212e; }
.p-tl { grid-area: 1 / 1; } .p-tr { grid-area: 1 / 3; }
.p-ml { grid-area: 2 / 1; } .p-c { grid-area: 2 / 2; } .p-mr { grid-area: 2 / 3; }
.p-bl { grid-area: 3 / 1; } .p-br { grid-area: 3 / 3; }
/* like the logo, half the die is white and half is green */
.f4, .f5, .f6 { background: radial-gradient(circle at 30% 25%, #4be391, #25b869); }
.f1 { transform: translateZ(var(--half)); }
.f6 { transform: rotateY(180deg) translateZ(var(--half)); }
.f2 { transform: rotateY(90deg) translateZ(var(--half)); }
.f5 { transform: rotateY(-90deg) translateZ(var(--half)); }
.f3 { transform: rotateX(90deg) translateZ(var(--half)); }
.f4 { transform: rotateX(-90deg) translateZ(var(--half)); }
/* three planes through the centre hide the gaps left by the rounded corners */
.fill { inset: 3px; background: #0f212e; border-radius: 6px; }
.fy { transform: rotateY(90deg); }
.fz { transform: rotateX(90deg); }
.dice-shadow { width: 82px; height: 12px; margin-top: 16px; border-radius: 50%; background: #000; opacity: .3; filter: blur(3px); animation: dice-shadow var(--beat) infinite; }
.splash-name { margin-top: 20px; font-size: 20px; font-weight: 700; letter-spacing: -.03em; animation: splash-name .5s .15s both; }
@keyframes dice-spin {
  0% { transform: rotateX(0) rotateY(0); animation-timing-function: cubic-bezier(.3, 0, .7, 1); }
  50% { transform: rotateX(180deg) rotateY(90deg); animation-timing-function: cubic-bezier(.3, 0, .7, 1); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}
@keyframes dice-hop {
  0% { transform: translateY(0) scale(1.08, .9); animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  12% { transform: translateY(-10px) scale(.97, 1.04); animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  50% { transform: translateY(-62px) scale(1); animation-timing-function: cubic-bezier(.6, 0, .8, .3); }
  100% { transform: translateY(0) scale(1.08, .9); }
}
@keyframes dice-shadow {
  0%, 100% { transform: scaleX(1); opacity: .3; }
  50% { transform: scaleX(.55); opacity: .12; }
}
@keyframes splash-name { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .dice-hop, .dice-cube, .dice-shadow, .splash-name { animation: none; }
}

/* ---------- contract address strip ---------- */
.ca-bar { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 6px 16px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.ca-bar span { opacity: .75; }
.ca-bar b { font-weight: 700; }
.ca-bar button { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; }
.ca-bar button b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ca-bar button i { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--accent-ink); color: var(--accent); font-size: 11px; font-style: normal; font-weight: 700; }

/* ---------- top bar ---------- */
.top { position: relative; z-index: 10; flex: none; background: var(--bg); }
.scroller { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; scrollbar-color: var(--card-2) transparent; }
.top-in { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.account { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.balance { padding: 10px 14px; border-radius: var(--radius); background: var(--deep); font-weight: 600; color: var(--muted); }
.balance b { color: var(--text); font-weight: 700; }
.balance .demo { margin-left: 8px; padding: 2px 6px; border-radius: 4px; background: var(--card-2); color: var(--live); font-size: 10px; font-style: normal; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px; }
.balance.bump { animation: bump .5s ease-out; }
@keyframes bump { 30% { transform: scale(1.08); box-shadow: 0 0 0 2px var(--accent); } }
.name-edit { width: 150px; padding: 8px 12px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--deep); }
.name-edit:focus { outline: none; border-color: var(--accent); }

/* ---------- buttons ---------- */
.btn { transition: filter .12s, transform .08s; border: 0; background: var(--card-2); padding: 10px 16px; border-radius: var(--radius); font-weight: 600; white-space: nowrap; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.big { width: 100%; padding: 13px 16px; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.btn:disabled { opacity: .5; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 500; }
.link:hover { color: var(--text); }

/* ---------- page ---------- */
.wrap { flex: 1 0 auto; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px 56px; }

/* the menu stays under the header while the page scrolls; the negative margin lets its background and shadow span the full width */
.nav-bar { position: sticky; top: 0; z-index: 9; display: flex; margin: 0 -24px 22px; padding: 10px 24px 12px; background: var(--bg); box-shadow: 0 10px 12px -10px rgba(0, 0, 0, .45); }
.nav { display: inline-flex; max-width: 100%; gap: 4px; padding: 5px; border-radius: 999px; background: var(--deep); overflow-x: auto; scrollbar-width: none; }
.nav a { transition: background .12s; display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.nav a:hover { background: var(--card); }
.nav a.active { background: var(--card-2); }
.nav .n { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--live); color: #201400; font-size: 12px; font-weight: 700; text-align: center; }

.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 28px 0 14px; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.section-head .link { margin-left: auto; }
.count { padding: 1px 8px; border-radius: 999px; background: var(--card-2); color: var(--muted); font-size: 12px; font-weight: 700; }

.empty { display: grid; justify-items: center; gap: 6px; color: var(--muted); padding: 48px 20px; text-align: center; border-radius: var(--radius); background: var(--card); }
.empty b { color: var(--text); font-size: 16px; font-weight: 700; }
.empty p { max-width: 340px; }
.empty .btn { margin-top: 12px; }
.empty-icon { width: 60px; height: 60px; margin-bottom: 8px; border-radius: 50%; display: grid; place-items: center; background: var(--deep); color: var(--accent); font-size: 24px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--deep) 45%, transparent); }

/* placeholders while data loads */
.skel { border-radius: var(--radius); background: var(--card); padding: 16px; display: grid; gap: 12px; }
.skel i { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--card-2) 25%, #3a5364 50%, var(--card-2) 75%) 0 0 / 200% 100%; animation: skel 1.3s linear infinite; }
.skel-card i:nth-child(1) { width: 38%; }
.skel-card i:nth-child(2) { height: 44px; }
.skel-card i:nth-child(3) { height: 52px; }
.skel-list { display: grid; gap: 6px; }
.skel-row { grid-template-columns: 28px 36px 1fr; align-items: center; padding: 12px 16px; }
.skel-row i:nth-child(1) { height: 28px; border-radius: 50%; }
.skel-row i:nth-child(2) { height: 36px; border-radius: 50%; }
.skel-row i:nth-child(3) { width: 45%; }
@keyframes skel { to { background-position: -200% 0; } }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px 40px; margin-bottom: 24px; padding: 26px 190px 26px 28px; border-radius: 12px; background: radial-gradient(90% 160% at 100% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 60%), linear-gradient(120deg, #24404d, var(--card)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.hero h1 { font: 400 34px/1.05 Anton, Impact, "Arial Narrow Bold", sans-serif; letter-spacing: .01em; text-transform: uppercase; }
.hero p { max-width: 460px; margin-top: 8px; color: var(--muted); font-size: 15px; }
.hero-stats { display: grid; grid-template-columns: repeat(2, auto); gap: 14px 30px; }
.hero-stat { display: grid; }
.hero-stat b { font-size: 22px; font-weight: 700; line-height: 1.15; }
.hero-stat span { color: var(--muted); font-size: 12px; font-weight: 500; }
.hero-die { position: absolute; right: 22px; top: 50%; width: 140px; height: 140px; margin-top: -70px; transform: rotate(8deg); filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .4)); pointer-events: none; }

/* a win: confetti falls once over the page */
.confetti { position: fixed; inset: 0; z-index: 50; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -14px; width: 8px; height: 13px; border-radius: 2px; opacity: 0; animation: confetti-fall 2s cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes confetti-fall { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--drift), 100vh) rotate(var(--spin)); } }
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
  .skel i, .odds-x.tick, .odds-x.tick::after { animation: none; }
}

/* ---------- how it works ---------- */
.how { background: var(--card); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 28px; }
.how .section-head { margin: 0 0 14px; align-items: center; }
.how h2 { font-size: 16px; }
.how ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.how li { display: flex; gap: 12px; align-items: flex-start; }
.how li b { display: block; font-weight: 600; }
.how li span { color: var(--muted); }
.how .step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; }

/* ---------- battle cards ---------- */
.battles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; align-items: start; }
.battle { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); transition: box-shadow .15s, transform .15s; }
.battle.open:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .28); transform: translateY(-1px); }
.battle-top { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; font-size: 13px; color: var(--muted); }
.time { padding: 2px 7px; border-radius: 4px; background: var(--card-2); color: var(--text); font-weight: 700; font-size: 12px; white-space: nowrap; }
.time.soon { background: var(--down); color: #2a0509; }
.time.live { background: var(--live); color: #201400; }
.time-label { font-weight: 500; }
.vol { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; }
.vol .icon { color: var(--muted); }

/* the face-off: picture and name on each side, mirrored */
.match { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 16px; }
.pfp { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--deep); display: grid; place-items: center; font-size: 16px; font-weight: 700; color: var(--muted); }
.face-off { display: flex; }
.face-off .pfp { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--card-2); }
.face-off.lost, .side.lost { opacity: .45; }
.side { display: grid; gap: 2px; min-width: 0; }
.side.b { text-align: right; justify-items: end; }
.who-name { max-width: 100%; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-sub { display: flex; align-items: center; gap: 6px; min-width: 0; }
.side.b .who-sub { flex-direction: row-reverse; }
.fig { font-size: 13px; font-weight: 600; white-space: nowrap; }
.fig.off { color: var(--faint); font-weight: 500; }
.vs { color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.tag { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--card-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.tag.win { background: var(--accent); color: var(--accent-ink); }

.battle-bottom { border-top: 2px solid var(--line); padding: 12px 16px 16px; display: grid; gap: 10px; }
.note { color: var(--muted); font-size: 13px; }

/* a live battle's time line: replaces the divider above the buttons */
.progress { height: 3px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--live); transition: width 1s linear; }
.progress + .battle-bottom { border-top: 0; }
.battle.live > .progress:last-child { border-radius: 0 0 var(--radius) var(--radius); }

/* each button fills from the left to its trader's chance (--p) */
.odds-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.odds { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border: 2px solid transparent; border-radius: 6px; background: var(--deep); text-align: left; min-width: 0; transition: border-color .12s, transform .08s, filter .12s; }
.odds::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: color-mix(in srgb, var(--accent) 13%, transparent); border-right: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); transition: width .5s ease; }
.odds > * { position: relative; }
.odds:hover { filter: brightness(1.18); }
.odds:active { transform: scale(.98); }
.odds-main { display: grid; gap: 1px; min-width: 0; }
.odds-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.odds-line { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.odds-x { color: var(--accent); font-weight: 700; font-size: 15px; }
.odds-p { color: var(--muted); font-size: 12px; font-weight: 500; }
/* the multiplier flashes once when a refresh changes it */
.odds-x.tick { border-radius: 4px; animation: tick-up 1.4s ease-out; }
.odds-x.tick.down { animation-name: tick-down; }
.odds-x.tick::after { content: " ▲"; font-size: 9px; vertical-align: 2px; animation: tick-fade 1.4s ease-out forwards; }
.odds-x.tick.down::after { content: " ▼"; }
@keyframes tick-up { 0%, 35% { color: #fff; background: var(--up); box-shadow: 0 0 0 3px var(--up); } }
@keyframes tick-down { 0%, 35% { color: #fff; background: var(--down); box-shadow: 0 0 0 3px var(--down); } 100% { color: var(--accent); } }
@keyframes tick-fade { 60% { opacity: 1; } 100% { opacity: 0; } }
.odds > .odds-mine { position: absolute; top: 6px; right: 6px; }
.odds-mine { flex: none; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); font-size: 11px; font-weight: 700; white-space: nowrap; }
.odds.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--deep)); }

.mine { padding: 9px 12px; border-radius: 6px; background: var(--deep); font-weight: 600; }

.bet-panel { display: grid; gap: 10px; padding-top: 4px; }
.bet-panel.fresh { animation: panel-in .18s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-4px); } }
.bet-label { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { flex: 1; min-width: 44px; padding: 9px 4px; border: 2px solid transparent; border-radius: 6px; background: var(--deep); font-weight: 600; transition: background .12s, border-color .12s; }
.chip:hover:not(:disabled) { background: #0b1a25; }
.chip.active { border-color: var(--accent); color: var(--accent); }
.chip:disabled { opacity: .35; }

/* ---------- my bets ---------- */
.bet-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.bet-card { background: var(--card); border-radius: var(--radius); padding: 16px; display: grid; gap: 14px; border: 2px solid transparent; }
.bet-card.won { border-color: var(--accent); }
.bet-card.lost .bet-who { opacity: .55; }
.bet-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.bet-tag { padding: 3px 10px; border-radius: 999px; background: var(--card-2); color: var(--muted); font-weight: 600; white-space: nowrap; }
.bet-tag.wait { background: color-mix(in srgb, var(--live) 20%, transparent); color: var(--live); }
.bet-tag.won { background: var(--accent); color: var(--accent-ink); }
.bet-tag.lost { background: color-mix(in srgb, var(--down) 20%, transparent); color: var(--down); }
.bet-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bet-who > .pfp { flex: none; width: 52px; height: 52px; font-size: 18px; }
.bet-names { min-width: 0; display: grid; gap: 2px; }
.bet-name { font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bet-vs { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bet-vs .pfp { width: 20px; height: 20px; font-size: 10px; flex: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 6px; background: var(--deep); }
.stat { padding: 10px 8px; text-align: center; display: grid; gap: 2px; border-left: 2px solid var(--card); }
.stat:first-child { border-left: 0; }
.stat span { font-size: 12px; color: var(--muted); }
.stat b { font-size: 17px; font-weight: 700; }

/* ---------- top players ---------- */
.list { max-width: 720px; display: grid; gap: 6px; }
.list li { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--card); }
.list li.me { box-shadow: inset 0 0 0 2px var(--accent); }
.list b { font-weight: 700; }
.rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--deep); color: var(--muted); font-size: 13px; font-weight: 700; }
.rank.top1 { background: #f5c542; color: #2b2000; }
.rank.top2 { background: #c9d3e0; color: #1c2530; }
.rank.top3 { background: #d99a5b; color: #2a1603; }
.list .pfp { width: 36px; height: 36px; font-size: 14px; background: var(--card-2); color: var(--text); }
.lb-who { display: grid; gap: 1px; min-width: 0; }
.lb-who b { display: flex; align-items: center; gap: 8px; }
.lb-who .muted { font-size: 12px; }
.lb-pts { white-space: nowrap; font-size: 15px; }


.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 32px); background: var(--deep); padding: 12px 18px; border-radius: var(--radius); font-weight: 600; z-index: 30; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.toast.bad { color: var(--down); }

.vol { white-space: nowrap; }

/* ---------- positions: shares held, and selling them ---------- */
.mine.position { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 500; }
.mine.position b { font-weight: 700; }
.sell { flex: none; padding: 6px 12px; border: 1px solid var(--card-2); border-radius: 6px; background: var(--card); font-size: 13px; font-weight: 700; white-space: nowrap; transition: border-color .12s, filter .12s; }
.sell:hover:not(:disabled) { border-color: currentColor; filter: brightness(1.15); }
.sell:disabled, .sell-big:disabled { opacity: .5; }
.sell-big { width: 100%; background: var(--deep); border: 1px solid var(--card-2); }
.sell-big span { font-weight: 500; opacity: .8; }
.bet-note { color: var(--muted); font-size: 12px; line-height: 1.45; }
.odds-x { font-size: 17px; }

/* ---------- lead chart on live cards ---------- */
.lead { position: relative; height: 64px; margin: 0 16px 12px; border-radius: 6px; background: var(--deep); overflow: hidden; }
.lead svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lead-a { fill: color-mix(in srgb, var(--accent) 28%, transparent); }
.lead-b { fill: color-mix(in srgb, #5fd4ff 26%, transparent); }
.lead-zero { stroke: var(--card-2); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.lead-line { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.lead-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.lead-dot.b { background: #5fd4ff; box-shadow: 0 0 0 3px color-mix(in srgb, #5fd4ff 30%, transparent); }
.lead-name, .lead-now { position: absolute; font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap; text-shadow: 0 1px 2px var(--deep); }
.lead-name { left: 8px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.lead-name.a { top: 6px; color: var(--accent); }
.lead-name.b { bottom: 6px; color: #5fd4ff; }
.lead-now { right: 8px; top: 6px; color: var(--muted); }
a.who-name:hover { text-decoration: underline; }
a.face-off { transition: transform .12s; }
a.face-off:hover { transform: scale(1.06); }

/* ---------- trader page ---------- */
.back { display: inline-block; margin-bottom: 14px; }
.tr-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px; border-radius: 12px; background: linear-gradient(120deg, #24404d, var(--card)); }
.tr-head > .pfp { width: 76px; height: 76px; font-size: 28px; box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--accent); }
.tr-id { flex: 1; min-width: 160px; display: grid; gap: 4px; justify-items: start; }
.tr-id h1 { font-size: 24px; font-weight: 700; overflow-wrap: anywhere; }
.tr-wallet { padding: 3px 8px; border: 0; border-radius: 6px; background: var(--deep); color: var(--muted); font-size: 12px; font-weight: 600; }
.tr-wallet:hover { color: var(--text); }
.tr-links { display: flex; gap: 8px; }
.tr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; margin-top: 10px; }
.tr-tile { display: grid; gap: 3px; align-content: start; padding: 14px 16px; border-radius: var(--radius); background: var(--card); }
.tr-tile span { color: var(--muted); font-size: 12px; font-weight: 600; }
.tr-tile b { font-size: 19px; font-weight: 700; }
.tr-tile b.off { color: var(--faint); font-size: 15px; }
.tr-tile small { color: var(--faint); font-size: 12px; }
.tr-past li { display: grid; grid-template-columns: 58px minmax(0, 1.2fr) minmax(0, 1.4fr) auto; align-items: center; gap: 12px; }
.tr-past { max-width: none; }
.tr-past .bet-tag { justify-self: start; font-size: 12px; }
.tr-opp { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tr-opp b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-opp:hover b { text-decoration: underline; }
.tr-past .pfp { width: 28px; height: 28px; font-size: 12px; flex: none; }
.tr-score { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-when { font-size: 12px; white-space: nowrap; }

/* ---------- share a bet ---------- */
.share-btn { margin-left: 4px; padding: 3px 10px; border: 1px solid var(--card-2); border-radius: 999px; background: none; color: var(--muted); font-size: 12px; font-weight: 600; }
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.bet-top .bet-tag { margin-left: auto; }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(5, 14, 20, .72); animation: modal-in .15s ease-out; }
@keyframes modal-in { from { opacity: 0; } }
.modal-box { width: min(100%, 640px); max-height: 100%; overflow-y: auto; display: grid; gap: 14px; padding: 16px; border-radius: 14px; background: var(--card); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head b { font-size: 16px; }
.share-canvas { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 8px; background: var(--deep); }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; }
.share-actions .btn { flex: 1; text-align: center; }
.share-hint { font-size: 12px; }

/* ---------- wallet ---------- */
.btn.phantom, .btn.wallet-on { display: inline-flex; align-items: center; gap: 8px; }
.btn.phantom { background: #ab9ff2; color: #1c1633; --ph-eye: #ab9ff2; }
.btn.wallet-on { background: var(--deep); color: var(--text); --ph-eye: var(--deep); font-variant-numeric: tabular-nums; }
.btn.wallet-on .ph-icon { color: #ab9ff2; }
.ph-icon { flex: none; width: 18px; height: 18px; }
.ph-icon svg { width: 100%; height: 100%; display: block; }
.wallet-menu { position: fixed; z-index: 35; min-width: 230px; padding: 6px; display: grid; gap: 2px; background: var(--deep); border: 1px solid var(--card-2); border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, .5); animation: sup-in .14s ease-out; }
.wallet-menu-head { display: grid; gap: 3px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--card-2); }
.wallet-menu-head span { color: var(--faint); font-size: 12px; }
.wallet-menu-head b { font-size: 13px; font-variant-numeric: tabular-nums; }
.wallet-menu button { padding: 9px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.wallet-menu button:hover { background: var(--card); }
.wallet-menu button.danger { color: var(--down); }

/* ---------- support chat ---------- */
.sup-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 56px; height: 56px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); cursor: pointer; box-shadow: 0 8px 22px rgba(0, 0, 0, .45); transition: transform .15s ease, background .15s ease; }
.sup-fab:hover { transform: translateY(-2px) scale(1.04); }
.sup-fab:active { transform: scale(.96); }
.sup-icon svg { width: 100%; height: 100%; display: block; }
.sup-fab .sup-icon { grid-area: 1 / 1; width: 30px; height: 30px; transition: opacity .15s ease, transform .2s ease; }
.sup-fab .sup-icon:last-child { width: 24px; height: 24px; opacity: 0; transform: rotate(-90deg); }
.sup-fab.on { background: var(--card-2); color: var(--text); }
.sup-fab.on .sup-icon:first-child { opacity: 0; transform: rotate(90deg); }
.sup-fab.on .sup-icon:last-child { opacity: 1; transform: none; }
.sup-fab.unread::after { content: ""; position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--down); border: 3px solid var(--bg); }

.sup-panel { position: fixed; right: 20px; bottom: 88px; z-index: 40; width: 360px; max-width: calc(100vw - 32px); height: min(540px, calc(100dvh - 120px)); display: flex; flex-direction: column; overflow: hidden; background: var(--card); border-radius: 14px; box-shadow: 0 18px 48px rgba(0, 0, 0, .55); transform-origin: 100% 100%; animation: sup-in .18s ease-out; }
.sup-panel[hidden] { display: none; }
@keyframes sup-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.sup-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 16px; background: var(--deep); }
.sup-head div { flex: 1; display: grid; gap: 2px; min-width: 0; }
.sup-head b { font-size: 15px; }
.sup-head span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.sup-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.sup-x { width: 34px; height: 34px; border: 0; border-radius: 8px; display: grid; place-items: center; background: none; color: var(--muted); cursor: pointer; }
.sup-x:hover { background: var(--card); color: var(--text); }
.sup-x .sup-icon { width: 18px; height: 18px; }
.sup-send .sup-icon { width: 20px; height: 20px; }

.sup-log { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 16px; overflow-y: auto; scrollbar-color: var(--card-2) transparent; }
.sup-msg { flex: none; max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; animation: sup-in .16s ease-out; }
.sup-msg.bot { align-self: flex-start; background: var(--card-2); border-bottom-left-radius: 4px; }
.sup-msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); font-weight: 500; border-bottom-right-radius: 4px; }
.sup-go .sup-icon { width: 14px; height: 14px; }
.sup-go { display: flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--accent); font-weight: 600; text-decoration: none; }
.sup-go:hover { text-decoration: underline; }
.sup-typing { display: flex; gap: 4px; padding: 14px 13px; }
.sup-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: sup-blink 1s infinite ease-in-out; }
.sup-typing i:nth-child(2) { animation-delay: .15s; }
.sup-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sup-blink { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.sup-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.sup-quick[hidden] { display: none; }
.sup-quick button { padding: 7px 11px; border: 1px solid var(--card-2); border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.sup-quick button:hover { border-color: var(--accent); color: var(--accent); }
.sup-form { display: flex; gap: 8px; padding: 0 12px; }
.sup-form input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1px solid var(--card-2); border-radius: var(--radius); background: var(--deep); color: var(--text); font: inherit; font-size: 14px; outline: none; }
.sup-form input:focus { border-color: var(--accent); }
.sup-form input::placeholder { color: var(--faint); }
.sup-send { flex: none; width: 42px; height: 42px; border: 0; border-radius: var(--radius); display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.sup-note { margin: 0; padding: 8px 12px 10px; text-align: center; color: var(--faint); font-size: 11px; }
@media (prefers-reduced-motion: reduce) {
  .sup-panel, .sup-msg, .sup-typing i { animation: none; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 22px 20px; }
  .hero-stats { grid-template-columns: repeat(4, auto); justify-content: start; gap: 12px 26px; }
  .hero-die { right: 16px; top: 16px; margin-top: 0; width: 84px; height: 84px; }
  .hero-text { padding-right: 96px; }
}

@media (max-width: 760px) {
  .how ol { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 600px) {
  .top-in { padding: 0 16px; }
  .wrap { padding: 0 16px 48px; }
  .nav-bar { margin: 0 -16px 16px; padding: 8px 16px 10px; }
  .who { display: none; }
  .hero h1 { font-size: 27px; }
  .hero-stats { grid-template-columns: repeat(2, auto); }
  .tr-past li { grid-template-columns: 58px minmax(0, 1fr); row-gap: 4px; }
  .tr-score, .tr-when { grid-column: 2; }
  .odds-p { display: none; }
  .odds-line::after { content: attr(data-p); color: var(--muted); font-size: 12px; font-weight: 500; }
  .top-in { gap: 10px; }
  .account { gap: 6px; }
  .btn.phantom, .btn.wallet-on { padding: 10px 11px; }
  .btn.phantom span:last-child, .btn.wallet-on span:last-child { display: none; }
  .account .btn.primary, .balance { padding: 10px 11px; }
  .nav a { padding: 9px 14px; }
  .sup-fab { right: 16px; bottom: 16px; }
  .sup-panel { right: 16px; bottom: 84px; height: min(540px, calc(100dvh - 100px)); }
  .sup-form input { font-size: 16px; } /* stops iOS zooming in on focus */
}
