/* Put DynaPuff-SemiBold.ttf in a folder called "fonts" next to index.html */
@font-face {
  font-family: 'DynaPuffLocal';
  src: url('fonts/DynaPuff-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ease: cubic-bezier(.22, .9, .25, 1);
  --font: 'DynaPuffLocal', 'DynaPuff', ui-rounded, system-ui, sans-serif;
  --bg: #121318;
  --panel: #1a1b21;
  --panel-2: #22232b;
  --line: #25262e;
  --text: #f4f5f8;
  --muted: #868997;
  --green: #1fe25f;
  --green-d: #10973f;
  --red: #f01f42;
  --red-d: #a10f2a;
  --orange: #ff8a24;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }

/* ---------- top ---------- */
.top {
  display: flex; align-items: center;
  width: 100%; height: 68px; padding: 0 24px 0 0; flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
/* logo area lines up with the chat panel; its grey edge continues the panel's line */
.brand {
  width: 300px; height: 100%; flex-shrink: 0; display: flex; align-items: center; padding-left: 24px;
  border-right: 1px solid var(--line); transition: border-color .45s var(--ease);
}
.tabs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding-left: 20px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px; border-radius: 11px;
  font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap;
  background: var(--panel); border: 1.5px solid transparent;
  transition: color .15s ease, background .15s ease, border-color .25s ease, transform .12s var(--ease);
}
.tab svg { width: 17px; height: 17px; flex-shrink: 0; transition: color .25s ease; }
.tab:hover { color: #fff; background: #20212a; }
.tab:active { transform: scale(.96); }
.tab.on { color: #fff; border-color: rgba(31, 226, 95, .55); background: rgba(31, 226, 95, .07); }
.tab.on svg { color: var(--green); }
.top-right { margin-left: auto; }
.logo { font-size: 28px; letter-spacing: 1px; color: #fff; text-decoration: none; text-shadow: 0 3px 0 var(--green-d); }
/* profile button + menu */
.profile { position: relative; }
.profile-btn {
  position: relative;
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(150deg, #2a2c38 0%, #1c1d25 100%);
  border: 1px solid #333543; color: #b6b9c7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 4px 12px rgba(0, 0, 0, .25);
  transition: border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.profile-btn svg { width: 22px; height: 22px; }
.profile-btn:hover { color: #fff; border-color: #4a4d5d; }
.profile-btn:active { transform: scale(.95); }
.profile-btn.open { color: #fff; border-color: #5d6070; box-shadow: 0 0 0 3px rgba(150, 155, 172, .14); }
/* menu opens AND closes with an animation (class "open" instead of hidden) */
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 250px; padding: 8px;
  background: #1a1b22; border: 1px solid #2a2b35; border-radius: 14px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .55);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .12s ease, visibility 0s linear .12s;
}
.menu.open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .12s ease, visibility 0s; }
.mi {
  display: flex; align-items: center; gap: 14px; width: 100%; height: 42px; padding: 0 12px;
  border-radius: 9px; font-size: 15px; color: #f1f2f6; text-align: left;
  transition: background .12s ease, color .12s ease;
}
.mi svg { width: 18px; height: 18px; flex-shrink: 0; }
.mi:hover { background: #23242e; }
.mi.sub { color: #6e7180; }
.mi.sub:hover { color: #c9cbd6; }
.menu-sep { height: 1px; margin: 8px 4px; background: #2a2b35; }
.soon {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%);
  padding: 10px 16px; border-radius: 10px; background: #23242d; border: 1px solid #33343f;
  font-size: 14px; color: #e4e5ec; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); white-space: nowrap;
}
.soon[hidden] { display: none; }
.soon.show { animation: toastIn .28s var(--ease); }
.soon.out { animation: toastOut .22s ease forwards; }

/* ---------- game ---------- */
.shell {
  flex: 1; display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 0;
  transition: grid-template-columns .45s var(--ease);
}
.side { min-width: 0; overflow: hidden; border-right: 1px solid var(--line); background: #15161b; transition: border-color .45s var(--ease), visibility 0s; }
.side > * { width: 299px; }   /* content keeps its width while the panel slides */
.side {
  height: 100%;
  display: flex; flex-direction: column;
}
.side-head { flex-shrink: 0; }

/* ---------- chat ---------- */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-list {
  flex: 1; min-height: 0; overflow-y: auto; padding: 12px 10px 8px;
  display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: thin; scrollbar-color: #2c2d37 transparent;
}
.chat-empty { margin: auto; padding-bottom: 30px; text-align: center; font-size: 13px; color: #5f6271; }
.msg { display: flex; gap: 10px; padding: 7px 8px; border-radius: 10px; transition: background .15s ease; }
.msg:hover { background: #1a1b21; }
.msg.new { animation: msgIn .34s var(--ease); }
.msg-ava {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(150deg, #2a2c38, #1c1d25); border: 1px solid #333543; color: #b6b9c7;
}
.msg-ava svg { width: 15px; height: 15px; }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.msg-head b { font-weight: 600; color: #fff; }
.msg-head time { font-size: 11px; color: #5f6271; }
.msg-text { margin-top: 2px; font-size: 14px; line-height: 1.45; color: #d4d6df; overflow-wrap: anywhere; }
.msg-text .emo { width: 21px; height: 21px; margin: 0 1px; vertical-align: -5px; }
.msg-text.jumbo .emo { width: 42px; height: 42px; margin: 2px 2px 0 0; vertical-align: middle; }

.chat-bottom { position: relative; flex-shrink: 0; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.chat-form { display: flex; gap: 8px; }
.chat-box {
  flex: 1; min-width: 0; height: 44px; padding: 0 9px 0 14px; display: flex; align-items: center;
  background: var(--panel); border: 1.5px solid #2a2b35; border-radius: 12px; transition: border-color .15s ease;
}
.chat-box:focus-within { border-color: #474a58; }
.chat-box.shake { border-color: var(--red); }
.chat-box input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 14px; }
.chat-box input::placeholder { color: #5c5f6c; }
.emoji-btn { width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px; display: grid; place-items: center; transition: background .15s ease; }
.emoji-btn:hover, .emoji-btn.open { background: #23242e; }
.emoji-btn img { width: 16px; height: 16px; filter: grayscale(1) brightness(.9); opacity: .7; }
.emoji-btn:hover img, .emoji-btn.open img { filter: none; opacity: 1; }
.send-btn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center;
  background: var(--green); color: #052a12; box-shadow: 0 3px 0 var(--green-d);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease, opacity .2s ease, background .2s ease;
}
.send-btn svg { width: 18px; height: 18px; transform: translateX(1px); }
.send-btn:hover:not(:disabled) { filter: brightness(1.08); }
.send-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--green-d); }
.send-btn:disabled { background: #23242c; color: #4c4f5b; box-shadow: 0 3px 0 #17181d; }

.emoji-pop {
  position: absolute; right: 64px; bottom: calc(100% + 6px); z-index: 5;
  display: none; grid-template-columns: repeat(5, 34px); gap: 2px; padding: 6px;
  background: #1d1e25; border: 1px solid #2c2d37; border-radius: 12px; box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}
.emoji-pop.open { display: grid; }
.emoji-pop button { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; }
.emoji-pop button:hover { background: #2a2b35; }
.emoji-pop img { width: 24px; height: 24px; pointer-events: none; }
.shake { animation: shake .35s; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* chat panel toggle (bottom of the panel's edge) */
.side-toggle {
  position: fixed; left: 300px; bottom: 13px; z-index: 25;
  width: 30px; height: 42px; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line); border-left: 0; border-radius: 0 11px 11px 0;
  color: var(--muted);
  transition: left .45s var(--ease), color .15s ease, background .15s ease;
}
.side-toggle svg { width: 16px; height: 16px; transition: transform .45s var(--ease); }
.side-toggle:hover { color: #fff; background: #20212a; }
@media (min-width: 1001px) {
  body.side-closed .shell { grid-template-columns: 0px minmax(0, 1fr); }
  body.side-closed .brand { border-right-color: transparent; }
  body.side-closed .side { border-right-color: transparent; visibility: hidden; transition: border-color .45s var(--ease), visibility 0s linear .45s; }
  body.side-closed .side-toggle { left: 0; border-left: 1px solid var(--line); }
  body.side-closed .side-toggle svg { transform: rotate(180deg); }
}
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--line);
}
.online { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.online i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.online span:not(:empty) { margin-left: -4px; }
.socials { display: flex; gap: 8px; }
.social {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--panel-2); color: var(--muted); text-decoration: none;
  transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.social img { width: 17px; height: 17px; filter: invert(1); opacity: .7; transition: opacity .25s ease; }
.social span { display: none; font-size: 12px; }
.social.noicon img { display: none; }
.social.noicon span { display: block; }
.social:hover { color: #fff; }
.social:hover img { opacity: 1; }
.social:active { transform: translateY(0); box-shadow: none; }
.social.discord:hover { background: #5865f2; }
.social.x:hover { background: #000; }
.game {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  width: 100%; padding: 20px 24px 24px;
}
/* top strip: "Last 100" counters + last 5 rounds, in one panel like the bet bar */
.game { container-type: inline-size; container-name: game; }
.game-top {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  min-height: 62px; padding: 7px 7px 7px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.last100 { display: flex; align-items: center; gap: 16px; }
.l100-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.l100-row { display: flex; align-items: center; gap: 16px; }
.l100 { display: flex; align-items: center; gap: 7px; }
.l100 b { min-width: 10px; font-size: 16px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.mcoin {
  height: 24px; padding: 0 8px; display: grid; place-items: center; border-radius: 7px;
  font-style: normal; font-size: 12px; line-height: 1; white-space: nowrap;
  background: var(--tint); border: 1px solid var(--ring);
}
.c2   { --tint: rgba(255, 255, 255, .05); --ring: rgba(255, 255, 255, .16); color: #e8e9ef; }
.c10  { --tint: rgba(254, 240, 138, .07); --ring: rgba(254, 240, 138, .32); color: #fef08a; }
.c50  { --tint: rgba(248, 194, 2, .09);   --ring: rgba(248, 194, 2, .42);   color: #f8c202; }
.c100 { --tint: rgba(192, 132, 252, .1);  --ring: rgba(192, 132, 252, .45); color: #d8b4fe; }
.history { display: flex; gap: 6px; margin-left: auto; }
.hist-item {
  width: 56px; height: 52px; padding: 7px 0 5px; border-radius: 9px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  background: #202129; border: 1px solid transparent; transition: background .15s ease, border-color .15s ease;
}
.hist-item canvas { display: block; width: 40px; height: 28px; }
.hist-item span { font-size: 11px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.hist-item.good span { color: var(--green); }
.hist-item:hover { background: #262730; }
.hist-item.on { border-color: rgba(31, 226, 95, .6); background: #1c2620; }
.hist-item.empty { background: transparent; border: 1px dashed #2b2c36; cursor: default; }
.hist-item.empty:hover { background: transparent; }
@container game (max-width: 740px) {
  .history { width: 100%; margin-left: 0; }
  .hist-item { flex: 1; }
}
@container game (max-width: 420px) {
  .game-top { padding: 10px; }
  .last100 { width: 100%; }
  .l100-label { display: none; }
  .l100-row { width: 100%; justify-content: space-between; gap: 6px; }
}

.round-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px; padding: 12px 20px 12px 12px;
  background: #1d1e25; border: 1px solid #2c2d37; border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
  animation: popIn .18s ease;
}
.round-pop[hidden] { display: none; }
.pop-thumb {
  width: 78px; height: 82px; padding: 8px 0 7px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  background: var(--panel); border: 1.5px solid var(--line);
}
.pop-thumb canvas { display: block; width: 60px; height: 44px; }
.pop-thumb span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pop-info { display: flex; flex-direction: column; gap: 3px; }
.pop-label { font-size: 11px; letter-spacing: .8px; color: var(--muted); }
.pop-info strong { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pop-sub { font-size: 12px; color: #5f6271; }
.pop-info strong.up { color: var(--green); }
.pop-info strong.down { color: var(--red); }
.pop-info strong.flat { color: var(--muted); }

.chart-wrap {
  position: relative; flex: 1; min-height: 360px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.chart-wrap canvas { position: absolute; left: 0; top: 0; display: block; }

/* presale */
.presale-overlay { position: absolute; inset: 0; display: none; pointer-events: none; }
.presale-overlay.show { display: block; animation: fade .35s ease; }
.presale-tag { position: absolute; left: 20px; top: 18px; max-width: 240px; }
.presale-tag h3 { font-size: 26px; font-weight: 600; letter-spacing: 1px; }
.presale-tag p { margin-top: 5px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.presale-tag em { font-style: normal; color: var(--green); }
.countdown { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; white-space: nowrap; }
.countdown span { display: block; font-size: 17px; color: #e4e5ec; }
.countdown strong {
  display: block; margin-top: 8px; font-size: 56px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 0 #000, 0 10px 24px rgba(0, 0, 0, .55);
}
.presale-queued { margin-top: 18px; min-height: 18px; font-size: 14px; color: var(--green); }

/* rug-bet coin */
.coin {
  position: absolute; left: 16px; bottom: 16px; z-index: 2;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #93501d 0%, #5c2b0b 72%);
  border: 3px solid var(--orange);
  box-shadow: 0 4px 0 #6e3510;
  transition: transform .1s ease, opacity .2s ease;
}
.coin:hover:not(:disabled) { transform: scale(1.06); }
.coin:active:not(:disabled) { transform: scale(.94); }
.coin:disabled { opacity: .4; }
.coin-face { display: inline-block; font-size: 14px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); font-variant-numeric: tabular-nums; }
.coin-face.flip { animation: flip .32s ease; }
.coin-ring { position: absolute; left: -9px; top: -9px; width: 66px; height: 66px; transform: rotate(-90deg); pointer-events: none; opacity: 0; transition: opacity .2s; }
.coin-ring circle { fill: none; stroke: var(--orange); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 194.8; stroke-dashoffset: 0; }
.coin.live .coin-ring { opacity: 1; }
.coin-hint {
  position: absolute; left: 82px; bottom: 30px; z-index: 2;
  font-size: 12px; color: var(--muted); white-space: nowrap;
  opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.coin:hover:not(:disabled) + .coin-hint, .coin-hint.show { opacity: 1; transform: none; }
.coin-hint.live { color: var(--orange); }

/* ---------- controls ---------- */
.controls { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: 5px; container-type: inline-size; }
@container (max-width: 860px) {
  .controls .bar { grid-template-columns: minmax(0, 1fr); }
  .controls .empty-panel { display: none; }
}
.bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; width: 100%; }
.panel {
  display: flex; align-items: center; gap: 6px; height: 60px; padding: 0 10px 0 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s;
}
.amount-panel:focus-within { border-color: #363842; }
.amount-panel.bad { border-color: var(--red); animation: shake .35s; }
.amount-panel.over input { color: var(--red); }
.empty-panel { background: #18191e; }

.sol-ic {
  display: inline-block; flex-shrink: 0; width: 16px; height: 16px;
  background: linear-gradient(135deg, #9945ff 0%, #19fb9b 100%);
  -webkit-mask: url('https://cdn.jsdelivr.net/npm/simple-icons@13.0.0/icons/solana.svg') center / contain no-repeat;
  mask: url('https://cdn.jsdelivr.net/npm/simple-icons@13.0.0/icons/solana.svg') center / contain no-repeat;
}
.amount { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; height: 100%; cursor: text; }
.amount input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0;
  font-size: 18px; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.amount input::-webkit-outer-spin-button,
.amount input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount input::placeholder { color: var(--text); }
.chip {
  height: 40px; padding: 0 12px; border-radius: 9px; flex-shrink: 0;
  background: var(--panel-2); color: #c9cbd6; font-size: 14px;
  transition: background .15s, color .15s;
}
.chip:hover { background: #2a2b35; color: #fff; }
.chip:active { transform: translateY(1px); }
.bal-chip {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; flex-shrink: 0;
  border: 1px solid #2c2d37; border-radius: 9px;
  color: #ffc93c; font-size: 14px; font-variant-numeric: tabular-nums;
}
.btns { display: flex; justify-content: center; gap: 12px; width: 100%; max-width: 336px; }

.btn {
  flex: 1; min-width: 0; height: 66px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  transition: transform .07s, box-shadow .07s, background .2s, color .2s;
}
.btn b { font-size: 24px; font-weight: 600; letter-spacing: 1px; }
.btn small { font-size: 12px; opacity: .85; font-variant-numeric: tabular-nums; }
.btn small:empty { display: none; }
.btn.buy { background: var(--green); color: #06280f; box-shadow: 0 5px 0 var(--green-d); }
.btn.sell { background: var(--red); color: #fff; box-shadow: 0 5px 0 var(--red-d); }
.btn.buy:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-d); }
.btn.sell:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--red-d); }
.btn:disabled { background: var(--panel-2); color: #4c4f5b; box-shadow: 0 5px 0 #17181d; }

[hidden] { display: none !important; }

/* ---------- pages (settings, gamble safely) ---------- */
.main-area {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
  scrollbar-width: thin; scrollbar-color: #2c2d37 transparent;
}
.main-area > .game { flex: 1; }
.page { flex: 1; }
.page-inner { width: 100%; max-width: 640px; margin: 0 auto; padding: 22px 20px 60px; display: flex; flex-direction: column; gap: 16px; }
.back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; color: var(--muted); text-decoration: none; font-size: 14px; padding: 6px 10px 6px 4px; border-radius: 8px; transition: color .15s, background .15s; }
.back svg { width: 18px; height: 18px; }
.back:hover { color: #fff; background: var(--panel); }
.page h1 { font-size: 34px; font-weight: 600; letter-spacing: .3px; }
.lead { font-size: 15px; line-height: 1.55; color: #c3c5d0; }
.set-card { padding: 18px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.set-card h2 { font-size: 21px; font-weight: 600; margin-bottom: 6px; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; min-height: 52px; font-size: 15px; color: var(--text); text-align: left; text-decoration: none;
}
.row + .row { border-top: 1px solid #26272f; }
label.row { cursor: pointer; }
.row.link { transition: color .15s; }
.row.link:hover { color: var(--green); }
.chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); opacity: .7; margin-right: 4px; }
.dom { font-size: 13px; color: var(--muted); }
.note { font-size: 13px; line-height: 1.5; color: #8b8e9c; }
.note.small { font-size: 12px; }
.note.center { text-align: center; }

/* toggle switch */
.sw {
  -webkit-appearance: none; appearance: none; flex-shrink: 0; position: relative;
  width: 42px; height: 24px; border-radius: 12px; background: #3a3b45; cursor: pointer;
  transition: background .2s ease;
}
.sw::before {
  content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .2s ease;
}
.sw:checked { background: var(--green); }
.sw:checked::before { transform: translateX(18px); }
.sw:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* volume slider */
.vol { display: flex; align-items: center; gap: 14px; }
.vol b { width: 40px; text-align: right; font-size: 13px; font-weight: 600; color: var(--muted); }
.vol input {
  -webkit-appearance: none; appearance: none; width: min(230px, 40vw); height: 6px; border-radius: 3px; cursor: pointer;
  background: linear-gradient(to right, var(--green) var(--p, 70%), #3a3b45 var(--p, 70%));
}
.vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--green); }
.vol input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--green); }

.logout {
  height: 50px; border-radius: 12px; border: 1px solid rgba(240, 31, 66, .35); background: rgba(240, 31, 66, .04);
  color: #ff6b81; font-size: 14px; transition: background .15s, border-color .15s;
}
.logout:hover { background: rgba(240, 31, 66, .1); border-color: rgba(240, 31, 66, .6); }

/* gamble safely bits */
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.opts button {
  height: 40px; padding: 0 16px; border-radius: 10px; font-size: 14px;
  background: var(--panel-2); border: 1px solid #2c2d37; color: #d4d6df; transition: .15s;
}
.opts button:hover { border-color: #474a58; color: #fff; }
.opts button.on { border-color: var(--green); color: var(--green); background: rgba(31, 226, 95, .08); }
.opts button:disabled { opacity: .4; cursor: default; }
.status { margin-top: 12px; padding: 12px 14px; border-radius: 10px; font-size: 14px; background: rgba(255, 138, 36, .1); color: var(--orange); }
.limit-row { display: flex; gap: 10px; margin: 12px 0 8px; }
.limit-row .field { flex: 1; }
.limit-row .btn-primary { width: 110px; }
.signs { margin: 6px 0 0 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.45; color: #c3c5d0; }
.lock-banner {
  width: 100%; padding: 11px 16px; border-radius: 12px; text-align: center; font-size: 14px;
  background: rgba(255, 138, 36, .1); border: 1px solid rgba(255, 138, 36, .3); color: var(--orange);
}
.lock-banner a { color: inherit; }

/* ---------- modals (vault, reminders) ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px;
  background: rgba(6, 7, 10, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: fade .15s ease;
}
.modal {
  width: min(440px, 100%); background: #1c1d24; border: 1px solid #2c2d37; border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6); animation: popIn .18s ease;
}
.modal.small { width: min(380px, 100%); }
.m-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 20px; border-bottom: 1px solid #2a2b35; }
.m-head h3 { flex: 1; font-size: 22px; font-weight: 600; }
.m-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(31, 226, 95, .12); color: var(--green); }
.m-ic svg { width: 20px; height: 20px; }
.m-back, .m-x { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); transition: .15s; }
.m-back { background: #2a2b35; color: #fff; }
.m-back svg, .m-x svg { width: 18px; height: 18px; }
.m-x:hover, .m-back:hover { background: #33343f; color: #fff; }
.m-body { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 22px; }
.stored { padding: 20px; text-align: center; background: #16171c; border: 1px solid #2c2d37; border-radius: 14px; }
.stored span { font-size: 12px; letter-spacing: 1.2px; color: var(--muted); }
.stored strong { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 6px; font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stored strong b { font-weight: 600; }
.stored .sol-ic { width: 26px; height: 26px; }
.inbal { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid #2c2d37; border-radius: 12px; font-size: 14px; color: #c9cbd6; }
.inbal b { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.m-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-label { font-size: 12px; letter-spacing: 1.2px; color: #c9cbd6; }
.btn-primary, .btn-grey {
  height: 50px; border-radius: 12px; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .07s, box-shadow .07s, filter .15s, opacity .15s;
}
.btn-primary svg, .btn-grey svg { width: 18px; height: 18px; }
.btn-primary { background: var(--green); color: #052a12; box-shadow: 0 4px 0 var(--green-d); }
.btn-grey { background: #34353f; color: #fff; box-shadow: 0 4px 0 #24252d; }
.btn-primary:hover:not(:disabled), .btn-grey:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:active:not(:disabled), .btn-grey:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.btn-primary:disabled { opacity: .35; cursor: default; }
.btn-primary.wide { width: 100%; margin-top: 6px; }
.field {
  display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 8px 0 14px;
  background: #16171c; border: 1.5px solid #34353f; border-radius: 12px; cursor: text; transition: border-color .15s;
}
.field:focus-within { border-color: #5a5d6b; }
.field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 17px; font-variant-numeric: tabular-nums; }
.field input::placeholder { color: #5c5f6c; }
.field.big { height: 56px; }
.remind-big { font-size: 18px; line-height: 1.4; }

/* ---------- slick extras ---------- */
.enter { animation: pageIn .2s ease both; }
.modal-bg.closing { animation: fadeOut .16s ease forwards; }
.modal-bg.closing .modal { animation: popOut .16s ease forwards; }
.round-pop.closing { animation: popOut .14s ease forwards; }
.lock-banner { animation: slideDown .32s var(--ease); }
.chip, .social, .opts button, .m-x, .m-back, .hist-item, .profile-btn, .side-toggle, .back { -webkit-tap-highlight-color: transparent; }
.chip:active, .opts button:active, .m-x:active, .m-back:active { transform: scale(.94); }
.chip { transition: background .15s ease, color .15s ease, transform .12s var(--ease); }
.side-toggle:active { transform: scale(.94); }
.bal-chip { transition: border-color .3s ease, background .3s ease; }
.bal-chip.flash-up { animation: flashUp .7s ease; }
.bal-chip.flash-down { animation: flashDown .7s ease; }
.row.link:hover .chev { opacity: 1; }
.btn, .btn-primary, .btn-grey { will-change: transform; }

@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px) scale(.97); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes flashUp { 0% { border-color: var(--green); background: rgba(31, 226, 95, .14); } 100% { border-color: #2c2d37; background: transparent; } }
@keyframes flashDown { 0% { border-color: var(--red); background: rgba(240, 31, 66, .12); } 100% { border-color: #2c2d37; background: transparent; } }

/* reduce motion */
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; }

/* ---------- animations ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes flip { 0% { transform: scaleY(1); } 50% { transform: scaleY(0); } 100% { transform: scaleY(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- smaller screens: hide the side panel ---------- */
@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side-toggle { display: none; }
  .brand { width: auto; border-right: 0; padding-left: 0; }
  .top { padding: 0 20px; }
  .tabs { padding-left: 16px; }
  .top .chat-btn { display: grid; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 80; height: 100vh; height: 100dvh;
    width: min(320px, 88vw); border-right: 1px solid var(--line); box-shadow: 24px 0 60px rgba(0, 0, 0, .5);
    transform: translateX(-104%); visibility: hidden;
    transition: transform .42s var(--ease), visibility 0s linear .42s;
  }
  .side > * { width: auto; }
  body.chat-open .side { transform: none; visibility: visible; transition: transform .42s var(--ease), visibility 0s; }
  body .chat-scrim { display: block; position: fixed; inset: 0; z-index: 79; background: rgba(5, 6, 9, .55); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
  body.chat-open .chat-scrim { opacity: 1; pointer-events: auto; }
}

/* ---------- phone ---------- */
@media (max-width: 640px) {
  .top { height: auto; flex-wrap: wrap; row-gap: 10px; padding: 10px 14px; }
  .brand { order: 1; }
  .top-right { order: 2; }
  .tabs { order: 3; flex: 1 1 100%; padding-left: 0; gap: 6px; }
  .tab { flex: 1; justify-content: center; height: 38px; padding: 0 8px; font-size: 13px; }
  .logo { font-size: 24px; }
  .profile-btn { width: 40px; height: 40px; border-radius: 12px; }
  .menu { width: min(250px, calc(100vw - 24px)); }
  .page-inner { padding: 18px 14px 50px; }
  .page h1 { font-size: 28px; }
  .set-card { padding: 16px; }
  .opts button { flex: 1 1 40%; }
  .game { padding: 12px 12px 16px; gap: 10px; }
  .chart-wrap { min-height: 320px; }
  .presale-tag { left: 14px; top: 14px; }
  .presale-tag h3 { font-size: 20px; }
  .presale-tag p { max-width: 190px; }
  .countdown strong { font-size: 44px; }
  .coin { width: 46px; height: 46px; left: 12px; bottom: 12px; }
  .coin-face { font-size: 12px; }
  .coin-ring { left: -10px; top: -10px; width: 60px; height: 60px; }
  .coin-hint { left: 68px; bottom: 25px; }
  .controls { gap: 10px; }
  .bar { grid-template-columns: minmax(0, 1fr); }
  .empty-panel { display: none; }
  .panel { height: 56px; padding: 0 8px 0 14px; }
  .chip { padding: 0 10px; }
  .btns { max-width: none; }
  .btns { gap: 10px; }
  .btn { height: 60px; }
}

.bal-chip.usd .sol-ic { display: none; }
body.no-anim .shell, body.no-anim .side, body.no-anim .side-toggle, body.no-anim .side-toggle svg { transition: none !important; }

/* top-right buttons + chat button (chat button only shows on smaller screens) */
.top-right { display: flex; align-items: center; gap: 10px; }
.chat-btn { display: none; }
.chat-btn.open { color: #fff; border-color: #5d6070; box-shadow: 0 0 0 3px rgba(150, 155, 172, .14); }
.chat-scrim { display: none; }

/* ---------- rewards & ranks pages ---------- */
.page-inner.wide { max-width: 900px; }
.sub-h { margin-top: 8px; font-size: 22px; font-weight: 600; }
.lead b { color: #fff; font-weight: 600; }
.rank-card { display: flex; flex-direction: column; gap: 12px; }
.rank-top { display: flex; align-items: center; gap: 14px; }
.rank-badge-lg svg { display: block; width: 58px; height: 58px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45)); }
.rank-who { display: flex; flex-direction: column; gap: 2px; }
.rank-name { font-size: 22px; }
.rank-lvl { font-size: 13px; color: var(--muted); }
.rank-link { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); text-decoration: none; transition: color .15s ease; }
.rank-link:hover { color: #fff; }
.xp-bar { height: 10px; border-radius: 6px; background: #23242c; overflow: hidden; }
.xp-bar i {
  display: block; height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--c2, #10973f), var(--c1, #1fe25f));
  transition: width .9s var(--ease);
}
.xp-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.crate-row { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.crate-ic svg { display: block; width: 56px; height: 56px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .4)); }
.crate-info { display: flex; flex-direction: column; gap: 3px; }
.crate-info b { font-size: 16px; font-weight: 600; }
.crate-info span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.crate-btn { margin-left: auto; min-width: 130px; padding: 0 16px; }
.crate-win {
  margin-top: 14px; padding: 14px; text-align: center; border-radius: 12px; font-size: 24px; font-variant-numeric: tabular-nums;
  background: rgba(31, 226, 95, .07); border: 1px solid rgba(31, 226, 95, .28); color: var(--green);
}

.claim-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.claim-amt { display: flex; align-items: center; gap: 8px; font-size: 26px; font-variant-numeric: tabular-nums; }
.claim-amt b { font-weight: 600; }
.claim-amt span { font-size: 14px; color: var(--muted); }
.claim-amt .sol-ic { width: 20px; height: 20px; }
.claim-row .btn-primary { margin-left: auto; min-width: 120px; padding: 0 16px; }

.bonus-list { display: flex; flex-direction: column; margin-top: 6px; }
.bonus { display: flex; align-items: center; gap: 12px; min-height: 58px; }
.bonus + .bonus { border-top: 1px solid #26272f; }
.bonus > svg { width: 32px; height: 32px; flex-shrink: 0; }
.b-name { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.b-name b { font-size: 15px; font-weight: 600; }
.b-name span { font-size: 12px; color: var(--muted); }
.b-amt { font-size: 14px; color: #e4e5ec; font-variant-numeric: tabular-nums; white-space: nowrap; }
.b-claim {
  height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13px;
  background: var(--green); color: #052a12; box-shadow: 0 3px 0 var(--green-d); transition: transform .08s, box-shadow .08s, filter .15s;
}
.b-claim:hover { filter: brightness(1.08); }
.b-claim:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--green-d); }
.b-state { min-width: 74px; text-align: right; font-size: 12px; color: #5f6271; }
.b-state.done { color: var(--green); }
.bonus.locked { opacity: .5; }

/* tier table */
.table-card { padding: 4px 0; overflow: hidden; }
.tt-row {
  display: grid; grid-template-columns: 1.5fr .8fr 1.8fr .8fr; align-items: center; gap: 10px;
  padding: 11px 22px; font-size: 14px; font-variant-numeric: tabular-nums; color: #d4d6df;
}
.tt-row + .tt-row { border-top: 1px solid #23242c; }
.tt-head { padding: 12px 22px 10px; font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.tt-tier { display: flex; align-items: center; gap: 10px; }
.tt-tier svg { width: 26px; height: 26px; flex-shrink: 0; }
.tt-tier b { font-weight: 600; }
.tt-row.cur { background: rgba(31, 226, 95, .06); box-shadow: inset 3px 0 0 var(--green); }

/* perk cards */
.perk-list { display: flex; flex-direction: column; gap: 10px; }
.perk {
  display: grid; grid-template-columns: 1.15fr 1fr 1.6fr; gap: 16px; align-items: center;
  padding: 16px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.perk.locked { opacity: .55; }
.perk.current { border-color: rgba(31, 226, 95, .5); box-shadow: 0 0 0 3px rgba(31, 226, 95, .07); }
.p-tier { display: flex; align-items: center; gap: 12px; }
.p-tier svg { width: 42px; height: 42px; flex-shrink: 0; }
.p-tier b { display: block; font-size: 16px; font-weight: 600; }
.p-tier span { font-size: 12px; color: var(--muted); }
.p-crate b { display: block; font-size: 14px; font-weight: 600; }
.p-crate span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-perks { list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #c3c5d0; }
.p-perks li::before { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 9px 2px 0; border-radius: 50%; background: #5f6271; }
.tag { display: inline-block; margin-left: 6px; padding: 3px 6px; border-radius: 6px; font-size: 9px; font-style: normal; letter-spacing: .6px; vertical-align: 2px; }
.tag.cur { color: var(--green); background: rgba(31, 226, 95, .1); border: 1px solid rgba(31, 226, 95, .35); }
.tag.vip { color: #ffd24a; background: rgba(255, 210, 74, .08); border: 1px solid rgba(255, 210, 74, .35); }

/* rank badge + level in chat */
.lvl { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 2px; border-radius: 7px; background: #20212a; font-size: 11px; color: #c9cbd6; font-variant-numeric: tabular-nums; }
.lvl svg { width: 15px; height: 15px; }
.msg.leaving { animation: msgOut .45s var(--ease) forwards; overflow: hidden; }

@keyframes msgOut { 0% { opacity: 1; max-height: 140px; } 60% { opacity: 0; transform: translateX(-12px); max-height: 140px; } 100% { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; transform: translateX(-12px); } }

@media (max-width: 760px) {
  .tt-row { grid-template-columns: 1.4fr .8fr 1.5fr; padding: 10px 14px; font-size: 13px; }
  .tt-row > :nth-child(4) { display: none; }
  .perk { grid-template-columns: 1fr; gap: 10px; padding: 14px 16px; }
  .crate-row, .claim-row { flex-wrap: wrap; }
  .crate-btn, .claim-row .btn-primary { margin-left: 0; width: 100%; }
}

/* level chip on the profile button + rank row at the top of the menu */
.p-lvl {
  position: absolute; right: -6px; bottom: -6px; min-width: 20px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 7px; font-size: 10px; line-height: 1; color: #121318;
  background: linear-gradient(180deg, var(--c1, #c9ccd6), var(--c2, #7d8190));
  border: 2px solid var(--bg, #121318); font-variant-numeric: tabular-nums;
}
.menu-rank {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px;
  color: #fff; text-decoration: none; transition: background .15s ease;
}
.menu-rank:hover { background: #24252e; }
.mr-badge svg { display: block; width: 36px; height: 36px; }
.mr-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mr-info b { font-size: 15px; font-weight: 600; }
.mr-info > span:not(.mr-bar) { font-size: 12px; color: var(--muted); }
.mr-bar { display: block; height: 5px; margin-top: 2px; border-radius: 3px; background: #2a2b35; overflow: hidden; }
.mr-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--c2, #10973f), var(--c1, #1fe25f)); transition: width .6s var(--ease); }
.msg-head { align-items: center; }
.msg-head b.vip-name { text-shadow: 0 0 10px currentColor; }

/* waiting buttons on the rewards page are grey, not dim green */
.crate-btn:disabled, .claim-row .btn-primary:disabled {
  opacity: 1; background: #24252d; color: #7c7f8e; box-shadow: 0 4px 0 #17181d; font-variant-numeric: tabular-nums;
}
.rank-who { min-width: 0; }
.rank-link { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 760px) {
  .rank-link { font-size: 0; gap: 0; padding: 8px; }
  .rank-name { font-size: 20px; }
}

/* "Back to game" at the left edge of the page area (lines up with the game's left edge) */
.page > .back { margin: 18px 0 0 20px; }
.page > .back + .page-inner { padding-top: 6px; }
@media (max-width: 640px) { .page > .back { margin: 12px 0 0 8px; } }

/* ---------- login (Privy) ---------- */
.login-btn {
  height: 44px; padding: 0 18px; border-radius: 12px; font-size: 15px; white-space: nowrap;
  background: var(--green); color: #052a12; box-shadow: 0 3px 0 var(--green-d);
  transition: transform .07s, box-shadow .07s, filter .15s, opacity .15s;
}
.login-btn:hover:not(:disabled) { filter: brightness(1.08); }
.login-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--green-d); }
.login-btn:disabled { opacity: .55; }
.menu-user { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px 10px; }
.menu-user b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-user button { align-self: flex-start; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.menu-user button:hover { color: #fff; }
@media (max-width: 640px) { .login-btn { height: 40px; padding: 0 14px; font-size: 14px; } }
