:root {
  --page: #0b0c11;
  --panel: #101219;
  --card: #14161f;
  --card-2: #191c26;
  --hover: #1f2330;
  --active: #232736;
  --input: #08090d;
  --line: rgba(255, 255, 255, .06);
  --line-strong: #2f3443;

  --text: #eceef4;
  --muted: #8a90a3;
  --subtle: #5f6578;

  --accent: #f2384a;
  --accent-hi: #ff5a68;
  --accent-deep: #b81d2c;
  --gem: #3fd0ff;
  --gold: #f5c451;
  --orange: #ff9b1a;
  --win: #34d77b;
  --loss: #ff5a76;

  --c-red: #ef4444;
  --c-orange: #f97316;
  --c-yellow: #eab308;
  --c-green: #16a34a;
  --c-blue: #2563eb;
  --c-purple: #9333ea;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --header-h: 64px;
  --rail-w: 72px;
  --nav-w: 224px;
  --chat-w: 340px;

  --body: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Geist', system-ui, sans-serif;

    --bg: var(--page);
  --raised: var(--card-2);
  --line-2: var(--line-strong);
  --violet: var(--accent);
  --violet-hi: var(--accent-hi);
  --dim: var(--subtle);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
img { display: block; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #2f3443; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3d4356; }
::-webkit-scrollbar-track { background: transparent; }

.gem-icon { width: 1.1em; height: 1.1em; flex: none; display: inline-block; vertical-align: -.18em; }
.icon-svg { width: 18px; height: 18px; flex: none; }
.gem-text { color: var(--gem); }
.gold-text { color: var(--gold); }
.hint { color: var(--muted); font-size: 13px; }
.full-width { width: 100%; }

body.auth-pending .auth-only, body.auth-pending .guest-only { display: none !important; }
body.logged-out .auth-only { display: none !important; }
body.logged-in .guest-only { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, opacity .15s, transform .1s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 18px -8px rgba(242, 56, 74, .8); }
.btn-primary:hover:not(:disabled) { background: #ff4d5e; }
.btn-ghost { background: #242735; border-color: #313546; color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: #2b2f40; }
.btn-gold { background: linear-gradient(180deg, #ffb53a, var(--orange)); color: #fff; border-color: #ffa526; }
.btn-gold:hover:not(:disabled) { filter: brightness(1.07); }
.btn-win { background: var(--win); color: #062b17; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 46px; font-size: 14px; }
.btn .icon-svg { width: 16px; height: 16px; }
.btn-filter.active, .btn-filter[aria-pressed="true"] { border-color: var(--accent); color: #fff; }
.filter-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--subtle); }
.btn-filter[aria-pressed="true"] .filter-dot { background: var(--win); box-shadow: 0 0 8px var(--win); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  color: var(--muted);
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.boxed { background: #1f222e; border: 1px solid var(--line-strong); }
.link-btn { color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.link-btn:hover { color: var(--text); }
.chip { height: 32px; padding: 0 12px; border-radius: var(--r-sm); background: #242735; border: 1px solid #313546; font-size: 12px; font-weight: 700; }
.chip:hover { background: #2b2f40; }

input, select, textarea {
  background: var(--input);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  height: 40px;
  padding: 0 12px;
  outline: none;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder { color: var(--subtle); }
.custom-select { appearance: none; padding-right: 34px; font-weight: 700; font-size: 13px; background: #1f222e; cursor: pointer; }
.custom-select.small { height: 34px; font-size: 12px; }
.select-wrap { position: relative; display: inline-flex; }
.select-wrap::after {
  content: '';
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon > svg { position: absolute; left: 12px; color: var(--subtle); pointer-events: none; }
.input-with-icon > svg + input { padding-left: 36px; }
.input-with-icon input { width: 100%; }
.input-with-icon.suffix input { padding-right: 32px; }
.suffix-text { position: absolute; right: 12px; color: var(--muted); font-weight: 700; }
.input-with-icon.small input { height: 34px; font-size: 12px; width: 120px; }

.form-group { display: grid; gap: 6px; }
.form-group label, .form-group .label { font-size: 12px; font-weight: 700; color: var(--muted); }
.form-error { color: var(--loss); font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }
.stack-form { display: grid; gap: 14px; margin-top: 14px; }

.seg-mini { display: inline-flex; background: var(--input); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 3px; gap: 3px; }
.seg-mini button { height: 28px; min-width: 34px; padding: 0 10px; border-radius: 4px; font-size: 12px; font-weight: 800; color: var(--muted); }
.seg-mini button.active { background: var(--accent); color: #fff; }
.seg-mini button:disabled { opacity: .55; }
.seg-mini em { font-style: normal; font-size: 9px; background: rgba(245, 196, 81, .15); color: var(--gold); padding: 1px 4px; border-radius: 3px; margin-left: 4px; }

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-icon { width: 34px; height: 34px; }
.brand-wordmark { height: 22px; width: auto; }
.menu-toggle { display: none; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.balance-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 4px 0 12px;
  border-radius: var(--r-sm);
  background: var(--input);
  border: 1px solid var(--line-strong);
  font-weight: 800;
  font-size: 14px;
}
.balance-add { width: 32px; height: 32px; border-radius: 5px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.balance-add:hover { background: #ff4d5e; }

.bot-status-pill { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--muted); background: #1c1f2a; border: 1px solid var(--line); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--loss); }
.status-dot.dot-green { background: var(--win); box-shadow: 0 0 8px var(--win); }

.user-menu-wrap { position: relative; }
.user-profile-card { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px 0 4px; border-radius: var(--r-sm); }
.user-profile-card:hover { background: var(--hover); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--card-2); object-fit: cover; }
.user-meta { display: grid; text-align: left; line-height: 1.15; }
.user-name { font-weight: 800; font-size: 13px; }
.user-level { color: var(--muted); font-size: 11px; font-weight: 600; }
.chevron { width: 16px; height: 16px; color: var(--muted); }
.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  padding: 6px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .6);
  display: grid;
  z-index: 60;
}
.user-menu > * { text-align: left; padding: 9px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; text-decoration: none; }
.user-menu > *:hover { background: var(--hover); }
.user-menu .danger { color: var(--loss); }

.app-layout {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--chat-w);
  transition: grid-template-columns .2s ease;
}
body.nav-expanded .app-layout { grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--chat-w); }
body.chat-collapsed .app-layout { grid-template-columns: var(--rail-w) minmax(0, 1fr) 0; }
body.nav-expanded.chat-collapsed .app-layout { grid-template-columns: var(--nav-w) minmax(0, 1fr) 0; }

.sidebar-left {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 12px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-group { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.nav-header { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); padding: 2px 8px 4px; white-space: nowrap; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  text-align: left;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--active); color: #fff; }
.nav-item.active::before { content: ''; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-svg { width: 20px; height: 20px; flex: none; }
.nav-menu { color: var(--text); margin-bottom: 4px; }
.age-note { margin-top: auto; padding: 10px 6px 0; font-size: 11px; color: var(--subtle); white-space: normal; }

body:not(.nav-expanded) .sidebar-left .nav-item span,
body:not(.nav-expanded) .sidebar-left .nav-header,
body:not(.nav-expanded) .sidebar-left .age-note { display: none; }
body:not(.nav-expanded) .sidebar-left .nav-item { justify-content: center; padding: 0; }
body:not(.nav-expanded) .sidebar-left .nav-group { padding-top: 8px; }

.content-area { overflow-y: auto; overflow-x: hidden; padding: 0 24px 40px; min-width: 0; }
.view-panel { display: none; padding-top: 16px; }
.view-panel.active { display: block; }
.view-head { margin-bottom: 18px; }
.view-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.view-title { font-size: 22px; font-weight: 900; letter-spacing: -.01em; }
.view-sub { color: var(--muted); margin-top: 4px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.scrim { display: none; }

.giveaway-banner {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 -24px;
  padding: 10px 24px;
  background: linear-gradient(90deg, #3b2410, #2a1a14 40%, #191b25);
  border-bottom: 1px solid rgba(255, 155, 26, .25);
}
.banner-pet { width: 44px; height: 44px; border-radius: 8px; background: #fff; overflow: hidden; flex: none; display: grid; place-items: center; }
.banner-pet img { width: 100%; height: 100%; object-fit: cover; }
.banner-text { display: grid; line-height: 1.2; min-width: 0; }
.banner-kicker { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
.banner-kicker::before { content: '🎁 '; }
.banner-title { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner-joined { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #f7dcdf; white-space: nowrap; }
.banner-ends { display: grid; text-align: right; line-height: 1.1; white-space: nowrap; }
.banner-ends small { font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #c9cdda; }
.banner-ends b { font-size: 16px; font-weight: 900; }
.giveaway-banner .btn-gold { border-radius: 999px; height: 36px; }
.banner-close { width: 30px; height: 30px; }
.giveaway-banner .joined { opacity: .7; }

.lobby-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar-gap { flex: 1; }
.lobby-stats {
  display: flex;
  align-items: center;
  gap: 0;
  height: 40px;
  padding: 0 14px;
  margin-bottom: 4px;
  border-radius: var(--r);
  background: var(--panel);
  font-size: 12px;
  color: var(--muted);
}
.lobby-stats span { display: inline-flex; align-items: center; gap: 7px; padding-right: 14px; margin-right: 14px; border-right: 1px solid var(--line-strong); }
.lobby-stats span:last-child { border: 0; }
.lobby-stats b { color: var(--text); font-size: 14px; font-weight: 800; }
.lobby-stats .icon-svg { width: 15px; height: 15px; }

.rooms-list { display: grid; gap: 6px; }
.room-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.3fr) minmax(150px, 1.6fr) minmax(90px, .8fr) minmax(130px, 1fr) 110px;
  align-items: center;
  gap: 14px;
  min-height: 90px;
  padding: 10px 22px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  transition: background-color .15s, border-color .15s;
}
.room-row:hover { background: #1f212d; }
.room-row.is-playing { background: linear-gradient(90deg, rgba(242, 56, 74, .1), var(--card) 60%); border-color: rgba(242, 56, 74, .3); }
.room-row.is-mine { border-color: rgba(255, 90, 104, .45); }
.room-row.is-new { animation: rowIn .4s ease-out; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); } }

.room-players { display: flex; align-items: center; gap: 12px; }
.vs-text { color: var(--subtle); font-weight: 800; font-size: 12px; }
.seat { position: relative; width: 54px; height: 54px; flex: none; }
.seat img { width: 54px; height: 54px; border-radius: 50%; background: #262a38; object-fit: cover; border: 2px solid transparent; }
.seat.ringed img { border-color: var(--ring, var(--accent)); }
.seat.dim img { opacity: .4; filter: grayscale(.6); }
.seat-dots { position: absolute; top: -2px; right: -4px; display: flex; gap: 3px; }
.seat-dots .dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px var(--card); }
.seat.empty .seat-blank { width: 54px; height: 54px; border-radius: 50%; background: #212532; border: 2px dashed #363a4d; display: grid; place-items: center; color: var(--accent-hi); font-weight: 900; letter-spacing: 2px; }
.seat .seat-chip { position: absolute; top: -4px; right: -6px; }

.room-items { display: flex; align-items: center; gap: 4px; min-width: 0; }
.room-gem { width: 40px; height: 40px; margin-right: 8px; filter: drop-shadow(0 0 10px rgba(63, 208, 255, .45)); flex: none; }
.item-thumb { width: 50px; height: 50px; border-radius: 6px; background: #262a38; border: 1px solid rgba(255, 90, 104, .35); display: grid; place-items: center; overflow: hidden; flex: none; }
.item-thumb .pet-img { width: 46px; height: 46px; }
.item-thumb.more { color: var(--text); font-weight: 800; font-size: 12px; background: #262a38; }

.room-value { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 19px; font-weight: 900; }
.room-score { display: grid; justify-items: center; gap: 4px; }
.score-line { font-size: 14px; font-weight: 900; letter-spacing: .02em; }
.score-line .lead { color: var(--accent-hi); }
.dice-mini { display: flex; gap: 3px; }
.die-sq { width: 24px; height: 24px; border-radius: 5px; display: grid; place-items: center; }
.die-sq::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.die-sq.faded { opacity: .35; }
.round-tag { font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.round-tag b { color: var(--accent-hi); }
.wait-ring { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; border: 3px solid #2a2e3e; border-top-color: var(--accent); }
.room-action { display: flex; justify-content: flex-end; }
.room-action .btn { width: 104px; }
.btn-view { background: #272a37; border: 1px solid #353a4b; color: #fff; font-weight: 900; border-radius: 9px; }
.btn-view:hover { background: #303446; }
.btn-join { background: var(--accent); color: #fff; font-weight: 900; border-radius: 9px; }
.btn-join:hover { background: #ff4d5e; }

.empty-state { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 48px 20px; border-radius: var(--r); background: var(--card); border: 1px dashed var(--line-strong); color: var(--muted); }
.empty-state strong { color: var(--text); font-size: 15px; }
.room-row.skeleton { min-height: 90px; }
.room-row.skeleton span { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #1f222e, #2a2e3e, #1f222e); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.c-red { background: var(--c-red); }
.c-orange { background: var(--c-orange); }
.c-yellow { background: var(--c-yellow); }
.c-green { background: var(--c-green); }
.c-blue { background: var(--c-blue); }
.c-purple { background: var(--c-purple); }

.chip-coin {
  --chip: #1b1b22;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-weight: 900;
  font-size: 17px;
  color: #fff;
  background:
    radial-gradient(circle, var(--chip) 0 52%, transparent 53%),
    repeating-conic-gradient(var(--chip) 0 22.5deg, #fff 22.5deg 45deg);
  box-shadow: 0 0 0 3px var(--chip), 0 6px 14px -6px rgba(0, 0, 0, .7);
}
.chip-coin.tails { --chip: #d42a2a; }
.chip-coin.heads { --chip: #18181f; }
.chip-coin.small { width: 22px; height: 22px; font-size: 10px; box-shadow: 0 0 0 2px var(--chip); }
.chip-coin.big { width: 128px; height: 128px; font-size: 52px; box-shadow: 0 0 0 6px var(--chip), 0 18px 40px -12px rgba(0, 0, 0, .8); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 7, 9, .72);
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; animation: fadeIn .15s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
  overflow: hidden;
  animation: popIn .2s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes popIn { from { transform: translateY(10px) scale(.98); } }
.modal-header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-header h3 { font-size: 16px; font-weight: 800; margin-right: auto; }
.modal-body { padding: 18px; overflow-y: auto; display: grid; gap: 14px; }
.modal-desc { color: var(--muted); }
.modal-tabs { display: flex; gap: 4px; padding: 10px 18px 0; }
.modal-tab { flex: 1; height: 36px; border-radius: var(--r-sm); font-weight: 700; color: var(--muted); background: var(--card); }
.modal-tab.active { background: var(--accent); color: #fff; }

.inv-modal { width: min(940px, 100%); height: min(640px, calc(100vh - 32px)); }
.inv-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.inv-search { flex: 1; max-width: 340px; }
.inv-search input { height: 36px; font-size: 13px; }
.inv-toolbar .modal-close { margin-left: auto; }
.inv-summary, .wager-bar { display: flex; align-items: center; gap: 22px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.inv-stat { display: grid; line-height: 1.2; }
.inv-stat span { font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.inv-stat strong { display: flex; align-items: center; gap: 5px; font-size: 15px; font-weight: 900; }
.inv-stat em { font-style: normal; color: var(--muted); font-size: 12px; font-weight: 600; margin-left: 4px; }
.inv-stat.right { margin-left: auto; text-align: right; }
.inv-stat.right strong { justify-content: flex-end; }
.wager-gems { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.wager-gems .hint { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.wager-gems .hint b { color: var(--text); }
.inv-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  grid-auto-rows: max-content;
  gap: 8px;
  align-content: start;
}
.inv-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 7px;
  border-radius: 8px;
  background: var(--card-2);
  border: 1px solid var(--line);
  text-align: left;
  transition: border-color .12s, background-color .12s, transform .12s;
}
.inv-card:hover:not(:disabled) { border-color: #3d4356; transform: translateY(-1px); }
.inv-card.selected { border-color: var(--accent); background: #282d3e; box-shadow: 0 0 0 1px var(--accent) inset; }
.inv-card.disabled { opacity: .4; }
.inv-card .pet-img, .inv-img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 6px; background: #10121a; }
.inv-card .pet-img img { padding: 6px; filter: none; border-radius: 6px; }
.inv-name { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.inv-tier { font-size: 9px; font-weight: 800; padding: 2px 5px; border-radius: 4px; background: rgba(242, 56, 74, .2); color: var(--accent-hi); }
.tier-titanic .inv-tier { background: rgba(245, 196, 81, .15); color: var(--gold); }
.tier-gargantuan .inv-tier { background: rgba(255, 90, 118, .15); color: var(--loss); }
.inv-value { display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; }
.inv-check { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); display: none; z-index: 2; }
.inv-check::after { content: ''; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.inv-card.selected .inv-check { display: block; }
.inv-empty {
  grid-column: 1 / -1;
  align-self: stretch;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  min-height: 260px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.inv-empty strong { color: var(--text); font-size: 15px; }
.inv-grid:has(> .inv-empty) { grid-auto-rows: 1fr; }
.inv-empty-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(242, 56, 74, .18); color: var(--accent-hi); margin-bottom: 4px; }
.inv-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.inv-result { display: grid; justify-items: center; gap: 4px; padding: 12px 16px; border-top: 1px solid var(--line); text-align: center; }
.inv-result span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.neon-code { font-size: 30px; font-weight: 900; letter-spacing: .2em; color: var(--accent-hi); text-shadow: 0 0 18px rgba(255, 90, 104, .5); }

.duel-options { display: flex; align-items: flex-end; gap: 22px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.opt-group { display: grid; gap: 6px; }
.opt-group.locked { opacity: .55; pointer-events: none; }
.opt-label { font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.color-picks, .side-picks { display: flex; gap: 6px; }
.color-pick { width: 30px; height: 30px; border-radius: 7px; position: relative; transition: transform .1s; }
.color-pick::after { content: ''; position: absolute; inset: 0; margin: auto; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.color-pick:hover:not(:disabled) { transform: translateY(-2px); }
.color-pick.active { box-shadow: inset 0 0 0 2.5px #fff, inset 0 0 0 4px rgba(0, 0, 0, .25); transform: translateY(-2px); }
.color-pick.active::after { width: 9px; height: 9px; }
.color-pick.taken { opacity: .2; }
.side-pick { border-radius: 50%; opacity: .45; transition: opacity .15s, transform .15s; }
.side-pick .chip-coin { width: 34px; height: 34px; font-size: 14px; }
.side-pick.active { opacity: 1; transform: scale(1.08); }
.side-pick:disabled { cursor: default; }
.duel-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.duel-rules { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--card); font-size: 13px; color: var(--muted); }
.duel-rules strong { color: var(--text); }
.duel-rules ul { padding-left: 18px; margin-top: 6px; display: grid; gap: 3px; }
.duel-modal[data-game="dice"] [data-game="flip"],
.duel-modal[data-game="flip"] [data-game="dice"] { display: none; }

.game-view-card { width: min(940px, 100%); }
.game-view-head { position: relative; display: flex; justify-content: center; align-items: center; padding: 18px; border-bottom: 1px solid var(--line); }
.game-view-head .brand-wordmark { height: 30px; }
.game-view-head .modal-close { position: absolute; right: 14px; }
.game-view-body { padding: 16px 18px 20px; overflow-y: auto; display: grid; gap: 14px; }

.arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 22px 12px;
  border-radius: var(--r-lg);
  background: radial-gradient(ellipse at center, rgba(242, 56, 74, .12), transparent 70%), var(--card);
  border: 1px solid var(--line);
}
.arena-players { display: contents; }
.arena-center { grid-column: 2; grid-row: 1; display: grid; justify-items: center; gap: 8px; }
.arena.three { grid-template-columns: repeat(3, 1fr); }
.arena.three .arena-center { grid-column: 1 / -1; grid-row: 2; }
.arena-player { display: grid; justify-items: center; gap: 8px; text-align: center; transition: opacity .3s; }
.arena-player:first-child { grid-column: 1; grid-row: 1; }
.arena:not(.three) .arena-player:nth-child(2) { grid-column: 3; grid-row: 1; }
.arena-avatar { width: 120px; height: 120px; border-radius: 50%; background: #262a38; object-fit: cover; border: 3px solid var(--ring, transparent); }
.arena.three .arena-avatar { width: 88px; height: 88px; }
.arena-avatar.blank { display: grid; place-items: center; border: 3px dashed #363a4d; color: var(--subtle); font-size: 28px; font-weight: 900; }
.arena-name { font-size: 17px; font-weight: 900; }
.arena-colors { display: flex; gap: 6px; }
.color-tag { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; text-transform: capitalize; }
.arena-player.winner .arena-avatar { box-shadow: 0 0 0 4px var(--gold), 0 0 30px rgba(245, 196, 81, .4); }
.arena-player.winner .arena-name { color: var(--gold); }
.arena-player.loser { opacity: .45; }
.dice-row { display: flex; gap: 10px; }
.die {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #272a37;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .18);
  transition: background-color .15s, transform .2s;
}
.die::after { content: ''; width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, .9); }
.die.c-red { background: var(--c-red); }
.die.c-orange { background: var(--c-orange); }
.die.c-yellow { background: var(--c-yellow); }
.die.c-green { background: var(--c-green); }
.die.c-blue { background: var(--c-blue); }
.die.c-purple { background: var(--c-purple); }
.die.idle { opacity: .35; }
.die.rolling { animation: dieShake .12s linear infinite; }
.die.hit { transform: translateY(-4px); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .18), 0 10px 24px -8px currentColor; }
@keyframes dieShake { 50% { transform: rotate(4deg) scale(.96); } }
.arena.three .die { width: 64px; height: 64px; }
.arena-round { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.arena-score { display: flex; align-items: center; gap: 10px; font-size: 30px; font-weight: 900; color: var(--accent-hi); }
.arena-score .sep { color: var(--muted); font-size: 22px; }
.score-pips { display: flex; gap: 4px; }
.score-pips i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #454b62; }
.score-pips i.on { background: var(--accent-hi); border-color: var(--accent-hi); }
.arena-status { min-height: 18px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.arena-status.waiting { color: var(--muted); animation: blink 1.6s ease-in-out infinite; }
.arena-status.done { color: var(--gold); }
@keyframes blink { 50% { opacity: .5; } }

.round-history { border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); padding: 14px 16px; }
.round-history-head { text-align: center; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.round-history-list { display: grid; gap: 6px; max-height: 190px; overflow-y: auto; }
.rh-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: #212532; font-size: 11px; font-weight: 800; }
.rh-row .rh-label { color: var(--muted); width: 26px; }
.rh-row .die-sq { width: 20px; height: 20px; }
.rh-row .rh-result { margin-left: auto; color: var(--muted); text-transform: uppercase; }
.rh-row .rh-result b { color: var(--accent-hi); }
.rh-row.won .rh-result { color: var(--win); }
.rh-empty { text-align: center; color: var(--muted); padding: 10px; border-radius: 8px; background: #212532; font-size: 12px; font-weight: 600; }

.seed-line { justify-self: center; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 11px; color: var(--muted); max-width: 100%; }
.seed-line:empty { display: none; }
.seed-line b { color: var(--text); font-weight: 700; white-space: nowrap; }
.seed-line code { font-family: ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.seed-line .seed-state { color: var(--accent-hi); font-weight: 700; }
.seed-line button { color: var(--muted); display: grid; }
.seed-line button:hover { color: var(--text); }
.seed-line .icon-svg { width: 14px; height: 14px; }

.arena-actions { display: flex; justify-content: center; gap: 10px; }
.arena-actions:empty { display: none; }
.wager-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.wager-col { border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.wager-col-head span { font-size: 12px; color: var(--muted); font-weight: 600; }
.wager-col-head strong { display: flex; align-items: center; gap: 6px; font-size: 19px; font-weight: 900; }
.wager-col-head strong small { font-size: 11px; color: var(--muted); font-weight: 700; }
.wager-line { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-weight: 700; font-size: 13px; }
.wager-line .pet-img, .wager-line .gem-big { width: 30px; height: 30px; }
.wager-line .wl-value { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--gem); font-size: 12px; font-weight: 800; }

.flip-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 26px 12px;
  border-radius: var(--r-lg);
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, .06), transparent 60%), var(--card);
  border: 1px solid var(--line);
}
.flip-player { display: grid; justify-items: center; gap: 10px; text-align: center; transition: opacity .3s; }
.flip-player .fp-avatar { position: relative; }
.flip-player .fp-avatar img, .flip-player .fp-avatar .blank { width: 120px; height: 120px; border-radius: 50%; background: #262a38; object-fit: cover; border: 3px solid rgba(255, 255, 255, .2); }
.flip-player .fp-avatar .blank { display: grid; place-items: center; border-style: dashed; color: var(--subtle); font-size: 26px; font-weight: 900; }
.flip-player .fp-avatar .chip-coin { position: absolute; top: 2px; right: -2px; }
.flip-player strong { font-size: 15px; font-weight: 900; }
.flip-player.winner .fp-avatar img { border-color: var(--gold); box-shadow: 0 0 30px rgba(245, 196, 81, .4); }
.flip-player.loser { opacity: .45; }
.flip-center { display: grid; justify-items: center; gap: 14px; }
.flip-coin { position: relative; width: 128px; height: 128px; transform-style: preserve-3d; transition: transform 1.6s cubic-bezier(.2, .7, .2, 1); }
.flip-coin .chip-coin { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-coin .face-back { transform: rotateY(180deg); }
.flip-status { padding: 6px 14px; border-radius: 999px; background: #0d0e14; border: 1px solid var(--line-strong); font-weight: 900; font-size: 14px; min-width: 60px; text-align: center; }
.flip-status.count { font-size: 22px; background: none; border: 0; }
.flip-status.done { color: var(--gold); }

.upg-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin-bottom: 10px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.upg-intro strong { display: block; font-size: 14px; font-weight: 800; }
.upg-intro span { font-size: 11px; color: var(--muted); }
.upg-ready { padding: 6px 12px; border-radius: var(--r-sm); background: rgba(52, 215, 123, .1); border: 1px solid rgba(52, 215, 123, .3); color: var(--win); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.upg-ready.busy { background: rgba(245, 196, 81, .1); border-color: rgba(245, 196, 81, .3); color: var(--gold); }
.upg-stage { display: grid; grid-template-columns: 1fr 1.05fr 1fr; gap: 10px; }
.upg-panel { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); min-height: 400px; min-width: 0; }
.upg-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.upg-panel-head h3 { font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-hi); }
.upg-panel-head small { color: var(--muted); font-size: 11px; letter-spacing: 0; }
.upg-slot { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); grid-auto-rows: max-content; gap: 6px; align-content: start; overflow-y: auto; max-height: 250px; }
.upg-slot .inv-card { padding: 5px; }
.upg-slot .inv-name { font-size: 10px; }
.slot-empty { grid-column: 1 / -1; display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 220px; color: var(--muted); font-size: 11px; text-align: center; }
.slot-empty strong { color: var(--subtle); font-size: 13px; }
.slot-empty .icon-svg { width: 34px; height: 34px; color: var(--subtle); margin-bottom: 6px; }
.upg-total { display: flex; align-items: center; justify-content: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.upg-total b { color: var(--text); font-size: 17px; letter-spacing: 0; }
.upg-center { align-items: center; justify-content: space-between; }
.upg-wheel { position: relative; width: min(270px, 100%); aspect-ratio: 1; margin: auto 0; }
.upg-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: #10121a; stroke: #212532; stroke-width: 10; }
.ring-chance { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .35s ease; filter: drop-shadow(0 0 8px rgba(242, 56, 74, .6)); }
.upg-wheel.win .ring-chance { stroke: var(--win); }
.upg-wheel.lose .ring-chance { stroke: var(--loss); }
.upg-dots { position: absolute; inset: -6%; border-radius: 50%; background: repeating-conic-gradient(rgba(242, 56, 74, .45) 0 1.2deg, transparent 1.2deg 7.5deg); -webkit-mask: radial-gradient(circle, transparent 66%, #000 67%, #000 69%, transparent 70%); mask: radial-gradient(circle, transparent 66%, #000 67%, #000 69%, transparent 70%); }
.upg-pointer { position: absolute; inset: 0; transform: rotate(0deg); }
.upg-pointer i { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); border: 9px solid transparent; border-top: 14px solid #fff; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5)); }
.upg-readout { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.upg-readout b { font-size: 40px; font-weight: 900; line-height: 1; }
.upg-readout small { margin-top: 8px; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.upg-quick > span { display: block; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.upg-quick-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.upg-quick-row button { height: 32px; border-radius: 999px; background: #202431; border: 1px solid #313546; font-size: 11px; font-weight: 800; }
.upg-quick-row button:hover { border-color: var(--accent); }
.upg-pool { margin-top: 12px; padding: 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
.upg-pool-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.upg-pool-head > div:first-child { margin-right: auto; display: grid; }
.upg-pool-head strong { font-size: 15px; font-weight: 900; }
.upg-pool-head strong span { font-size: 12px; margin-left: 4px; }
.upg-pool-head > div > span { font-size: 11px; color: var(--muted); }
.pool-search { width: 260px; }
.pool-search input { height: 36px; font-size: 12px; }
.pool-grid { padding: 0; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); overflow: visible; }

.sidebar-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border-left: 1px solid var(--line);
  position: relative;
}
body.chat-collapsed .sidebar-right { border: 0; }
.chat-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-title { font-size: 15px; font-weight: 900; }
.chat-online-count { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--win); margin-right: auto; }
.status-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--win); box-shadow: 0 0 6px var(--win); }
.chat-close { width: 32px; height: 32px; }
.chat-announcement-card { display: flex; gap: 10px; margin: 10px 10px 4px; padding: 10px 12px; border-radius: var(--r); background: #1d202b; border: 1px solid var(--line-strong); }
.announce-icon { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; background: rgba(242, 56, 74, .18); color: var(--accent-hi); }
.chat-announcement-card small { display: block; font-size: 10px; font-weight: 800; color: var(--accent-hi); }
.chat-announcement-card p { font-size: 12px; font-weight: 700; line-height: 1.35; }
.chat-messages-container { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 6px; }
.chat-msg { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: #14161f; }
.chat-avatar-wrap { position: relative; flex: none; width: 36px; }
.chat-msg-avatar { width: 36px; height: 36px; border-radius: 50%; background: #262a38; object-fit: cover; }
.chat-msg-level { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); min-width: 22px; padding: 1px 4px; border-radius: 4px; background: var(--c-blue); color: #fff; font-size: 9px; font-weight: 900; text-align: center; box-shadow: 0 0 0 2px #14161f; }
.chat-msg-level.lv-mid { background: #d97706; }
.chat-msg-level.lv-high { background: #dc2626; }
.chat-msg-body { min-width: 0; flex: 1; }
.chat-msg-header { display: flex; align-items: center; gap: 6px; }
.chat-msg-name { font-weight: 800; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-msg-time { margin-left: auto; color: var(--subtle); font-size: 10px; font-weight: 600; flex: none; }
.chat-msg-text { font-size: 13px; color: #dfe1ea; word-break: break-word; margin-top: 2px; }
.chat-msg.system { background: rgba(242, 56, 74, .1); border: 1px solid rgba(242, 56, 74, .2); }
.chat-msg.system .chat-msg-name { color: var(--accent-hi); }
.role-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 4px; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; flex: none; }
.role-badge svg { width: 10px; height: 10px; }
.role-owner .chat-msg-name { color: #ff5a76; } .role-badge.role-owner { background: rgba(255, 90, 118, .16); color: #ff7d93; }
.role-admin .chat-msg-name { color: #ff8a3d; } .role-badge.role-admin { background: rgba(255, 138, 61, .16); color: #ffa265; }
.role-mod .chat-msg-name { color: #34d77b; } .role-badge.role-mod { background: rgba(52, 215, 123, .14); color: #5fe399; }
.role-vip .chat-msg-name { color: var(--gold); } .role-badge.role-vip { background: rgba(245, 196, 81, .14); color: var(--gold); }
.role-creator .chat-msg-name { color: #c084fc; } .role-badge.role-creator { background: rgba(192, 132, 252, .16); color: #d3a6ff; }
.chat-empty { color: var(--muted); text-align: center; margin: auto; font-size: 13px; }
.chat-jump { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); padding: 5px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .7); z-index: 3; }
.chat-footer { padding: 6px 10px 12px; border-top: 1px solid var(--line); }
.chat-rules-row { position: relative; display: flex; justify-content: flex-end; padding: 2px 2px 6px; }
.chat-rules-btn .icon-svg { width: 14px; height: 14px; }
.chat-rules { position: absolute; right: 0; bottom: calc(100% + 4px); width: 260px; padding: 12px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line-strong); box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .7); z-index: 5; }
.chat-rules-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.chat-rules-head .icon-btn { width: 26px; height: 26px; }
.chat-rules ul { padding-left: 14px; display: grid; gap: 4px; font-size: 11px; color: var(--muted); }
.chat-input-bar { display: flex; gap: 8px; }
.chat-input-bar input { flex: 1; height: 42px; background: var(--input); }
.btn-chat-send { position: relative; width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.btn-chat-send:hover { background: #ff4d5e; }
.btn-chat-send.cooling { background: #363a4d; }
.btn-chat-send.cooling svg { opacity: 0; }
.btn-chat-send.cooling::after { content: attr(data-left); position: absolute; font-weight: 900; }

.chat-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: none;
  place-items: center;
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, .8);
}
.chat-fab:hover { background: var(--hover); }
body.chat-collapsed .chat-fab { display: grid; }
.chat-unread { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 900; display: grid; place-items: center; }

.toast-stack { position: fixed; top: calc(var(--header-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 400; display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: var(--r); background: var(--card-2); border: 1px solid var(--line-strong); font-weight: 700; font-size: 13px; box-shadow: 0 14px 32px -10px rgba(0, 0, 0, .7); animation: toastIn .2s ease-out; }
.toast.success { border-color: rgba(52, 215, 123, .5); }
.toast.error { border-color: rgba(255, 90, 118, .6); }
.toast.leaving { opacity: 0; transform: translateY(-6px); transition: .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } }

.game-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; }
.game-controls { display: grid; gap: 14px; align-content: start; }
.multiplier-info-box { display: grid; gap: 8px; padding: 12px; border-radius: var(--r); background: var(--input); border: 1px solid var(--line); }
.info-line { display: flex; justify-content: space-between; font-size: 13px; }
.info-line dt { color: var(--muted); }
.info-line dd { font-weight: 800; }
.fee-notice-pill { font-size: 12px; color: var(--muted); }
.mines-board-wrapper { display: grid; place-items: center; }
.mines-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: min(480px, 100%); }
.mine-tile { aspect-ratio: 1; border-radius: 14px; }
.crash-screen { position: relative; min-height: 340px; overflow: hidden; padding: 0; }
.crash-graph { position: absolute; inset: 0; width: 100%; height: 100%; }
.crash-rocket { position: absolute; width: 44px; height: 44px; left: 4%; top: 88%; transform: translate(-50%, -50%) rotate(45deg); transition: left .1s linear, top .1s linear; }
.crash-screen:not(.flying) .crash-rocket .flame { opacity: 0; }
.crash-multiplier-big { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%); font-size: 56px; font-weight: 900; }
.crash-screen.crashed .crash-multiplier-big { color: var(--loss); }
.crash-screen.won .crash-multiplier-big { color: var(--win); }
.crash-status-text { position: absolute; top: 50%; left: 50%; transform: translateX(-50%); color: var(--muted); font-weight: 700; }
.crash-countdown { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #212532; }
.crash-countdown span { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.crash-screen:not(.betting) .crash-countdown { opacity: 0; }
.crash-history { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.crash-chip { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--card-2); }
.crash-chip.low { color: var(--loss); }
.crash-chip.good { color: var(--win); }
.crash-chip.big { color: var(--gold); }
.crash-players { margin-top: 14px; }
.crash-players-head { display: flex; justify-content: space-between; margin-bottom: 10px; }
.crash-players-head h3 { font-size: 15px; }
.crash-players-head span { color: var(--muted); font-size: 12px; }
.crash-bets { display: grid; gap: 6px; }
.crash-bet { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--card-2); font-size: 13px; }
.crash-bet img { width: 26px; height: 26px; border-radius: 50%; }
.crash-bet.mine { border: 1px solid var(--accent); }
.bet-name { font-weight: 700; }
.bet-wager { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.bet-result { margin-left: auto; font-weight: 800; color: var(--muted); }
.bet-result.won { color: var(--win); }
.bet-result.lost { color: var(--loss); }
.crash-empty { color: var(--muted); font-size: 13px; }
.crash-fair { margin-top: 10px; font-size: 11px; color: var(--subtle); }
.crash-fair code { color: var(--muted); }

.custom-table { width: 100%; border-collapse: collapse; }
.custom-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.custom-table td { padding: 10px; border-bottom: 1px solid var(--line); }
.custom-table .num { text-align: right; }
.leaderboard-player { font-weight: 700; }
.leaderboard-avatar { width: 30px; height: 30px; border-radius: 50%; }
.rank-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--card-2); font-weight: 900; font-size: 12px; }
.rank-gold { background: rgba(245, 196, 81, .2); color: var(--gold); }
.rank-silver { background: rgba(201, 212, 226, .15); color: #c9d4e2; }
.rank-bronze { background: rgba(217, 151, 106, .18); color: #d9976a; }

.values-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.values-search { flex: 1; min-width: 220px; }
.filter-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-controls .btn-filter { height: 36px; padding: 0 12px; border-radius: var(--r-sm); background: #1f222e; border: 1px solid #313546; font-weight: 700; font-size: 12px; color: var(--muted); }
.values-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.value-card { display: flex; gap: 10px; padding: 10px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.value-img { width: 56px; height: 56px; }
.value-info { min-width: 0; display: grid; gap: 3px; }
.value-name { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.value-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.value-tag { font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 4px; background: rgba(242, 56, 74, .2); color: var(--accent-hi); }
.value-tag.v-golden { background: rgba(245, 196, 81, .15); color: var(--gold); }
.value-tag.v-rainbow { background: rgba(63, 208, 255, .15); color: var(--gem); }
.value-tag.v-shiny { background: rgba(255, 255, 255, .12); color: #fff; }
.value-amount { display: flex; align-items: center; gap: 4px; font-weight: 900; }
.value-exists { font-size: 11px; color: var(--subtle); }
.values-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); font-size: 12px; }

.capacity-pill { display: inline-flex; gap: 10px; align-items: center; padding: 8px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.tag-gold { padding: 2px 8px; border-radius: 6px; background: rgba(245, 196, 81, .18); color: var(--gold); font-size: 11px; font-weight: 800; }
.giveaways-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.giveaway-card { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
.giveaway-card-art { display: grid; place-items: center; height: 120px; border-radius: var(--r); background: #10121a; }
.giveaway-card-art .pet-img { width: 96px; height: 96px; }
.giveaway-card-body { display: grid; gap: 4px; }
.giveaway-prize-tag { display: flex; align-items: center; gap: 4px; font-weight: 900; color: var(--gem); }
.giveaway-count { font-size: 12px; color: var(--muted); }
.btn-giveaway-join.joined { opacity: .6; }

.affiliate-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 16px; }
.aff-card { display: grid; gap: 6px; align-content: start; }
.aff-card > span { font-size: 12px; color: var(--muted); font-weight: 700; }
.aff-card strong { font-size: 22px; font-weight: 900; }
.aff-actions { display: flex; gap: 8px; margin-top: 6px; }
.creator-panel { max-width: 700px; }
.creator-panel h3 { font-size: 16px; margin-bottom: 4px; }

.fair-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.fair-box { display: grid; gap: 10px; align-content: start; }
.fair-box h3 { font-size: 16px; }
.fair-box p { color: var(--muted); }
.formula { display: block; padding: 10px; border-radius: 8px; background: var(--input); color: var(--accent-hi); font-family: ui-monospace, monospace; font-size: 12px; }
.fee-specs-list { width: 100%; border-collapse: collapse; }
.fee-specs-list td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.fee-specs-list td:last-child { text-align: right; font-weight: 800; }

.wallet-bot-banner { display: flex; align-items: center; gap: 8px; margin: 12px 18px 0; padding: 9px 12px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; background: rgba(255, 90, 118, .08); border: 1px solid rgba(255, 90, 118, .25); }
.wallet-bot-banner.online { background: rgba(52, 215, 123, .08); border-color: rgba(52, 215, 123, .25); }
#depositSection, #withdrawSection { display: flex; flex-direction: column; gap: 14px; }
.deposit-instructions, .withdraw-instructions { display: flex; flex-direction: column; gap: 10px; }
.security-code-box { display: grid; justify-items: center; gap: 4px; padding: 14px; border-radius: var(--r); background: var(--input); border: 1px solid var(--line-strong); }
.code-title { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bot-name-line { font-weight: 700; color: var(--gold); text-align: center; }
.instruction-text { font-size: 13px; color: var(--muted); }
.step-guide { padding-left: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.inventory-items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; max-height: 240px; overflow-y: auto; }
.inventory-item-card { display: grid; justify-items: center; gap: 2px; padding: 8px 6px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--line); font-size: 11px; text-align: center; }
.inventory-item-card.selected { border-color: var(--accent); background: #282d3e; }
.inventory-item-card strong { font-size: 11px; }
.inventory-item-card span { color: var(--gem); font-weight: 800; }
.inventory-empty { color: var(--muted); font-size: 13px; }
.login-who { display: flex; align-items: center; gap: 12px; }
.login-who img { width: 52px; height: 52px; border-radius: 50%; background: var(--card-2); }
.login-who strong { display: block; }
.phrase-box { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--input); border: 1px solid var(--line-strong); }
.phrase-box code { flex: 1; font-family: ui-monospace, monospace; color: var(--accent-hi); word-break: break-word; }
.edit-profile-link { color: var(--accent-hi); font-size: 13px; font-weight: 700; }
.history-list-box { display: grid; gap: 6px; }
.history-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--card); }
.history-left, .history-right { display: grid; }
.history-right { text-align: right; }
.history-winner { font-weight: 800; }
.history-mode, .history-time { font-size: 11px; color: var(--muted); }
.history-payout { font-weight: 900; color: var(--gem); }
.danger-box { margin-bottom: 4px; background: rgba(239, 68, 68, .12); border: 1px solid #ef4444; border-radius: 8px; padding: 10px 14px; }
.danger-box strong { color: #ef4444; }

body.stream-mode .balance-value,
body.stream-mode .user-name,
body.stream-mode #invGems,
body.stream-mode #duelBalance { filter: blur(7px); }

@media (max-width: 1280px) {
  .app-layout, body.nav-expanded .app-layout { grid-template-columns: var(--rail-w) minmax(0, 1fr) 0; }
  body.nav-expanded .app-layout { grid-template-columns: var(--nav-w) minmax(0, 1fr) 0; }
  .sidebar-right {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    width: min(var(--chat-w), 100vw);
    z-index: 70;
    transform: translateX(100%);
    transition: transform .2s ease;
    box-shadow: -20px 0 40px -20px rgba(0, 0, 0, .7);
  }
  .sidebar-right.open { transform: none; }
  .chat-fab { display: grid; }
  .room-row { grid-template-columns: minmax(150px, 1.2fr) minmax(110px, 1.2fr) minmax(80px, .7fr) minmax(120px, 1fr) 96px; padding: 10px 14px; }
  .upg-stage { grid-template-columns: 1fr 1fr; }
  .upg-center { grid-column: 1 / -1; grid-row: 1; min-height: 0; }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .menu-toggle { display: inline-grid; }
  .app-layout, body.nav-expanded .app-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar-left {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: var(--nav-w);
    z-index: 70;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .sidebar-left.open { transform: none; }
  .sidebar-left .nav-item span, .sidebar-left .nav-header, .sidebar-left .age-note { display: initial !important; }
  .sidebar-left .nav-item { justify-content: flex-start !important; padding: 0 14px !important; }
  .nav-menu { display: none; }
  .scrim { position: fixed; inset: var(--header-h) 0 0 0; background: rgba(6, 7, 9, .6); z-index: 65; }
  .scrim.open { display: block; }
  .content-area { padding: 0 12px 80px; }
  .giveaway-banner { margin: 0 -12px; padding: 8px 12px; flex-wrap: wrap; }
  .banner-joined { display: none; }
  .bot-status-pill, .user-meta { display: none; }
  .brand-wordmark { height: 18px; }
  .room-row { grid-template-columns: 1fr 1fr; grid-template-areas: "players players" "items items" "value score" "action action"; justify-items: center; gap: 10px; padding: 14px; }
  .room-players { grid-area: players; }
  .room-items { grid-area: items; }
  .room-value { grid-area: value; }
  .room-score { grid-area: score; }
  .room-action { grid-area: action; }
  .lobby-toolbar .toolbar-gap { display: none; }
  .game-layout { grid-template-columns: 1fr; }
  .upg-stage { grid-template-columns: 1fr; }
  .arena, .flip-stage { grid-template-columns: 1fr 1fr; }
  .arena .arena-center, .flip-center { grid-column: 1 / -1; grid-row: 2; }
  .arena.three { grid-template-columns: repeat(3, 1fr); }
  .arena-avatar, .flip-player .fp-avatar img, .flip-player .fp-avatar .blank { width: 80px; height: 80px; }
  .die { width: 60px; height: 60px; }
  .inv-summary, .wager-bar { flex-wrap: wrap; gap: 12px; }
  .wager-gems { margin-left: 0; }
  .duel-actions { margin-left: 0; width: 100%; justify-content: flex-end; }
}

@media (max-width: 520px) {
  .header-right { gap: 6px; }
  .site-header { padding: 0 10px; gap: 8px; }
  .lobby-stats { font-size: 11px; overflow-x: auto; }
  .inv-toolbar { flex-wrap: wrap; }
}

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

/* bot name shown where the trade code used to be */
.neon-code.bot-name { letter-spacing: normal; font-size: 24px; overflow-wrap: anywhere; text-align: center; }

.slowmode-chip { margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: var(--gold, #ffcb3d); background: rgba(255, 203, 61, .14); white-space: nowrap; }
.slowmode-chip[hidden] { display: none; }

/* dice: ? until rolled, then each die lands in turn */
.die.unknown {
  background: var(--raised, #292e40);
  color: var(--muted, #9ea4b9);
  font-weight: 900;
  font-size: 26px;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .25), inset 0 0 0 2px rgba(255, 255, 255, .06);
}
.die.unknown::after { display: none; }
.die.rolling::after { opacity: 0; }
.die.landed { animation: dieLand .38s cubic-bezier(.2, .9, .3, 1.6); }
@keyframes dieLand { 0% { transform: scale(1.25) rotate(-10deg); } 100% { transform: none; } }

/* Titanics, Gargs & gems only */
.tier-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 6px;
  border-radius: 10px;
  background: var(--bg, #14161f);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted, #9ea4b9);
  white-space: nowrap;
}
.tier-toggle:disabled { opacity: .45; cursor: not-allowed; }
.tt-switch { position: relative; width: 30px; height: 18px; border-radius: 9px; background: var(--line-2, #434b69); transition: background-color .15s; }
.tt-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s; }
.tier-toggle.active { color: var(--text, #fef2f3); }
.tier-toggle.active .tt-switch { background: var(--violet, #f2384a); }
.tier-toggle.active .tt-switch::after { transform: translateX(12px); }

.tier-badge {
  align-self: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  color: #ff9ab8;
  background: rgba(255, 107, 154, .15);
}

/* upgrader: draggable winning arc */
.upg-wheel { touch-action: none; cursor: grab; user-select: none; }
.upg-wheel.dragging { cursor: grabbing; }
.upg-wheel.dragging .ring-chance { transition: none; filter: drop-shadow(0 0 14px rgba(242, 56, 74, .9)); }
.upg-drag-hint { margin: -4px 0 0; font-size: 11px; font-weight: 700; color: var(--dim, #797f95); text-align: center; }
.upg-drag-hint[hidden] { display: none; }
.pool-count { position: absolute; top: 6px; left: 6px; z-index: 1; padding: 0 6px; border-radius: 6px; font-size: 10px; font-weight: 900; background: rgba(0, 0, 0, .55); color: #fff; }

/* a lone item (or a few) sits in the middle instead of hugging the left */
.inv-grid { grid-template-columns: repeat(auto-fit, minmax(104px, 132px)); justify-content: center; }
.pool-grid { grid-template-columns: repeat(auto-fit, minmax(118px, 140px)); justify-content: center; }
.upg-slot { grid-template-columns: repeat(auto-fit, minmax(78px, 92px)); justify-content: center; }
.inv-grid > .inv-empty, .upg-slot > .slot-empty { grid-column: 1 / -1; }

/* Discord button pinned to the bottom of the menu */
.sidebar-left .nav-bottom { margin-top: auto; }
.nav-item.nav-discord { color: #fff; background: #5865f2; text-decoration: none; }
.nav-item.nav-discord:hover { background: #4752c4; color: #fff; }
.nav-item.nav-discord[hidden] { display: none; }

/* gems card + amount in the inventory */
.gem-card-img img { object-fit: contain; padding: 8%; filter: drop-shadow(0 4px 10px rgba(63, 208, 255, .45)); }
.tier-gems .inv-tier { background: rgba(63, 208, 255, .16); color: #7ee0ff; }
.inv-gems-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 16px 8px; padding: 10px 12px; border-radius: 12px; background: var(--bg, #14161f); }
.inv-gems-row[hidden] { display: none; }
.inv-gems-row label { font-size: 12px; font-weight: 800; color: var(--muted, #9ea4b9); }
.inv-gems-row .input-with-icon.small { height: 36px; width: 170px; }
.inv-gems-note { font-size: 12px; font-weight: 600; color: var(--muted); }
.inv-gems-note.bad { color: var(--loss); }

/* Stream Blur: hide player identities and amounts on dice, coinflip, upgrader, chat and wallet */
body.stream-mode .user-avatar,
body.stream-mode .seat img,
body.stream-mode .arena-avatar,
body.stream-mode .arena-name,
body.stream-mode .arena-stake,
body.stream-mode #matchStatusText,
body.stream-mode #matchPotDisplay,
body.stream-mode .room-value,
body.stream-mode .rh-result,
body.stream-mode .wager-col-head,
body.stream-mode .wl-value,
body.stream-mode .fp-avatar img,
body.stream-mode .flip-player strong,
body.stream-mode #flipStatus,
body.stream-mode .chat-msg-name,
body.stream-mode .chat-msg-avatar,
body.stream-mode .leaderboard-player,
body.stream-mode .leaderboard-wagered,
body.stream-mode .history-winner,
body.stream-mode .history-payout,
body.stream-mode .bet-name,
body.stream-mode .bet-wager,
body.stream-mode .crash-bet img,
body.stream-mode #invSelectedValue,
body.stream-mode #invGemsAmount,
body.stream-mode #invGrid .inv-value,
body.stream-mode #duelWagerValue,
body.stream-mode #duelGemsInput,
body.stream-mode #duelCreateValue,
body.stream-mode #duelGrid .inv-value,
body.stream-mode #upgItemsValue,
body.stream-mode #upgPickValue,
body.stream-mode #upgPickGrid .inv-value,
body.stream-mode #upgItemsSlot .inv-value,
body.stream-mode #withdrawGemsInput { filter: blur(7px); }

/* daily rewards */
.rewards-top { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.rewards-level, .rewards-claim { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; }
.rewards-claim { align-items: center; text-align: center; }
.rw-label { font-size: 12px; font-weight: 800; color: var(--dim, #797f95); text-transform: uppercase; letter-spacing: .06em; }
.rw-level { font-family: var(--display); font-weight: 400; font-size: 46px; line-height: 1; }
.rw-bar { width: 100%; height: 10px; border-radius: 5px; background: var(--bg, #14161f); overflow: hidden; }
.rw-bar span { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--violet, #f2384a); transition: width .5s ease; }
.rw-next, .rw-note { font-size: 13px; color: var(--muted, #9ea4b9); font-weight: 700; }
.rw-amount { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1.1; }
.rw-amount .gem-icon { width: 30px; height: 30px; }
.rewards-tiers { padding: 18px 20px; }
.rewards-tiers h3 { font-size: 16px; font-weight: 900; margin-bottom: 10px; }
.rw-tier-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.rw-tier { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--bg, #14161f); border: 2px solid transparent; opacity: .55; }
.rw-tier.unlocked { opacity: 1; }
.rw-tier.current { border-color: var(--violet, #f2384a); background: rgba(242, 56, 74, .14); }
.rw-tier span { font-size: 12px; font-weight: 800; color: var(--muted, #9ea4b9); }
.rw-tier strong { display: flex; align-items: center; gap: 5px; font-weight: 900; font-size: 17px; }
.rw-tier small { font-size: 11px; color: var(--dim, #797f95); font-weight: 700; }
@media (max-width: 760px) { .rewards-top { grid-template-columns: 1fr; } }

/* ---------- home ---------- */
.home-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px; border-radius: var(--r-lg); overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, rgba(242, 56, 74, .45), transparent 55%), linear-gradient(135deg, #272c3d, #101219 70%); border: 1px solid var(--line-strong); }
.home-hero-text { max-width: 560px; display: flex; flex-direction: column; gap: 10px; }
.home-kicker { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-hi); }
.home-title { font-size: clamp(24px, 3.2vw, 36px); font-weight: 900; line-height: 1.12; letter-spacing: -.02em; }
.home-sub { color: var(--muted); font-size: 15px; }
.home-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.home-hero-art { flex: none; width: 150px; height: 150px; filter: drop-shadow(0 18px 30px rgba(242, 56, 74, .45)); animation: homeFloat 4s ease-in-out infinite; }
.home-hero-art svg { width: 100%; height: 100%; }
@keyframes homeFloat { 50% { transform: translateY(-8px) rotate(-3deg); } }
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 6px; }
.home-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; text-align: center; align-items: center; }
.home-stat span { font-size: 12px; font-weight: 800; color: var(--subtle); text-transform: uppercase; letter-spacing: .05em; }
.home-stat strong { font-size: 20px; font-weight: 900; }
.home-section-title { font-size: 16px; font-weight: 900; margin: 18px 0 10px; }
.home-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.home-game { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line);
  color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.home-game:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--card-2); }
.home-game-icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: rgba(242, 56, 74, .16); color: var(--accent-hi); }
.home-game-icon svg { width: 24px; height: 24px; }
.home-game-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-game-text strong { font-size: 15px; font-weight: 900; }
.home-game-text small { font-size: 12.5px; color: var(--muted); }
.home-game-tag { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 900; letter-spacing: .06em; padding: 2px 7px; border-radius: 999px; background: rgba(52, 215, 123, .15); color: var(--win); }
.home-games-small .home-game { padding: 12px 14px; }
.home-games-small .home-game-icon { width: 38px; height: 38px; }
@media (max-width: 760px) {
  .home-hero { flex-direction: column-reverse; text-align: center; padding: 24px 18px; }
  .home-hero-text { align-items: center; }
  .home-actions { justify-content: center; }
  .home-hero-art { width: 96px; height: 96px; }
  .home-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .home-stat { padding: 10px 6px; }
  .home-stat strong { font-size: 16px; }
  .home-section-title { text-align: center; }
}

/* ---------- socials ---------- */
.nav-socials { margin-top: 4px; }

/* ---------- daily cases ---------- */
.rewards-level-wide { display: flex; align-items: center; gap: 22px; margin-bottom: 14px; }
.rw-level-left { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 90px; }
.rw-level-right { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.rw-status { text-align: center; margin-bottom: 12px; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; justify-content: center; }
.case-card { --case-hue: 265; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 14px 14px; border-radius: var(--r-lg); cursor: pointer;
  background: linear-gradient(180deg, hsl(var(--case-hue) 60% 22% / .55), var(--card) 65%); border: 1px solid var(--line); color: var(--text); font: inherit; text-align: center;
  transition: transform .15s ease, border-color .15s ease; }
.case-card:hover { transform: translateY(-3px); border-color: hsl(var(--case-hue) 80% 60%); }
.case-card:not(.unlocked) .case-art { filter: grayscale(.85) brightness(.7); }
.case-art { width: 88px; height: 88px; transition: transform .3s ease; }
.case-card.ready .case-art { animation: caseBob 2.4s ease-in-out infinite; }
@keyframes caseBob { 50% { transform: translateY(-5px) rotate(-4deg); } }
.case-name { font-size: 15px; font-weight: 900; }
.case-top { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.case-top .gem-icon { width: 14px; height: 14px; }
.case-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 9px 10px; border-radius: 10px; font-weight: 900; font-size: 13px;
  background: var(--card-2); color: var(--muted); }
.case-btn .icon-svg { width: 14px; height: 14px; }
.case-btn.ready { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(242, 56, 74, .35); }
.case-modal { max-width: 720px; width: 100%; }
.case-reel-wrap { position: relative; overflow: hidden; height: 150px; border-radius: 12px; background: var(--input); margin-bottom: 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.case-reel { display: flex; padding: 15px 0; will-change: transform; }
.case-reel-marker { position: absolute; z-index: 2; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: var(--gold); box-shadow: 0 0 12px var(--gold); border-radius: 2px; }
.case-tile { flex: none; width: 120px; height: 120px; margin-right: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: 12px;
  background: var(--card-2); border-bottom: 3px solid var(--rar, #3b82f6); }
.case-tile img, .case-tile .case-gem { width: 64px; height: 64px; object-fit: contain; }
.case-tile-value { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 900; }
.case-tile-value .gem-icon { width: 13px; height: 13px; }
.case-tile.won { box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(245, 196, 81, .5); }
.r-blue { --rar: #3b82f6; } .r-purple { --rar: #a855f7; } .r-red { --rar: #ef4444; } .r-gold { --rar: #f5c451; }
.case-note { text-align: center; margin-top: 8px; }
.case-items-title { font-size: 14px; font-weight: 900; margin: 16px 0 8px; }
.case-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.case-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border-radius: 10px; background: var(--card-2); border-bottom: 3px solid var(--rar); text-align: center; }
.case-item img, .case-item .case-gem { width: 48px; height: 48px; object-fit: contain; }
.case-item-name { font-size: 12.5px; font-weight: 800; }
.case-item-value { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 700; }
.case-item-value .gem-icon { width: 12px; height: 12px; }
.case-item-chance { font-size: 11px; font-weight: 900; color: var(--rar); }
@media (max-width: 760px) {
  .rewards-level-wide { flex-direction: column; text-align: center; gap: 10px; }
  .case-grid { grid-template-columns: repeat(2, 1fr); }
  .case-art { width: 70px; height: 70px; }
}

/* ---------- transactions ---------- */
.modal-tab-link { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; }
.modal-tab-link:hover { color: var(--text); }
.modal-tab-link .icon-svg { width: 16px; height: 16px; }
.tx-modal { max-width: 560px; width: 100%; }
.tx-modal .modal-header .hint { margin-top: 2px; }
.tx-tabs { display: flex; gap: 8px; padding: 0 20px 12px; }
.tx-list { display: flex; flex-direction: column; gap: 8px; max-height: min(60vh, 560px); overflow-y: auto; }
.tx-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tx-main strong { font-size: 14px; font-weight: 900; }
.tx-date { font-size: 12px; color: var(--subtle); font-weight: 600; }
.tx-meta { font-size: 11.5px; font-weight: 900; color: var(--muted); letter-spacing: .03em; }
.tx-status.completed { color: var(--win); } .tx-status.pending { color: var(--gold); } .tx-status.cancelled, .tx-status.expired { color: var(--loss); }
.tx-pets { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.tx-pet { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border-radius: 8px; background: var(--input); font-size: 12px; font-weight: 700; }
.tx-pet img { width: 26px; height: 26px; object-fit: contain; }

/* ---------- pet drops in chat ---------- */
.chat-drop { margin-top: 6px; padding: 10px; border-radius: 12px; background: linear-gradient(160deg, rgba(245, 196, 81, .16), rgba(242, 56, 74, .12)); border: 1px solid rgba(245, 196, 81, .35); display: flex; flex-direction: column; gap: 8px; }
.drop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.drop-badge { font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #1a1200; background: var(--gold); padding: 3px 8px; border-radius: 999px; }
.drop-timer { font-size: 12px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.drop-note { font-size: 13px; color: var(--text); }
.drop-items { display: flex; flex-direction: column; gap: 6px; }
.drop-item { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 9px; background: rgba(0, 0, 0, .25); }
.drop-item img, .drop-item .gem-icon { width: 34px; height: 34px; object-fit: contain; flex: none; }
.drop-item.taken { opacity: .5; }
.drop-item-text { display: flex; flex-direction: column; min-width: 0; }
.drop-item-text strong { font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-item-text small { font-size: 11.5px; color: var(--muted); }
.chat-drop .drop-claim { width: 100%; }
.drop-done { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.drop-level { text-align: center; font-size: 11px; color: var(--subtle); font-weight: 700; }

/* ---------- phones: center headers, toolbars and panels ---------- */
@media (max-width: 760px) {
  .view-head { text-align: center; }
  .view-head-row { flex-direction: column; justify-content: center; align-items: center; }
  #crashView .view-head .crash-history { justify-content: center; }
  .lobby-toolbar { justify-content: center; flex-wrap: wrap; }
  .lobby-toolbar .toolbar-gap { display: none; }
  .lobby-stats { justify-content: center; flex-wrap: wrap; }
  .capacity-pill { display: flex; width: fit-content; margin-left: auto; margin-right: auto; }
  .upg-intro { flex-direction: column; text-align: center; align-items: center; gap: 8px; }
  .values-toolbar, .values-footer { justify-content: center; }
  .game-controls h3, .fair-box h3, .creator-panel h3, .aff-card { text-align: center; }
  .empty-state { text-align: center; }
}

/* ---------- daily cases: list + case page ---------- */
.rw-progress { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.rw-progress-top, .rw-progress-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rw-progress-top strong { font-size: 16px; font-weight: 900; }
.rw-progress-top span, .rw-progress-bottom span { font-size: 13px; color: var(--muted); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.rw-progress-top b { color: var(--text); }
.rw-progress-bottom .gem-icon { width: 14px; height: 14px; }
.case-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.case-card { align-items: stretch; padding: 14px; }
.case-card-head { display: flex; justify-content: space-between; align-items: flex-start; text-align: left; }
.case-card-head > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.case-card-head small { font-size: 11px; font-weight: 900; color: var(--subtle); letter-spacing: .05em; }
.case-lock { font-size: 11px; font-weight: 800; color: var(--muted); padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line-strong); }
.case-art { align-self: center; width: 120px; height: 120px; margin: 6px 0; }
.case-btn small { font-weight: 700; opacity: .8; }
.case-page-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.case-back-icon { transform: rotate(90deg); }
.case-page-badge { display: flex; flex-direction: column; align-items: flex-end; padding: 6px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.case-page-badge small { font-size: 10px; font-weight: 900; color: var(--subtle); letter-spacing: .06em; }
.case-page-badge strong { font-size: 14px; font-weight: 900; }
#rwCasePane .case-reel-wrap { height: 170px; border: 1px solid var(--line); }
#rwCasePane .case-reel { padding: 25px 0; }
.case-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.case-controls .toolbar-gap { flex: 1; }
.case-quick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--muted); cursor: pointer; }
.case-loot-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0 10px; }
.case-loot-head h3 { font-size: 16px; font-weight: 900; }
@media (max-width: 760px) {
  .case-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .case-art { width: 78px; height: 78px; }
  .case-card { padding: 10px; }
  .case-btn { font-size: 11.5px; padding: 8px 6px; flex-wrap: wrap; }
  .rw-progress-top, .rw-progress-bottom { justify-content: center; text-align: center; }
  .case-controls { justify-content: center; }
  .case-controls .toolbar-gap { display: none; }
  .case-loot-head { justify-content: center; text-align: center; }
}
/* a lone card in the last row stays centered */
.case-items { grid-template-columns: repeat(auto-fit, minmax(150px, 190px)); justify-content: center; }
.home-games, .case-grid { justify-content: center; }
.tx-modal { width: min(560px, calc(100vw - 32px)); }
.tx-modal .modal-header > div { margin-right: auto; }
.tx-tabs { padding-top: 12px; }
.tx-tabs .chip { color: var(--muted); cursor: pointer; }
.tx-tabs .chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.inv-gems-row .input-with-icon.small input { width: 100%; }

.balance-wallet { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 800; }
.balance-wallet:hover { background: #ff4d5e; }
.balance-wallet .icon-svg { width: 16px; height: 16px; }
[data-profile] { cursor: pointer; }
.chat-msg-name[data-profile]:hover { text-decoration: underline; }
.win-text { color: var(--win); }
.loss-text { color: var(--loss); }
.profile-card { width: min(560px, 100%); }
.profile-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.profile-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--card-2); object-fit: cover; }
.profile-id { display: grid; margin-right: auto; line-height: 1.25; }
.profile-id strong { font-size: 16px; font-weight: 900; }
.profile-id span { font-size: 12px; color: var(--muted); font-weight: 700; }
.profile-body { padding: 14px 18px 18px; overflow-y: auto; display: grid; gap: 14px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.profile-stats > div { display: grid; justify-items: center; gap: 4px; padding: 12px 8px; text-align: center; }
.profile-stats > div + div { border-left: 1px solid var(--line-strong); }
.profile-stats span, .profile-counts span { font-size: 11px; font-weight: 700; color: var(--muted); }
.profile-stats strong { font-size: 16px; font-weight: 900; }
.profile-counts { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.profile-counts > div { display: grid; gap: 2px; }
.profile-counts strong { font-size: 16px; font-weight: 900; }
.profile-matches-head { display: flex; align-items: flex-end; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); }
.profile-matches-head strong { display: block; font-size: 14px; font-weight: 900; }
.profile-matches-head span, .profile-matches-head small { font-size: 11px; color: var(--muted); }
.match-list { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.match-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.match-row.won { border-left: 3px solid var(--win); }
.match-row.lost { border-left: 3px solid var(--loss); }
.match-avatars { display: flex; align-items: center; gap: 4px; flex: none; }
.match-avatars img { width: 28px; height: 28px; border-radius: 50%; background: var(--card-2); object-fit: cover; }
.match-avatars .vs-text { font-size: 10px; }
.match-info { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.match-info strong { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-info strong small { color: var(--subtle); font-weight: 600; margin-left: 4px; }
.match-info span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-info b { color: var(--text); }
.match-row .dice-mini .die-sq { width: 16px; height: 16px; }
.match-row .dice-mini .die-sq::after { width: 4px; height: 4px; }
.match-result { display: grid; justify-items: end; font-size: 12px; font-weight: 900; min-width: 64px; line-height: 1.15; }
.match-result small { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.match-result.win { color: var(--win); }
.match-result.loss { color: var(--loss); }
.match-row .btn-view { height: 28px; padding: 0 10px; }

/* ---------- bot to trade: avatar + Join ---------- */
.bot-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; border-radius: var(--r-lg); background: var(--input); border: 1px solid var(--line-strong); text-align: center; }
.bot-card-avatar { position: relative; width: 112px; height: 112px; margin-bottom: 18px; }
.bot-card-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--card-2); border: 3px solid var(--accent); box-shadow: 0 10px 30px rgba(242, 56, 74, .35); }
.bot-card-avatar .bot-join { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); height: 34px; padding: 0 16px; border-radius: 999px; font-size: 13px; gap: 6px; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.bot-card-avatar .bot-join .icon-svg { width: 14px; height: 14px; }
.bot-card-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.bot-card-name { font-size: 20px; font-weight: 900; color: var(--gold); overflow-wrap: anywhere; }
.bot-card-hint { font-size: 12px; color: var(--subtle); }
.inv-result .bot-card { width: 100%; max-width: 360px; }

/* ---------- deposit screen ---------- */
.dep-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.dep-step { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--subtle); font-weight: 800; font-size: 13px; }
.dep-dot { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--card-2); color: var(--muted); font-size: 15px; }
.dep-dot svg { display: none; width: 20px; height: 20px; }
.dep-step.current { color: var(--accent-hi); }
.dep-step.current .dep-dot { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px rgba(242, 56, 74, .25); }
.dep-step.done { color: var(--text); }
.dep-step.done .dep-dot { background: var(--accent); color: #fff; }
.dep-step.done .dep-dot b { display: none; }
.dep-step.done .dep-dot svg { display: block; }
.dep-flow, .dep-done { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.dep-flow[hidden], .dep-done[hidden], #depStart[hidden] { display: none; }
.dep-spinner { width: 48px; height: 48px; border-radius: 50%; border: 4px solid rgba(242, 56, 74, .2); border-top-color: var(--accent); animation: depSpin .9s linear infinite; }
@keyframes depSpin { to { transform: rotate(360deg); } }
.dep-title { font-size: 19px; font-weight: 900; }
.dep-sub { color: var(--muted); font-size: 13.5px; max-width: 460px; }
.dep-bots { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; max-height: 46vh; overflow-y: auto; text-align: left; }
.dep-bot { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line-strong); min-width: 0; }
.dep-bot img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--input); flex: none; }
.dep-bot-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dep-bot-text strong { font-size: 13.5px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-bot-text small { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.dep-bot-text small i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dep-bot.available small { color: var(--win); }
.dep-bot.busy small { color: var(--gold); }
.dep-bot.offline { opacity: .55; }
.dep-bot.offline small { color: var(--subtle); }
.dep-copy { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--input); border: 1px solid var(--line-strong); }
.dep-copy .icon-svg { width: 16px; height: 16px; }
.dep-join { height: 36px; padding: 0 14px; gap: 6px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 900; font-size: 13px; flex: none; }
.dep-join:hover { background: var(--accent-hi); }
.dep-join .icon-svg { width: 15px; height: 15px; }
.dep-footer { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 4px 4px; margin-top: 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.dep-footer b { color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; }
.dep-cancel { height: 46px; border-radius: 14px; background: rgba(255, 90, 118, .1); border: 1px solid rgba(255, 90, 118, .45); color: var(--loss); font-weight: 900; }
.dep-cancel:hover { background: rgba(255, 90, 118, .18); }
.dep-done-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(52, 215, 123, .15); color: var(--win); }
.dep-done-icon svg { width: 34px; height: 34px; }
#walletModal .modal-card { width: min(760px, calc(100vw - 32px)); }
@media (max-width: 640px) {
  .dep-bots { grid-template-columns: 1fr; }
  .dep-step small { font-size: 11px; }
}

/* ---------- withdrawal screen ---------- */
.dep-join, .dep-join:hover { text-decoration: none; }
#wdForm[hidden] { display: none; }
.dep-bots.single { grid-template-columns: 1fr; max-width: 420px; }
.wd-items-head { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 13px; font-weight: 800; color: var(--muted); }
.wd-items-head b { color: var(--text); }
.wd-items { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 34vh; overflow-y: auto; }
.wd-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-strong); font-size: 12px; font-weight: 800; text-align: center; }
.wd-item img, .wd-item .gem-icon { width: 48px; height: 48px; object-fit: contain; }
.wd-item b { position: absolute; top: 6px; right: 8px; font-size: 11px; color: var(--gold); }
.wd-item.gems span { color: var(--gem); }

.match-mult { min-width: 56px; text-align: center; font-weight: 900; font-size: 13px; color: var(--accent-hi); }

/* upgrader: pick several copies of a target */
.pool-qty { display: none; position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 2; align-items: center; justify-content: space-between; gap: 4px; padding: 3px; border-radius: 10px; background: rgba(8, 9, 13, .88); border: 1px solid var(--accent); }
.inv-card.selected .pool-qty { display: flex; }
.pool-qty b { font-size: 13px; font-weight: 900; color: var(--text); }
.pool-step { display: grid; place-items: center; width: 26px; height: 24px; border-radius: 7px; background: var(--accent); color: #fff; font-weight: 900; font-size: 16px; line-height: 1; cursor: pointer; user-select: none; }
.pool-step:hover { background: var(--accent-hi); }
#upgPoolGrid .inv-card { position: relative; }
#upgPoolGrid .pool-qty { bottom: auto; top: 50%; transform: translateY(-10%); }

/* =====================================================================
   Roblox login pop-up
   ===================================================================== */
.login-modal { width: min(440px, 100%); border-radius: 18px;
  background: linear-gradient(180deg, rgba(242, 56, 74, .09), transparent 140px), var(--panel); }
.login-modal .modal-header { gap: 10px; padding: 16px 18px; }
.login-modal-logo { width: 28px; height: 28px; flex: none; }
.login-modal .modal-header h3 { font-size: 17px; }
.login-modal .modal-body { padding: 20px; }

.login-modal .login-step { display: flex; flex-direction: column; gap: 16px; }
.login-modal .login-step[hidden] { display: none; }

/* 2-step progress bar */
.login-progress { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.login-progress span { height: 4px; border-radius: 999px; background: var(--card-2); }
.login-progress span.on { background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }

.login-modal .modal-desc { font-size: 14px; line-height: 1.5; }
.login-modal .modal-desc strong { color: var(--text); }
.login-modal .form-group label { font-size: 12px; }
.login-modal .input-with-icon > svg { left: 13px; }
.login-modal .input-with-icon input { height: 46px; padding-left: 40px; border-radius: 12px; font-size: 14px; }
.login-modal .input-with-icon:focus-within > svg { color: var(--accent-hi); }
.login-modal .btn-lg { height: 48px; border-radius: 12px; font-size: 15px; }
.login-modal .form-error { margin: -6px 0; text-align: center; font-weight: 700; }

.login-safe { display: flex; align-items: center; justify-content: center; gap: 6px; margin: -4px 0 0; color: var(--subtle); font-size: 12px; font-weight: 600; }
.login-safe svg { color: var(--win); }

/* verify step */
.login-modal .login-who { padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.login-modal .login-who img { width: 48px; height: 48px; border: 2px solid var(--accent); }
.login-modal .login-who strong { font-size: 15px; margin-bottom: 2px; }

.login-steps { list-style: none; counter-reset: lstep; padding: 0; gap: 10px; font-size: 13.5px; }
.login-steps li { counter-increment: lstep; display: flex; align-items: flex-start; gap: 10px; }
.login-steps li::before { content: counter(lstep); flex: none; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(242, 56, 74, .18); color: var(--accent-hi); font-size: 12px; font-weight: 800; }
.login-steps strong { color: var(--text); }

.login-modal .phrase-box { padding: 10px 10px 10px 14px; border-radius: 12px; border-style: dashed; border-color: rgba(242, 56, 74, .5); }
.login-modal .phrase-box code { font-size: 14px; font-weight: 700; background: none; padding: 0; }
.login-modal .edit-profile-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--card); text-decoration: none; }
.login-modal .edit-profile-link:hover { border-color: var(--accent); }

@media (max-width: 420px) { .login-modal .modal-body { padding: 16px; } }
.login-steps li > span { padding-top: 2px; }

/* back arrow on the verify step */
.login-topbar { display: flex; align-items: center; gap: 12px; }
.login-topbar .login-progress { flex: 1; }
.login-back { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 8px; flex: none;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: color .15s, border-color .15s, background-color .15s; }
.login-back:hover { color: var(--text); border-color: var(--accent); background: var(--card-2); }
.login-back:hover svg { transform: translateX(-2px); }
.login-back svg { transition: transform .15s; }
.login-who-sub { display: block; color: var(--muted); font-size: 12.5px; }

/* =====================================================================
   Discord giveaway banner (Home page)
   ===================================================================== */
.dc-banner { position: relative; display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 12px 14px 12px 12px;
  border-radius: 16px; border: 1px solid rgba(242, 56, 74, .45); overflow: hidden;
  background:
    radial-gradient(120% 220% at 0% 50%, rgba(242, 56, 74, .45), transparent 55%),
    radial-gradient(80% 200% at 100% 50%, rgba(88, 101, 242, .25), transparent 60%),
    linear-gradient(90deg, #25293a, #1a1d29 60%, #191c27);
  box-shadow: 0 10px 30px -14px rgba(242, 56, 74, .7), inset 0 1px 0 rgba(255, 255, 255, .06); }
.dc-banner[hidden] { display: none; }
.dc-banner::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .07) 45%, transparent 60%);
  transform: translateX(-100%); animation: dcShine 5s ease-in-out infinite; }
@keyframes dcShine { 60%, 100% { transform: translateX(100%); } }

.dc-banner-logo { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(242, 56, 74, .22); border: 1px solid rgba(255, 90, 104, .45); }
.dc-banner-logo img { width: 32px; height: 32px; }

.dc-banner-text { display: grid; gap: 2px; min-width: 0; line-height: 1.2; }
.dc-banner-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-hi); }
.dc-banner-kicker::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--win); box-shadow: 0 0 0 0 rgba(52, 215, 123, .7); animation: dcLive 1.6s ease-out infinite; }
@keyframes dcLive { 70% { box-shadow: 0 0 0 7px rgba(52, 215, 123, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 215, 123, 0); } }
.dc-banner-title { font-size: 15.5px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-banner-accent { color: var(--accent-hi); }

.dc-banner-joined { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: #f7d3d7; font-size: 13px; font-weight: 600; white-space: nowrap; }
.dc-banner-joined[hidden] { display: none; }
.dc-banner-joined b { color: #fff; }
.dc-banner-joined[hidden] + .dc-banner-join { margin-left: auto; }

.dc-banner-join { position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px;
  border-radius: 999px; background: linear-gradient(180deg, #ff5a68, #f2384a); color: #fff; font-weight: 800; font-size: 14px; text-decoration: none;
  box-shadow: 0 6px 18px -6px rgba(242, 56, 74, .9), inset 0 1px 0 rgba(255, 255, 255, .25); transition: transform .12s, filter .12s; }
.dc-banner-join:hover { filter: brightness(1.08); transform: translateY(-1px); }
.dc-banner-join:active { transform: translateY(1px); }

.dc-banner-close { position: relative; z-index: 1; flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px;
  color: #c2c6d6; background: transparent; border: 0; cursor: pointer; }
.dc-banner-close:hover { color: #fff; background: rgba(255, 255, 255, .08); }

@media (max-width: 760px) {
  .dc-banner { flex-wrap: wrap; gap: 10px 12px; padding: 12px; }
  .dc-banner-text { flex: 1 1 calc(100% - 100px); padding-right: 26px; }
  .dc-banner-title { white-space: normal; font-size: 14.5px; }
  .dc-banner-close { position: absolute; top: 8px; right: 8px; }
  .dc-banner-joined { display: none !important; }
  .dc-banner-join { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .dc-banner::after, .dc-banner-kicker::before { animation: none; } }

/* =====================================================================
   Upgrader circle restyle (style only)
   ===================================================================== */
.upg-wheel { isolation: isolate; }
.upg-wheel::before { content: ''; position: absolute; inset: 9%; border-radius: 50%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 90, 104, .30), rgba(242, 56, 74, .14) 45%, rgba(242, 56, 74, .04) 70%, transparent 72%),
    radial-gradient(circle, #181b26 0 70%, transparent 71%);
  box-shadow: 0 0 60px -10px rgba(242, 56, 74, .45); transition: background .4s, box-shadow .4s; }
.upg-dots { display: none; }
.upg-ring { overflow: visible; }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 3; }
.ring-chance { stroke: #ff5a68; stroke-width: 7; filter: drop-shadow(0 0 6px rgba(255, 90, 104, .95)) drop-shadow(0 0 16px rgba(242, 56, 74, .7)); }
.upg-wheel.dragging .ring-chance { filter: drop-shadow(0 0 8px rgba(255, 90, 104, 1)) drop-shadow(0 0 22px rgba(242, 56, 74, .9)); }

/* chevron pointer sitting just inside the ring */
.upg-pointer i { top: 15%; width: 16px; height: 16px; border: 0; border-top: 3.5px solid #fff; border-left: 3.5px solid #fff; border-radius: 2px;
  transform: translateX(-50%) rotate(45deg); filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7)) drop-shadow(0 0 12px rgba(255, 90, 104, .8)); }

/* centre readout */
.upg-readout b { color: #ffb3ba; font-size: 38px; letter-spacing: -.01em; text-shadow: 0 0 18px rgba(255, 90, 104, .75), 0 0 40px rgba(242, 56, 74, .45); }
.upg-readout small { color: #979db5; letter-spacing: .2em; }

/* result colours */
.upg-wheel.win::before { background: radial-gradient(circle, rgba(52, 215, 123, .28), rgba(52, 215, 123, .08) 50%, transparent 72%), radial-gradient(circle, #102419 0 70%, transparent 71%); box-shadow: 0 0 60px -8px rgba(52, 215, 123, .5); }
.upg-wheel.lose::before { background: radial-gradient(circle, rgba(255, 90, 118, .26), rgba(255, 90, 118, .07) 50%, transparent 72%), radial-gradient(circle, #24111a 0 70%, transparent 71%); box-shadow: 0 0 60px -8px rgba(255, 90, 118, .45); }
.upg-wheel.win .ring-chance { filter: drop-shadow(0 0 6px rgba(52, 215, 123, .95)) drop-shadow(0 0 16px rgba(52, 215, 123, .6)); }
.upg-wheel.lose .ring-chance { filter: drop-shadow(0 0 6px rgba(255, 90, 118, .9)) drop-shadow(0 0 16px rgba(255, 90, 118, .55)); }
.upg-wheel.win .upg-readout b { color: var(--win); text-shadow: 0 0 18px rgba(52, 215, 123, .7); }
.upg-wheel.lose .upg-readout b { color: var(--loss); text-shadow: 0 0 18px rgba(255, 90, 118, .7); }
/* =====================================================================
   Tipping
   ===================================================================== */
#profileTipBtn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
#profileTipBtn[hidden] { display: none; }
#profileTipBtn + #profileRobloxLink { margin-left: 0; }
.tip-modal { width: min(600px, 100%); }
.tip-avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--accent); background: var(--card); flex: none; }
.tip-head { display: grid; gap: 2px; margin-right: auto; min-width: 0; }
.tip-head h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip-head .hint { margin: 0; font-size: 12px; }
.tip-body { gap: 12px; }
.tip-body label { display: flex; justify-content: space-between; align-items: baseline; }
.tip-balance { font-weight: 600; color: var(--subtle); }
.tip-balance b { color: var(--gem); }
.tip-gem-row { display: flex; gap: 8px; align-items: center; }
.tip-gem-row .grow { flex: 1; min-width: 0; }
.tip-gem-row .btn { height: 40px; }
.tip-pets-head { display: flex; justify-content: space-between; align-items: center; }
.tip-pets-head small { font-weight: 600; color: var(--subtle); margin-left: 6px; }
.tip-grid { padding: 0; max-height: 300px; min-height: 120px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.tip-footer { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--card); }
.tip-summary { margin-right: auto; font-size: 13px; color: var(--muted); min-width: 0; }
.tip-summary b { color: var(--text); }
.tip-summary .gem-text { color: var(--gem); }
.tip-problem { color: var(--muted); }
@media (max-width: 520px) {
  .tip-footer { flex-direction: column; align-items: stretch; }
  .tip-summary { margin: 0; text-align: center; }
  .tip-grid { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); max-height: 240px; }
}

/* Upgrader: Gems tab */
.upg-gems { flex: 1; display: grid; align-content: start; gap: 10px; }
.upg-gems[hidden] { display: none; }
.upg-gems label { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 700; color: var(--muted); }
.upg-gems label span { font-weight: 600; color: var(--subtle); }
.upg-gems .input-with-icon input { height: 46px; font-size: 16px; font-weight: 700; }
.upg-gem-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.upg-gem-chips .chip { justify-content: center; }
.upg-gems-hint { margin: 0; font-size: 12px; color: var(--subtle); }
#upgPickBtn[hidden] { display: none; }

/* =====================================================================
   Player profile (stats cards + profit chart)
   ===================================================================== */
.profile-card.pf { position: relative; width: min(640px, 100%); }
.pf-chart { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 6px; }
.pf-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.pf-chart-top { font-size: 11px; font-weight: 700; color: var(--subtle); text-align: center; margin-bottom: 4px; }
.pf-chart-empty { padding: 34px 10px; text-align: center; color: var(--subtle); font-size: 13px; }
.pf-chart line.pf-up, .pf-chart line.pf-down { stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pf-chart line.pf-up { stroke: var(--win); }
.pf-chart line.pf-down { stroke: var(--loss); }
.pf-chart line.pf-zero { stroke: rgba(255, 255, 255, .12); stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.pf-chart text { fill: var(--muted); font-size: 11px; font-weight: 800; font-family: var(--body); }
.pf-chart .pf-axis { fill: var(--text); }
@media (max-width: 520px) {
  .pf .profile-body { padding: 18px 14px 16px; }
  .pf .profile-avatar { width: 64px; height: 64px; }
  .pf .profile-id strong { font-size: 18px; }
  .pf-cards { grid-template-columns: 1fr; }
}
/* Upgrader pool: small copy stepper in the card footer (does not cover the pet) */
#upgPoolGrid .pool-qty { top: auto; left: auto; right: 6px; bottom: 6px; transform: none; height: 22px; padding: 0; gap: 2px;
  border: 0; border-radius: 7px; background: rgba(242, 56, 74, .14); box-shadow: inset 0 0 0 1px rgba(242, 56, 74, .35); }
#upgPoolGrid .pool-step { width: 20px; height: 22px; border-radius: 7px; background: transparent; color: var(--accent-hi); transition: background .12s, color .12s, opacity .12s; }
#upgPoolGrid .pool-step svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
#upgPoolGrid .pool-step:hover { background: rgba(242, 56, 74, .35); color: #fff; }
#upgPoolGrid .pool-qty.at-max .pool-step.plus { opacity: .3; pointer-events: none; }
#upgPoolGrid .pool-num { min-width: 14px; text-align: center; font-variant-numeric: tabular-nums; }
#upgPoolGrid .pool-num b { font-size: 11px; font-weight: 900; color: #fff; }
#upgPoolGrid .pool-num small { display: none; }

/* Finished duels/flips slide out to the left */
.room-row.is-leaving { animation: roomOut .6s cubic-bezier(.5, 0, .75, 0) forwards; }
@keyframes roomOut { to { opacity: 0; transform: translateX(-80px); } }
@media (prefers-reduced-motion: reduce) { .room-row.is-leaving { animation-duration: .01s; } }

/* Game animations keep playing even with "reduce motion" on (the result would otherwise just pop up) */
@media (prefers-reduced-motion: reduce) {
  #upgPointer { transition-duration: 4s !important; }
  .flip-coin { transition-duration: 1.6s !important; }
  #caseReel[style*="transition"] { transition-duration: var(--reel-ms, 5s) !important; }
  .die.rolling { animation-duration: .12s !important; animation-iteration-count: infinite !important; }
}

/* Coinflip: toss out and back in */
.flip-toss { position: relative; display: grid; place-items: end center; width: 160px; height: 250px; padding-bottom: 14px; perspective: 700px; }
.flip-toss .flip-coin { position: relative; z-index: 1; }
.flip-shadow { position: absolute; left: 50%; bottom: 0; width: 96px; height: 14px; margin-left: -48px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); pointer-events: none; }
.flip-toss.tossing { animation: coinToss 1.6s cubic-bezier(.3, .6, .3, 1) both; }
.flip-toss.tossing .flip-shadow { animation: coinShadow 1.6s cubic-bezier(.3, .6, .3, 1) both; }
@keyframes coinToss {
  0% { transform: translateY(0) scale(1); }
  10% { transform: translateY(8px) scale(.94); }
  45% { transform: translateY(-74px) scale(1.32); }
  78% { transform: translateY(0) scale(1); }
  86% { transform: translateY(-12px) scale(1.04); }
  94% { transform: translateY(2px) scale(.99); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes coinShadow {
  0%, 100% { transform: scale(1); opacity: 1; }
  10% { transform: scale(1.08); opacity: 1; }
  45% { transform: scale(.45); opacity: .35; }
  78% { transform: scale(1); opacity: 1; }
  86% { transform: scale(.88); opacity: .85; }
}
.flip-toss.landed .flip-coin { animation: coinLandGlow .7s ease-out; }
@keyframes coinLandGlow { 0% { filter: drop-shadow(0 0 0 rgba(255, 90, 104, 0)); } 30% { filter: drop-shadow(0 0 22px rgba(255, 90, 104, .9)); } 100% { filter: drop-shadow(0 0 0 rgba(255, 90, 104, 0)); } }
@media (prefers-reduced-motion: reduce) {
  .flip-toss.tossing, .flip-toss.tossing .flip-shadow { animation-duration: 1.6s !important; }
  .flip-toss.landed .flip-coin { animation-duration: .7s !important; }
}
@media (max-width: 640px) { .flip-toss { height: 220px; } }

/* Dice: smooth tumble + cascade landing */
.die.rolling { animation: dieTumble .32s linear infinite; transition: background-color .08s; }
@keyframes dieTumble { 0% { transform: rotate(0) scale(.94); } 25% { transform: rotate(8deg) translateY(-3px) scale(1); } 50% { transform: rotate(0) scale(.94); } 75% { transform: rotate(-8deg) translateY(-3px) scale(1); } 100% { transform: rotate(0) scale(.94); } }
.die.landed { animation: dieLand .32s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes dieLand { 0% { transform: scale(1.25) translateY(-6px); } 100% { transform: scale(1) translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .die.rolling { animation-duration: .32s !important; animation-iteration-count: infinite !important; }
  .die.landed { animation-duration: .32s !important; }
}

/* waiting dice breathe softly before the first roll, so it never looks frozen */
#arenaDice .die.unknown { animation: diePulse 1.1s ease-in-out infinite; }
@keyframes diePulse { 50% { transform: scale(.92); opacity: .6; } }

/* =====================================================================
   Bet boxes (Mines + Crash)
   ===================================================================== */
.bet-box { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }
.bet-box-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bet-box-head > label:first-child { font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bet-bal { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--subtle); }
.bet-bal b { color: var(--text); font-weight: 900; }
.bet-bal .gem-icon { width: 13px; height: 13px; }
.bet-field { display: flex; align-items: center; height: 46px; border-radius: 11px; background: var(--input); border: 1px solid var(--line-strong); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.bet-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 56, 74, .2); }
.bet-field > .gem-icon { flex: none; width: 18px; height: 18px; margin: 0 2px 0 14px; }
.bet-field input { flex: 1; min-width: 0; height: 100%; padding: 0 10px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; outline: none; box-shadow: none; }
.bet-field input:disabled { color: var(--subtle); }
.bet-suffix { color: var(--muted); font-weight: 800; padding-right: 8px; }
.bet-mini { flex: none; width: 46px; height: 100%; border: 0; border-left: 1px solid var(--line-strong); background: transparent; color: var(--muted); font: inherit; font-weight: 900; font-size: 14px; cursor: pointer; transition: background .12s, color .12s; }
.bet-mini:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.bet-mini:disabled { opacity: .45; cursor: default; }
.bet-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bet-chips button { height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.bet-chips button:hover { background: var(--hover); color: var(--text); border-color: var(--line-strong); }
.bet-hint { margin: 0; font-size: 12px; color: var(--subtle); }
.cashout-box.on .bet-hint { color: var(--accent-hi); }
.bet-switch { position: relative; display: inline-flex; cursor: pointer; }
.bet-switch input { position: absolute; opacity: 0; pointer-events: none; }
.bet-switch span { width: 38px; height: 22px; border-radius: 999px; background: var(--input); border: 1px solid var(--line-strong); position: relative; transition: background .15s, border-color .15s; }
.bet-switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.bet-switch input:checked + span { background: var(--accent); border-color: transparent; }
.bet-switch input:checked + span::after { transform: translateX(16px); }
.bet-switch input:focus-visible + span { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.bet-field input { font-size: 15px; padding: 0 6px; }
.bet-field > .gem-icon { margin-left: 12px; }
.bet-mini { width: 40px; }

/* =====================================================================
   Dice: blank wobbling dice that flip to color one by one
   ===================================================================== */
.die.blank { background: #1d2440; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(255, 255, 255, .04); }
.die.blank::after { display: block; width: 14px; height: 14px; background: rgba(255, 255, 255, .85); }
#arenaDice .die.blank { animation: none; }
#arenaDice .die.blank.wobble { animation: dieWobble .5s ease-in-out infinite; }
@keyframes dieWobble {
  0%, 100% { transform: rotate(0) translateY(0); }
  25% { transform: rotate(-7deg) translateY(-2px); }
  50% { transform: rotate(3deg) translateY(1px); }
  75% { transform: rotate(7deg) translateY(-2px); }
}
.die.pop { animation: diePop .34s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes diePop { 0% { transform: scale(.75); } 55% { transform: scale(1.2); } 100% { transform: scale(1); } }
.dice-phase { display: grid; justify-items: center; gap: 2px; min-height: 18px; margin-top: 8px; }
.dice-phase span { font-size: 11px; font-weight: 900; letter-spacing: .22em; text-transform: uppercase; color: var(--subtle); }
.dice-phase.rolling span { color: #38bdf8; }
.dice-phase.countdown span { color: var(--muted); }
.dice-phase b { font-size: 34px; line-height: 1; font-weight: 900; color: #38bdf8; text-shadow: 0 0 18px rgba(56, 189, 248, .5); animation: cdPop .3s ease-out; }
@keyframes cdPop { from { transform: scale(1.4); opacity: .3; } }
.dice-win-pill { justify-self: center; margin-top: 8px; padding: 7px 18px; border-radius: 999px; font-size: 13px; font-weight: 900; color: #fff;
  background: var(--pill, var(--accent)); box-shadow: 0 8px 20px -8px var(--pill, var(--accent)); }
.dice-win-pill[hidden] { display: none; }
.dice-win-pill.show { animation: pillIn .35s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes pillIn { from { opacity: 0; transform: translateY(6px) scale(.9); } }
@media (prefers-reduced-motion: reduce) {
  #arenaDice .die.blank.wobble { animation-duration: .5s !important; animation-iteration-count: infinite !important; }
  .die.pop { animation-duration: .34s !important; }
  .dice-win-pill.show { animation-duration: .35s !important; }
}

/* ===== Header zones: centered wallet ===== */
.site-header { gap: 10px; }
.header-left { flex: 1 1 0; display: flex; align-items: center; gap: 14px; min-width: 0; }
.header-center { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.header-right { margin-left: 0; flex: 1 1 0; justify-content: flex-end; }

/* ===== Rank chip + dropdown ===== */
.rank-chip-wrap { position: relative; }
.rank-chip { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border-radius: var(--r-sm); background: var(--input); border: 1px solid var(--line-strong); font-weight: 800; font-size: 13px; }
.rank-chip:hover { background: var(--hover); }
.rank-chip-badge { display: flex; }
.rank-chip .chevron { width: 15px; height: 15px; }
.rank-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 300px; max-height: 72vh; overflow: auto; padding: 12px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line-strong); box-shadow: 0 18px 40px rgba(0,0,0,.45); z-index: 60; }
.rank-menu-card { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-sm); background: var(--input); margin-bottom: 10px; }
.rank-menu-badge { display: flex; flex: none; }
.rank-menu-card-meta { display: grid; line-height: 1.3; }
.rank-menu-card-meta strong { font-size: 15px; }
.rank-menu-card-meta span { color: var(--muted); font-size: 12px; }
.rank-menu-stat { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.rank-menu-stat span { color: var(--muted); font-weight: 600; }
.rank-menu-prog { margin-bottom: 12px; }
.rank-menu-prog-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.rank-prog-track { height: 8px; border-radius: 999px; background: var(--input); overflow: hidden; }
.rank-prog-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #ff7a86); transition: width .4s ease; }
.rank-menu-prog-sub { font-size: 11px; color: var(--muted); margin-top: 5px; text-align: right; }
.rank-ladder-title { font-size: 11px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 4px 0 8px; }
.rank-ladder { display: flex; flex-direction: column; gap: 4px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); text-align: left; width: 100%; background: transparent; border: 1px solid transparent; }
.rank-row:hover:not(.locked) { background: var(--hover); }
.rank-row.active { background: rgba(242,56,74,.14); border-color: rgba(242,56,74,.4); }
.rank-row-badge { display: flex; flex: none; }
.rank-row-meta { display: grid; flex: 1; line-height: 1.25; min-width: 0; }
.rank-row-meta strong { font-size: 13px; }
.rank-row-meta small { color: var(--muted); font-size: 11px; }
.rank-row-action { font-size: 11px; font-weight: 800; color: var(--accent-hi); flex: none; display: flex; align-items: center; }
.rank-row.active .rank-row-action { color: var(--win); }
.rank-row.locked { opacity: .5; cursor: not-allowed; }
.rank-row.locked .rank-row-action { color: var(--muted); }
.rank-badge { display: block; flex: none; }

/* ===== Chat rank badge ===== */
.chat-rank-badge { display: inline-flex; flex: none; }

/* ===== Recent Wins table ===== */
.recent-wins { padding: 0; overflow: hidden; }
.recent-wins-head, .rw-row { display: grid; grid-template-columns: 2fr 1.1fr 1.3fr .9fr 1.3fr; align-items: center; gap: 10px; padding: 10px 14px; }
.recent-wins-head { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.recent-wins-body .rw-row { border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.recent-wins-body .rw-row:last-child { border-bottom: none; }
.rw-user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rw-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--card-2); flex: none; }
.rw-rankbadge { display: inline-flex; flex: none; }
.rw-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-game { color: var(--muted); }
.rw-bet, .rw-payout, .rw-mult { font-variant-numeric: tabular-nums; }
.rw-mult { color: var(--muted); }
.rw-payout { color: var(--win); text-align: right; }
.rw-row.rw-new { animation: rwIn .6s ease; }
@keyframes rwIn { from { background: rgba(242,56,74,.18); } to { background: transparent; } }
.recent-wins-empty { padding: 24px 14px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; }

@media (max-width: 760px) {
  .rank-chip-text { display: none; }
  .rank-chip { padding: 0 8px; }
}
@media (max-width: 560px) {
  .header-center { flex: 1 1 auto; }
  .recent-wins-head, .rw-row { grid-template-columns: 1.6fr 1.2fr 1.1fr; }
  .rw-game, .rw-mult { display: none; }
  .rank-menu { width: min(300px, calc(100vw - 24px)); }
}

/* ===== Create & Earn (referrals) ===== */
.ref-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.ref-step { display: flex; gap: 12px; align-items: flex-start; }
.ref-step > b { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(242, 56, 74, .18); color: var(--accent-hi); font-weight: 900; }
.ref-step span { display: grid; gap: 3px; }
.ref-step strong { font-size: 14px; }
.ref-step small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.ref-code { letter-spacing: .04em; }
.ref-of { font-size: 15px; color: var(--muted); font-weight: 700; }
.ref-meter { height: 8px; border-radius: 999px; background: var(--input); overflow: hidden; margin-top: 4px; }
.ref-meter i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #ff7a86); transition: width .4s ease; }
.aff-card .hint b { color: var(--text); }
.ref-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-bottom: 16px; align-items: start; }
.ref-grid h3 { font-size: 15px; margin-bottom: 10px; }
.ref-list { display: grid; gap: 6px; }
.ref-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r); background: var(--input); border: 1px solid var(--line); }
.ref-row img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--card-2); flex: none; }
.ref-row-main { display: grid; gap: 3px; flex: 1; min-width: 0; }
.ref-row-main strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-row-main small { color: var(--muted); font-size: 11px; }
.ref-row-main .ref-paid { color: var(--win); font-weight: 700; }
.ref-prog { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.ref-prog i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.ref-state { flex: none; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.ref-state.pending { background: rgba(242, 56, 74, .16); color: var(--accent-hi); }
.ref-state.paid { background: rgba(52, 215, 123, .15); color: var(--win); }
.ref-slot { border-style: dashed; background: transparent; opacity: .75; }
.ref-slot-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .14); flex: none; }
.ref-empty { color: var(--muted); font-size: 13px; padding: 14px 4px; }
.ref-redeem-panel .hint { margin-bottom: 10px; }
.ref-redeem-form { display: flex; gap: 8px; }
.ref-redeem-form input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: var(--r-sm); background: var(--input); border: 1px solid var(--line-strong); color: var(--text); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ref-redeem-form input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ref-used { display: grid; gap: 4px; padding: 12px; border-radius: var(--r); background: rgba(52, 215, 123, .08); border: 1px solid rgba(52, 215, 123, .25); font-size: 13px; }
.ref-used small { color: var(--muted); }
.ref-used[hidden], .ref-redeem-form[hidden] { display: none; }
@media (max-width: 900px) {
  .ref-steps, .ref-grid { grid-template-columns: 1fr; }
}

/* ===== Owner giveaway options ===== */
.ga-owner { display: grid; gap: 14px; padding: 12px; border-radius: var(--r); background: rgba(245, 196, 81, .05); border: 1px solid rgba(245, 196, 81, .2); }
.ga-owner[hidden] { display: none; }
.ga-mode-seg { width: 100%; }
.ga-mode-seg button { flex: 1; height: 34px; }
.ga-opt { font-style: normal; font-weight: 600; color: var(--muted); opacity: .8; margin-left: 4px; }
.ga-reqs { display: grid; gap: 6px; }
.ga-req { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--input); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.ga-req input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.ga-req label { color: var(--text); font-weight: 700; cursor: pointer; }
.ga-req .ga-num { width: 64px; height: 30px; padding: 0 8px; border-radius: 5px; background: var(--card); border: 1px solid var(--line-strong); color: var(--text); font-weight: 700; }
.ga-req .ga-amt { width: 84px; }
.ga-req:has(input[type=checkbox]:checked) { border-color: rgba(242, 56, 74, .5); }

/* giveaway cards */
.ga-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ga-mode-tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--muted); }
.ga-mode-tag.wheel { background: rgba(242, 56, 74, .18); color: var(--accent-hi); }
.ga-live-tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(255, 90, 118, .16); color: var(--loss); animation: liveBlink 1.4s ease-in-out infinite; }
@keyframes liveBlink { 50% { opacity: .55; } }
.ga-req-list { display: flex; flex-wrap: wrap; gap: 4px; }
.ga-req-list span { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: rgba(245, 196, 81, .12); color: var(--gold); }

/* ===== Live giveaway wheel ===== */
.wheel-card { width: min(900px, 100%); }
.wheel-body { display: grid; grid-template-columns: 1fr 240px; gap: 16px; align-items: start; }
.wheel-main { display: grid; gap: 12px; justify-items: center; }
.wheel-stage { position: relative; width: min(460px, 100%); aspect-ratio: 1; }
.wheel-stage canvas { width: 100%; height: 100%; display: block; border-radius: 50%; box-shadow: 0 0 0 6px #14161f, 0 20px 50px -15px rgba(0, 0, 0, .8); }
.wheel-pointer { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid var(--gold); filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); z-index: 2; }
.wheel-hub { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 84px; height: 84px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: var(--panel); border: 4px solid #282c3d; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
.wheel-hub b { font-size: 24px; font-weight: 900; line-height: 1; }
.wheel-hub small { font-size: 11px; color: var(--muted); font-weight: 700; }
.wheel-status { min-height: 28px; font-size: 16px; font-weight: 800; text-align: center; }
.wheel-win { color: var(--gold); font-size: 20px; }
.wheel-side { display: grid; gap: 12px; max-height: 520px; overflow: hidden; }
.wheel-col { display: grid; gap: 6px; min-height: 0; }
.wheel-col h4 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.wheel-col h4 b { color: var(--text); }
.wheel-names { display: flex; flex-wrap: wrap; gap: 5px; max-height: 220px; overflow-y: auto; }
.wheel-name { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: var(--input); font-size: 12px; font-weight: 700; }
.wheel-name i { width: 8px; height: 8px; border-radius: 50%; }
.wheel-name.me { outline: 2px solid var(--accent); }
.wheel-names.out .wheel-name { color: var(--muted); text-decoration: line-through; }
.wheel-name em { font-style: normal; font-size: 10px; color: var(--loss); text-decoration: none; }
.wheel-empty { color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .wheel-body { grid-template-columns: 1fr; }
  .wheel-side { max-height: none; }
}

/* ===== Leaderboard: podium + top 5 + your position ===== */
#leaderboardView { --lb-gold: #f5c451; --lb-silver: #c9d4e2; --lb-bronze: #e0915a; max-width: 920px; margin: 0 auto; width: 100%; }
.lb-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 8px; background: radial-gradient(120% 140% at 0% 0%, rgba(245, 196, 81, .12), transparent 55%), linear-gradient(180deg, rgba(242, 56, 74, .10), transparent), var(--card); }
.lb-hero .view-title { margin: 0; }
.lb-hero .view-sub { margin: 2px 0 0; }
.lb-hero-icon { width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: 14px; color: var(--lb-gold); background: rgba(245, 196, 81, .12); border: 1px solid rgba(245, 196, 81, .3); box-shadow: 0 0 30px -6px rgba(245, 196, 81, .5); }
.lb-hero-icon svg { width: 30px; height: 30px; }
.lb-kicker { font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--lb-gold); }

.lb-podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; padding: 26px 6% 0; margin-bottom: 16px; }
.lb-pod { --c: var(--lb-silver); display: grid; justify-items: center; animation: lbRise .5s cubic-bezier(.2, .9, .3, 1) both; animation-delay: calc(var(--i, 0) * 90ms); }
.lb-pod-gold { --c: var(--lb-gold); }
.lb-pod-bronze { --c: var(--lb-bronze); }
@keyframes lbRise { from { opacity: 0; transform: translateY(16px); } }
.lb-pod-user { position: relative; display: grid; justify-items: center; gap: 6px; padding-bottom: 12px; cursor: pointer; min-width: 0; max-width: 100%; }
.lb-pod-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--card-2); border: 3px solid var(--c); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 18%, transparent), 0 10px 30px -10px var(--c); display: block; }
.lb-pod-gold .lb-pod-avatar { width: 92px; height: 92px; }
.lb-crown { color: var(--lb-gold); width: 28px; height: 28px; filter: drop-shadow(0 2px 8px rgba(245, 196, 81, .6)); margin-bottom: -2px; }
.lb-crown svg { width: 100%; height: 100%; }
.lb-pod-name { font-weight: 900; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-pod-gold .lb-pod-name { color: var(--lb-gold); font-size: 15px; }
.lb-pod-user:hover .lb-pod-name { text-decoration: underline; }
.lb-pod-block { width: 100%; height: 92px; display: grid; place-items: center; border-radius: 12px 12px 0 0; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 32%, #14161f), #101219 85%); border-top: 4px solid var(--c); }
.lb-pod-gold .lb-pod-block { height: 120px; }
.lb-pod-block b { font-size: 40px; font-weight: 900; color: var(--c); text-shadow: 0 4px 18px color-mix(in srgb, var(--c) 50%, transparent); }
.lb-pod-card { width: 100%; display: grid; justify-items: center; gap: 4px; padding: 14px 8px; margin-top: 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.lb-pod-trophy { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.lb-pod-trophy svg { width: 18px; height: 18px; }
.lb-pod-card strong { display: inline-flex; align-items: center; gap: 5px; font-size: 17px; font-weight: 900; }
.lb-pod-card strong .gem-icon { width: 14px; height: 14px; }
.lb-pod-card small { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lb-pod.empty { opacity: .45; }
.lb-pod.empty .lb-pod-avatar { border-style: dashed; box-shadow: none; }
.lb-pod.is-me .lb-pod-card { border-color: var(--accent); }
.lb-lvl { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(242, 56, 74, .16); color: var(--accent-hi); flex: none; }

.lb-list-panel { padding: 14px; margin-bottom: 12px; }
.lb-list-head, .lb-row { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 12px; }
.lb-list-head { padding: 0 14px 8px; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lb-list-head span:last-child { text-align: right; }
.lb-list { display: grid; gap: 6px; }
.lb-row { --c: transparent; padding: 10px 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--c); animation: lbRise .4s ease both; animation-delay: calc(var(--i, 0) * 50ms); }
.lb-row-gold { --c: var(--lb-gold); background: linear-gradient(90deg, rgba(245, 196, 81, .10), transparent 60%), var(--card-2); }
.lb-row-silver { --c: var(--lb-silver); background: linear-gradient(90deg, rgba(201, 212, 226, .08), transparent 60%), var(--card-2); }
.lb-row-bronze { --c: var(--lb-bronze); background: linear-gradient(90deg, rgba(224, 145, 90, .09), transparent 60%), var(--card-2); }
.lb-row.is-me { border-color: var(--accent); }
.lb-rank { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; color: var(--muted); font-size: 14px; }
.lb-row-gold .lb-rank, .lb-row-silver .lb-rank, .lb-row-bronze .lb-rank { color: var(--c); }
.lb-mini-trophy { width: 16px; height: 16px; display: inline-grid; }
.lb-mini-trophy svg { width: 16px; height: 16px; }
.lb-player { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; font-weight: 800; }
.lb-player img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; background: var(--card); border: 2px solid var(--c, var(--line-strong)); }
.lb-row:not([class*="lb-row-"]) .lb-player img { border-color: var(--line-strong); }
.lb-player .leaderboard-player { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-player:hover .leaderboard-player { color: var(--accent-hi); }
.lb-amount { display: inline-flex; align-items: center; gap: 5px; justify-self: end; padding: 5px 10px; border-radius: 999px; font-weight: 900; font-size: 13px; color: #67e8f9; background: rgba(103, 232, 249, .08); border: 1px solid rgba(103, 232, 249, .18); white-space: nowrap; }
.lb-amount .gem-icon { width: 13px; height: 13px; }
.lb-empty { padding: 30px 10px; text-align: center; color: var(--muted); }

.lb-me { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: linear-gradient(90deg, rgba(242, 56, 74, .28), rgba(242, 56, 74, .10)), var(--panel); border: 1px solid rgba(242, 56, 74, .55); box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .8), 0 0 30px -10px rgba(242, 56, 74, .6); }
.lb-me[hidden] { display: none; }
.lb-me-rank { min-width: 64px; font-size: 22px; font-weight: 900; color: #fff; }
.lb-me img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); flex: none; }
.lb-me-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.lb-me-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-me-text em { font-style: normal; font-size: 10px; font-weight: 900; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: #fff; vertical-align: 2px; margin-left: 4px; }
.lb-me-text small { color: var(--muted); font-size: 12px; }

@media (max-width: 640px) {
  .lb-podium { padding: 18px 0 0; gap: 8px; }
  .lb-pod-avatar { width: 54px; height: 54px; }
  .lb-pod-gold .lb-pod-avatar { width: 68px; height: 68px; }
  .lb-pod-block { height: 64px; }
  .lb-pod-gold .lb-pod-block { height: 84px; }
  .lb-pod-block b { font-size: 28px; }
  .lb-pod-card strong { font-size: 13px; }
  .lb-pod .lb-lvl { display: none; }
  .lb-list-head, .lb-row { grid-template-columns: 50px 1fr auto; gap: 8px; }
  .lb-row .lb-lvl { display: none; }
  .lb-me-rank { min-width: 0; font-size: 18px; }
}

.lb-pod-name.leaderboard-player { display: block; font-weight: 900; }
.lb-me { margin-bottom: 8px; }

/* ===== Dice match: 3-2-1 countdown ===== */
.dice-count { display: grid; place-items: center; width: 100%; min-height: 64px; }
.dice-count b { font-size: 60px; line-height: 1; font-weight: 900; color: #fff; text-shadow: 0 0 24px rgba(242, 56, 74, .9), 0 4px 0 rgba(0, 0, 0, .35); animation: diceCountPop .55s cubic-bezier(.2, 1.4, .4, 1) both; }
.dice-count.go b { color: var(--win); text-shadow: 0 0 24px rgba(52, 215, 123, .8), 0 4px 0 rgba(0, 0, 0, .35); }
@keyframes diceCountPop { 0% { transform: scale(1.8); opacity: 0; } 60% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1); } }
.dice-phase.final span { color: var(--text); letter-spacing: .12em; }

/* ===== Giveaway banner: Bloxy icon + arrows ===== */
.banner-pet.is-bloxy { background: linear-gradient(160deg, #353b53, #212433); border: 1px solid rgba(255, 90, 104, .35); }
.banner-pet.is-bloxy img { width: 78%; height: 78%; object-fit: contain; }
.banner-arrow { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #feebed; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); transition: background .15s, transform .15s; }
.banner-arrow:hover { background: rgba(255, 255, 255, .16); transform: scale(1.06); }
.banner-arrow svg { width: 16px; height: 16px; }
.banner-arrow[hidden] { display: none; }
.banner-kicker em { font-style: normal; margin-left: 8px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #feebed; letter-spacing: .04em; }
.banner-kicker em[hidden] { display: none; }
.banner-text.slide-l { animation: bannerSlideL .3s ease-out; }
.banner-text.slide-r { animation: bannerSlideR .3s ease-out; }
@keyframes bannerSlideL { from { opacity: 0; transform: translateX(14px); } }
@keyframes bannerSlideR { from { opacity: 0; transform: translateX(-14px); } }
.ga-bloxy-art { width: 84px; height: 84px; filter: drop-shadow(0 10px 24px rgba(242, 56, 74, .45)); }
@media (max-width: 760px) {
  .banner-arrow { width: 28px; height: 28px; }
}

/* ===== ROGEMS: paused features ===== */
.home-game-tag.tag-maint { background: rgba(245, 196, 81, .14); color: var(--gold); }
.nav-item[data-maint] { position: relative; }
.nav-item[data-maint]::after { content: ""; position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--panel); }
#maintView.active { display: grid; place-items: center; min-height: 60vh; }
.maint-card { width: min(460px, 100%); text-align: center; padding: 40px 28px 32px; border-radius: 20px; background: var(--card); border: 1px solid var(--line-strong); box-shadow: 0 30px 80px -40px rgba(242, 56, 74, .6); }
.maint-icon { width: 96px; height: 96px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(255, 90, 104, .25), rgba(242, 56, 74, .05) 65%, transparent 70%); }
.maint-icon svg { width: 54px; height: 54px; color: var(--accent-hi); }
.maint-kicker { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.maint-title { margin: 6px 0 10px; font-size: 26px; text-wrap: balance; }
.maint-text { color: var(--muted); line-height: 1.55; margin: 0 auto 22px; max-width: 360px; }

/* ===================== ROGEMS home ===================== */
.nav-header { display: flex; align-items: center; gap: 6px; }
.nav-head-ic { width: 12px; height: 12px; flex: none; color: var(--accent); }
body.nav-expanded .sidebar-left .nav-group { background: color-mix(in srgb, var(--card) 55%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px 6px; margin-bottom: 8px; }
body.nav-expanded .sidebar-left .nav-group + .nav-group { border-top: 1px solid var(--line); }

#homeView { display: none; }
#homeView.active { display: flex; flex-direction: column; gap: 16px; }

/* live feed strip */
.rh-feed { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.rh-feed-label { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rh-feed-label i, .rh-live i, .rh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(242, 56, 74, .6); animation: rhPulse 1.6s infinite; display: inline-block; }
@keyframes rhPulse { 70% { box-shadow: 0 0 0 7px rgba(242, 56, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(242, 56, 74, 0); } }
.rh-feed-track { flex: 1; min-width: 0; display: flex; gap: 8px; overflow: hidden; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
.rh-feed-empty { align-self: center; color: var(--subtle); font-size: 12px; padding-left: 4px; }
.rh-chip { flex: none; display: flex; align-items: center; gap: 9px; min-width: 132px; padding: 8px 12px 8px 9px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); border-bottom: 2px solid var(--win); }
.rh-chip.lost { border-bottom-color: var(--accent); }
.rh-chip.rh-new { animation: rhIn .45s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes rhIn { from { opacity: 0; transform: translateX(-16px) scale(.96); } }
.rh-chip-ic { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(242, 56, 74, .14); color: var(--accent-hi); }
.rh-chip-ic svg { width: 16px; height: 16px; }
.rh-chip-txt { display: grid; line-height: 1.15; font-size: 11px; }
.rh-chip-txt b { font-size: 11px; }
.rh-chip-amt { font-weight: 800; color: var(--win); font-size: 12px; }
.rh-chip.lost .rh-chip-amt { color: var(--accent-hi); }
.rh-chip-txt small { color: var(--subtle); text-transform: uppercase; font-size: 9.5px; letter-spacing: .04em; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* welcome */
.rh-welcome { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 26px 28px; border-radius: 16px; border: 1px solid var(--line-strong);
  background: radial-gradient(600px 260px at 100% 0%, rgba(242, 56, 74, .28), transparent 65%), radial-gradient(500px 240px at 0% 100%, rgba(242, 56, 74, .08), transparent 60%), var(--card); }
.rh-welcome::after { content: ""; position: absolute; right: -40px; top: -40px; width: 240px; height: 240px; background: url(/favicon.svg) center/contain no-repeat; opacity: .07; transform: rotate(12deg); pointer-events: none; }
.rh-me { display: flex; align-items: center; gap: 16px; min-width: 0; }
.rh-me-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--input); border: 3px solid var(--accent); box-shadow: 0 0 0 4px rgba(242, 56, 74, .15); flex: none; }
.rh-me-info { display: grid; gap: 5px; min-width: 0; }
.rh-me-name { font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; color: var(--accent-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-me-level { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rh-me-prog { display: flex; align-items: center; gap: 8px; }
.rh-me-prog[hidden] { display: none; }
.rh-rank { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--input); border: 1px solid var(--line-strong); }
.rh-bar { width: min(220px, 40vw); height: 12px; border-radius: 99px; background: var(--input); border: 1px solid var(--line-strong); overflow: hidden; }
.rh-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--gold)); transition: width .6s ease; }
.rh-me-ranks { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); }
.rh-hello { display: grid; justify-items: end; gap: 6px; text-align: right; position: relative; z-index: 1; }
.rh-hello-kicker { font-size: 13px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.rh-hello-title { font-size: clamp(30px, 4vw, 44px); font-weight: 900; line-height: 1; letter-spacing: .02em; background: linear-gradient(180deg, #fff 30%, #ffb3ba); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rh-hello-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 6px; }
.rh-discord-btn { display: inline-flex; align-items: center; gap: 8px; background: #5865f2; color: #fff; text-decoration: none; }
.rh-discord-btn:hover { background: #4752c4; }
.rh-hello-status { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.rh-hello-status b { color: var(--text); }
.rh-sep { color: var(--subtle); }

/* stats */
.rh-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 14px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.rh-stat { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 10px; }
.rh-stat + .rh-stat { border-left: 1px solid var(--line); }
.rh-stat-ic { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(242, 56, 74, .14); color: var(--accent-hi); flex: none; }
.rh-stat-ic svg, .rh-stat-ic img { width: 20px; height: 20px; }
.rh-stat strong { display: block; font-size: 20px; font-weight: 900; line-height: 1.1; }
.rh-stat small { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* games */
.rh-section { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 -4px; font-size: 16px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.rh-section svg { width: 16px; height: 16px; color: var(--accent); align-self: center; }
.rh-section small { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.rh-section-flat { margin: 0; }
.rh-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rh-game { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 250px; padding: 16px 14px 18px; border-radius: 16px; overflow: hidden; text-align: center;
  background: radial-gradient(260px 180px at 50% 42%, rgba(242, 56, 74, .16), transparent 70%), linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line-strong);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.rh-game:hover { transform: translateY(-4px); border-color: rgba(242, 56, 74, .55); box-shadow: 0 18px 40px -22px rgba(242, 56, 74, .7); }
.rh-art { flex: 1; width: 100%; display: grid; place-items: center; min-height: 0; }
.rh-art img { max-width: 92%; max-height: 170px; transition: transform .35s cubic-bezier(.2, .9, .3, 1.3); filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .45)); }
.rh-game:hover .rh-art img { transform: scale(1.06) rotate(-2deg); }
.rh-art-coins { position: relative; }
.rh-art-coins img { position: absolute; width: 112px; height: 112px; top: 50%; }
.rh-art-coins img:first-child { left: calc(50% - 98px); transform: translateY(-50%) rotate(-10deg); z-index: 1; }
.rh-art-coins img:last-child { left: calc(50% - 22px); transform: translateY(-46%) rotate(8deg); z-index: 2; }
.rh-game:hover .rh-art-coins img:first-child { transform: translateY(-56%) rotate(-16deg); }
.rh-game:hover .rh-art-coins img:last-child { transform: translateY(-40%) rotate(14deg); }
.rh-game-name { font-size: 14px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.rh-game.is-maint .rh-art img { filter: grayscale(.65) brightness(.75) drop-shadow(0 14px 22px rgba(0, 0, 0, .45)); }
.rh-maint { position: absolute; top: 12px; right: 12px; z-index: 3; padding: 4px 9px; border-radius: 99px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: rgba(245, 196, 81, .15); color: var(--gold); border: 1px solid rgba(245, 196, 81, .35); }

/* live bets */
.rh-bets-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.rh-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.rh-tab { padding: 7px 12px; border-radius: 7px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rh-tab:hover { color: var(--text); }
.rh-tab.active { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -8px rgba(242, 56, 74, .9); }
.rh-live { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 99px; background: rgba(52, 215, 123, .1); color: var(--win); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.rh-live i { background: var(--win); }
.rh-bets { display: grid; gap: 6px; }
.rh-bets-cols, .rh-bet { display: grid; grid-template-columns: minmax(110px, 1.1fr) minmax(0, 2fr) minmax(70px, .8fr) minmax(60px, .6fr) minmax(80px, .9fr); align-items: center; gap: 10px; padding: 0 14px; }
.rh-bets-cols { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); padding-bottom: 2px; }
.rh-r { text-align: right; }
.rh-bet { min-height: 46px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: 13px; }
.rh-bet:hover { background: var(--card-2); }
.rh-bet.rh-new { animation: rhIn .45s ease; }
.rh-bet-game { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-hi); }
.rh-bet-game svg { width: 17px; height: 17px; flex: none; }
.rh-bet-user { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.rh-bet-user img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; background: var(--input); flex: none; }
.rh-bet-badge { display: inline-flex; flex: none; }
.rh-bet-name { font-weight: 800; text-transform: uppercase; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-bet-wager { color: var(--muted); font-weight: 700; }
.rh-bet-mult { font-weight: 800; color: var(--win); }
.rh-bet.lost .rh-bet-mult { color: var(--accent-hi); }
.rh-bet-pay { font-weight: 900; color: var(--win); }
.rh-bet.lost .rh-bet-pay { color: var(--accent-hi); }
.rh-bets-empty { padding: 26px; text-align: center; color: var(--subtle); border-radius: 12px; border: 1px dashed var(--line-strong); }

@media (max-width: 760px) {
  .rh-welcome { padding: 20px; }
  .rh-hello { justify-items: start; text-align: left; }
  .rh-hello-actions { justify-content: flex-start; }
  .rh-welcome::after { width: 150px; height: 150px; right: -30px; top: -30px; }
  .rh-stat { flex-direction: column; gap: 6px; padding: 12px 6px; text-align: center; }
  .rh-stat-ic { display: none; }
  .rh-stat strong { font-size: 16px; }
  .rh-stat small { font-size: 9px; }
  .rh-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rh-game { height: 190px; }
  .rh-art-coins img { width: 80px; height: 80px; }
  .rh-art-coins img:first-child { left: calc(50% - 70px); }
  .rh-art-coins img:last-child { left: calc(50% - 14px); }
  .rh-bets-cols, .rh-bet { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr); }
  .rh-bets-cols span:nth-child(3), .rh-bets-cols span:nth-child(4), .rh-bet-wager, .rh-bet-mult { display: none; }
  .rh-bet-game svg { display: none; }
}

/* ---- ROGEMS home v2 ---- */
.rh-gamerow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 14px; }
.rh-group { display: grid; gap: 12px; align-content: start; min-width: 0; }
.rh-group .rh-section { margin: 4px 0 0; }
.rh-group .rh-games { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.rh-game { height: 290px; justify-content: flex-end; gap: 4px; }
.rh-art img { max-height: 180px; }
.rh-game-sub { font-size: 11.5px; color: var(--muted); line-height: 1.35; max-width: 200px; min-height: calc(2 * 1.35em); }
.rh-tag { position: absolute; top: 12px; left: 12px; z-index: 3; padding: 4px 9px; border-radius: 99px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: rgba(242, 56, 74, .14); color: var(--accent-hi); border: 1px solid rgba(242, 56, 74, .3); }
.rh-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rh-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: left; transition: border-color .2s ease, background .2s ease; }
.rh-link:hover { border-color: rgba(242, 56, 74, .5); background: var(--card-2); }
.rh-link-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; background: rgba(242, 56, 74, .14); color: var(--accent-hi); }
.rh-link-ic svg, .rh-link-ic img { width: 20px; height: 20px; }
.rh-link-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rh-link-txt strong { font-size: 14px; }
.rh-link-txt small { font-size: 12px; color: var(--muted); }
.rh-link-go { width: 18px; height: 18px; color: var(--subtle); flex: none; }
.rh-link:hover .rh-link-go { color: var(--accent-hi); }
/* stats: icon and text share one centre line */
.rh-stat { align-items: center; }
.rh-stat > div { display: flex; flex-direction: column; justify-content: center; height: 38px; gap: 3px; }
.rh-stat strong { font-size: 18px; line-height: 1; }
.rh-stat small { line-height: 1; }
.rh-welcome::after { background-image: url(/favicon.svg); transform: rotate(-10deg); }
@media (max-width: 1100px) { .rh-gamerow { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .rh-group .rh-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rh-game { height: 220px; }
  .rh-game-sub { display: none; }
  .rh-stat > div { height: auto; align-items: center; }
}

/* ===================== Chat giveaways ===================== */
.giveaway-banner { display: none !important; }
.cg { margin: 10px 12px 0; border-radius: 14px; background: linear-gradient(180deg, rgba(242, 56, 74, .10), rgba(242, 56, 74, .02) 60%), var(--card); border: 1px solid rgba(242, 56, 74, .35); box-shadow: 0 14px 30px -22px rgba(242, 56, 74, .8); overflow: hidden; flex: none; }
.cg-card { border-radius: 14px; background: linear-gradient(180deg, rgba(242, 56, 74, .10), rgba(242, 56, 74, .02) 60%), var(--card); border: 1px solid rgba(242, 56, 74, .35); overflow: hidden; }
.cg-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 12px; text-align: left; }
.cg-title { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.cg-title svg { width: 16px; height: 16px; color: var(--accent-hi); }
.cg-timer { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; background: var(--input); border: 1px solid var(--line-strong); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cg-timer svg { width: 12px; height: 12px; color: var(--muted); }
.cg-timer.live { background: var(--accent); border-color: var(--accent); color: #fff; animation: rhPulse 1.6s infinite; }
.cg-timer.live svg { color: #fff; }
.cg-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s ease; }
.cg.collapsed .cg-chev { transform: rotate(180deg); }
.cg-body { padding: 2px 12px 10px; display: grid; gap: 9px; }
.cg-prize { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cg-art { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--input); border: 1px solid var(--line-strong); overflow: hidden; }
.cg-art .pet-img, .cg-art .pet-img img { width: 40px; height: 40px; }
.cg-art-gems img { width: 28px; height: 28px; }
.cg-art-empty svg { width: 22px; height: 22px; color: var(--subtle); }
.cg-prize-txt { min-width: 0; flex: 1; display: grid; gap: 2px; }
.cg-prize-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cg-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-val { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 900; color: var(--gold); }
.cg-val img { width: 15px; height: 15px; }
.cg-prize-txt small { font-size: 11.5px; color: var(--muted); }
.cg-prize-txt small b { color: var(--accent-hi); }
.cg-reqs { display: flex; flex-wrap: wrap; gap: 5px; }
.cg-req { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 7px; background: var(--input); border: 1px solid var(--line-strong); font-size: 11px; font-weight: 800; color: var(--text); }
.cg-req svg { width: 11px; height: 11px; color: var(--subtle); }
.cg-req.ok svg { color: var(--win); }
.cg-req.no { border-color: rgba(242, 56, 74, .35); }
.cg-req.no svg { color: var(--accent-hi); }
.cg-actions { display: flex; gap: 6px; }
.cg-join { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 10px; background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: #fff; font-weight: 900; font-size: 13.5px; box-shadow: 0 8px 18px -10px rgba(242, 56, 74, .9), inset 0 -2px 0 rgba(0, 0, 0, .18); transition: transform .12s ease, filter .12s ease; }
.cg-join:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.cg-join:disabled { cursor: default; background: var(--input); color: var(--muted); box-shadow: none; border: 1px solid var(--line-strong); }
.cg-join.joined { color: var(--win); border-color: rgba(52, 215, 123, .35); }
.cg-join.joined svg { width: 14px; height: 14px; }
.cg-join.live { background: linear-gradient(180deg, #ffd34d, var(--gold)); color: #2a1a00; }
.cg-eye { width: 42px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--input); border: 1px solid var(--line-strong); color: var(--muted); }
.cg-eye svg { width: 17px; height: 17px; }
.cg-eye:hover, .cg-eye.active { color: var(--text); border-color: rgba(242, 56, 74, .5); }
.cg-winner { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(52, 215, 123, .1); border: 1px solid rgba(52, 215, 123, .3); font-size: 13px; }
.cg-winner img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.cg-winner b { color: var(--win); }
.cg-entrants { display: flex; flex-wrap: wrap; gap: 5px; max-height: 120px; overflow-y: auto; padding: 8px; border-radius: 10px; background: var(--input); border: 1px solid var(--line); }
.cg-ent { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px 3px 3px; border-radius: 99px; background: var(--card); border: 1px solid var(--line-strong); font-size: 11px; font-weight: 700; }
.cg-ent img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.cg-ent em { font-style: normal; color: var(--gold); font-weight: 900; }
.cg-ent.me { border-color: var(--accent); }
.cg-ent-empty { color: var(--subtle); font-size: 12px; }
.cg-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.cg-foot b { color: var(--text); }
.cg-pager { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--text); }
.cg-pager button { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.cg-pager button:hover { background: var(--input); color: var(--text); }
.cg-pager svg { width: 14px; height: 14px; }

/* gift button in the chat bar */
.chat-gift-btn { width: 42px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--input); border: 1px solid var(--line-strong); color: var(--accent-hi); transition: background .15s ease, color .15s ease; }
.chat-gift-btn svg { width: 19px; height: 19px; }
.chat-gift-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Host a giveaway */
#hostGaModal .hg-card { width: min(980px, calc(100vw - 24px)); padding: 0; }
.hg-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); position: relative; }
.hg-head-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent); color: #fff; box-shadow: 0 10px 20px -10px rgba(242, 56, 74, .9); }
.hg-head-ic svg { width: 22px; height: 22px; }
.hg-head-txt { flex: 1; min-width: 0; }
.hg-head-txt h3 { font-size: 18px; font-weight: 900; }
.hg-head-txt p { font-size: 12.5px; color: var(--muted); }
.hg-head .modal-close { position: static; }
.hg-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); min-height: 0; overflow: hidden; flex: 1; }
.hg-form { padding: 18px 20px; display: grid; gap: 12px; overflow-y: auto; align-content: start; }
.hg-step { padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 10px; }
.hg-step-head { display: flex; align-items: center; gap: 9px; }
.hg-step-head strong { font-size: 14.5px; font-weight: 900; }
.hg-step-head small { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.hg-num { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 900; }
.hg-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--input); border: 1px solid var(--line); }
.hg-seg button { height: 32px; border-radius: 7px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.hg-seg button:hover { color: var(--text); }
.hg-seg button.active { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -8px rgba(242, 56, 74, .9); }
.hg-seg-sm button { height: 30px; }
.hg-input { height: 38px; padding: 0 12px; border-radius: 10px; background: var(--input); border: 1px solid var(--line-strong); color: var(--text); min-width: 0; }
.hg-input:focus { outline: none; border-color: var(--accent); }
.hg-search { width: 100%; }
.hg-pets { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 7px; max-height: 210px; overflow-y: auto; padding: 2px; }
.hg-pet { display: grid; justify-items: center; gap: 3px; padding: 8px 6px; border-radius: 10px; background: var(--input); border: 1px solid var(--line-strong); text-align: center; }
.hg-pet:hover { border-color: rgba(242, 56, 74, .5); }
.hg-pet.active { border-color: var(--accent); background: rgba(242, 56, 74, .12); box-shadow: 0 0 0 1px var(--accent) inset; }
.hg-pet .pet-img, .hg-pet .pet-img img { width: 46px; height: 46px; }
.hg-pet-name { font-size: 10.5px; font-weight: 700; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-pet-val { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 900; color: var(--gold); }
.hg-pet-val img { width: 11px; height: 11px; }
.hg-empty { grid-column: 1 / -1; padding: 22px 10px; text-align: center; color: var(--subtle); font-size: 12.5px; }
.hg-gemrow { display: flex; gap: 6px; flex-wrap: wrap; }
.hg-gemrow .hg-input { flex: 1 1 140px; }
.hg-note { font-size: 11.5px; color: var(--muted); }
.hg-note b { color: var(--text); }
.hg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hg-chip { height: 32px; padding: 0 12px; border-radius: 8px; background: var(--input); border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 800; color: var(--text); }
.hg-chip:hover { border-color: rgba(242, 56, 74, .5); }
.hg-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.hg-custom { display: flex; align-items: center; gap: 8px; }
.hg-custom > span { font-size: 12px; color: var(--muted); }
.hg-custom .hg-input { width: 80px; }
.hg-custom .hg-seg { flex: 1; }
.hg-lvlrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hg-lvlrow .hg-chips { flex: 1; }
.hg-lvl { width: 80px; }
.hg-lock { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); line-height: 1.45; }
.hg-lock svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--subtle); }
.hg-lock b { color: var(--text); }
.hg-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hg-mode { display: grid; justify-items: start; gap: 4px; padding: 12px; border-radius: 12px; background: var(--input); border: 1px solid var(--line-strong); text-align: left; }
.hg-mode svg { width: 20px; height: 20px; color: var(--accent-hi); }
.hg-mode strong { font-size: 13px; font-weight: 900; }
.hg-mode small { font-size: 11px; color: var(--muted); line-height: 1.35; }
.hg-mode:hover { border-color: rgba(242, 56, 74, .5); }
.hg-mode.active { border-color: var(--accent); background: rgba(242, 56, 74, .12); box-shadow: 0 0 0 1px var(--accent) inset; }
.hg-speed { display: flex; align-items: center; gap: 10px; }
.hg-speed > span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.hg-speed .hg-seg { flex: 1; }
.hg-side { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; background: var(--page); border-left: 1px solid var(--line); overflow-y: auto; }
.hg-side-label { font-size: 10.5px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hg-preview .cg-head { cursor: default; }
.hg-preview .cg-join { pointer-events: none; }
.hg-preview .cg-body { padding-bottom: 12px; }
.hg-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.hg-facts b { color: var(--text); }
.hg-actions { margin-top: auto; display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.hg-actions .btn { height: 44px; }
@media (max-width: 820px) {
  .hg-body { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .hg-form { overflow: visible; }
  .hg-side { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .hg-modes { grid-template-columns: minmax(0, 1fr); }
  .hg-head-txt p { display: none; }
}

#wheelModal.mode-spin .wheel-side .wheel-col:last-child { display: none; }
#wheelModal.mode-spin .wheel-hub small { font-size: 0; }
#wheelModal.mode-spin .wheel-hub small::after { content: "players"; font-size: 11px; }

/* ---- Signed-in popup ---- */
.wpop { position: fixed; top: calc(76px + env(safe-area-inset-top, 0px)); left: 50%; z-index: 400; transform: translate(-50%, -14px) scale(.96); opacity: 0; pointer-events: none; transition: transform .38s cubic-bezier(.2, .9, .3, 1.15), opacity .25s ease; width: min(400px, calc(100vw - 24px)); }
.wpop.in { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.wpop.out { opacity: 0; transform: translate(-50%, -10px) scale(.97); transition-duration: .25s; }
.wpop-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 14px 40px 16px 14px; border-radius: 16px; background: radial-gradient(260px 120px at 0% 0%, rgba(242, 56, 74, .22), transparent 70%), var(--panel); border: 1px solid rgba(242, 56, 74, .45); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .02) inset; }
.wpop-av { position: relative; width: 56px; height: 56px; flex: none; }
.wpop-av img { position: absolute; inset: 5px; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--input); }
.wpop-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.wpop-ring circle { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 290; stroke-dashoffset: 290; }
.wpop.in .wpop-ring circle { animation: wpopRing .8s .1s cubic-bezier(.6, .1, .3, 1) forwards; }
@keyframes wpopRing { to { stroke-dashoffset: 0; } }
.wpop-check { position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--win); color: #fff; border: 3px solid var(--panel); transform: scale(0); }
.wpop-check svg { width: 12px; height: 12px; }
.wpop.in .wpop-check { animation: wpopPop .4s .75s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes wpopPop { to { transform: scale(1); } }
.wpop-txt { min-width: 0; display: grid; gap: 2px; }
.wpop-txt small { font-size: 10.5px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--win); }
.wpop-txt strong { font-size: 17px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wpop-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.wpop-rank { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; color: var(--text); }
.wpop-gems { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; color: var(--gold); }
.wpop-gems img { width: 14px; height: 14px; }
.wpop-txt em { font-style: normal; font-size: 11.5px; color: var(--subtle); margin-top: 2px; }
.wpop-txt > * { opacity: 0; transform: translateY(4px); }
.wpop.in .wpop-txt > * { animation: wpopUp .35s ease forwards; }
.wpop.in .wpop-txt > *:nth-child(2) { animation-delay: .08s; }
.wpop.in .wpop-txt > *:nth-child(3) { animation-delay: .16s; }
.wpop.in .wpop-txt > *:nth-child(4) { animation-delay: .24s; }
@keyframes wpopUp { to { opacity: 1; transform: none; } }
.wpop-x { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); }
.wpop-x:hover { background: var(--input); color: var(--text); }
.wpop-x svg { width: 14px; height: 14px; }
.wpop-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-hi)); transform-origin: left; }
.wpop.in .wpop-bar { animation: wpopBar 4.2s linear forwards; }
@keyframes wpopBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.wpop-flash { animation: wpopFlash 1s ease 2; }
@keyframes wpopFlash { 50% { box-shadow: 0 0 0 4px rgba(242, 56, 74, .35); } }
.copied { color: var(--win) !important; }
@media (prefers-reduced-motion: reduce) {
  .wpop, .wpop.in .wpop-ring circle, .wpop.in .wpop-check, .wpop.in .wpop-txt > *, .wpop.in .wpop-bar { animation-duration: .01s !important; transition-duration: .01s !important; }
}

/* admin shortcuts (only shown to the owner account) */
.admin-head-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; margin-right: 8px; border-radius: 10px; background: rgba(245, 196, 81, .12); border: 1px solid rgba(245, 196, 81, .4); color: var(--gold); font-weight: 800; font-size: 13px; text-decoration: none; white-space: nowrap; flex: none; }
.admin-head-btn svg { width: 17px; height: 17px; }
.admin-head-btn:hover { background: rgba(245, 196, 81, .2); }
.admin-head-btn[hidden], .nav-admin[hidden] { display: none !important; }
.nav-admin { color: var(--gold) !important; text-decoration: none; }
@media (max-width: 1400px) { .admin-head-btn span { display: none; } .admin-head-btn { padding: 0 10px; } }

/* duel result: you won / you lost + fee line */
.dice-win-pill.lose { color: #c9cdda; box-shadow: none; border: 1px solid var(--line-strong); }
.duel-fee-note { justify-self: center; margin-top: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; }
.duel-fee-note[hidden] { display: none; }
.flip-status.done { display: grid; justify-items: center; gap: 4px; }
.flip-out { display: inline-block; padding: 6px 16px; border-radius: 99px; font-weight: 900; color: #fff; background: var(--accent); }
.flip-out-win { background: var(--win); box-shadow: 0 8px 20px -10px var(--win); }
.flip-out-lose { background: #3a3f52; color: #c9cdda; }

/* duel create/join options: one centered line */
.duel-options { flex-wrap: nowrap; justify-content: center; align-items: flex-end; gap: 16px; padding: 14px 16px; }
.duel-options .opt-group { flex: none; }
.duel-actions { margin-left: 0; flex: none; }
.duel-actions .btn { white-space: nowrap; }
.duel-actions .btn[hidden] { display: none; }
#duelAutoBtn .icon-svg { width: 15px; height: 15px; color: var(--gold); }
.duel-options .tier-toggle { white-space: nowrap; }
@media (max-width: 1100px) { .duel-options { flex-wrap: wrap; } }
#createDuelModal .duel-modal { width: min(1180px, calc(100vw - 32px)); }
.duel-options { gap: 14px; }
.duel-options .color-picks { gap: 7px; }

/* ===================== Dice v2: clean BloxyGem-style roll ===================== */
.die {
  border-radius: 14px;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background-color .2s ease, box-shadow .25s ease, transform .25s ease;
}
.die::after { width: 16px; height: 16px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.die[class*="c-"] { box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .18), 0 12px 26px -14px currentColor; }
/* waiting / reset dice: slate grey with a soft grey dot */
.die.blank, #arenaDice .die.blank { background: #2b2f3c; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .05); animation: none; }
.die.blank::after { display: block; width: 15px; height: 15px; background: #8d93a5; box-shadow: none; }
#arenaDice .die.blank.reset { animation: dieReset .32s ease-out both; }
@keyframes dieReset { from { transform: scale(.9); opacity: .4; } to { transform: scale(1); opacity: 1; } }
/* reveal: grows from small, overshoots, settles */
#arenaDice .die.reveal { animation: dieReveal .5s cubic-bezier(.22, 1, .36, 1) both; transition: none; }
#arenaDice .die.reveal::after { animation: dotIn .5s ease-out both; }
@keyframes dieReveal {
  0% { transform: scale(.55); opacity: .85; }
  45% { transform: scale(1.16); opacity: 1; }
  70% { transform: scale(.97); }
  100% { transform: scale(1); }
}
@keyframes dotIn { 0% { transform: scale(.4); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }
/* round winner's dice lift a little */
.die.hit { transform: translateY(-5px); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .18), 0 16px 30px -12px currentColor; }
/* match won: a soft flash of the winner's color over the arena */
.arena { position: relative; }
.arena.arena-flash::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 80% at 50% 40%, color-mix(in srgb, var(--flash, var(--win)) 45%, transparent), transparent 75%);
  animation: arenaFlash 1.4s ease-out forwards; }
@keyframes arenaFlash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
.arena > * { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  #arenaDice .die.reveal, #arenaDice .die.reveal::after, #arenaDice .die.blank.reset { animation-duration: .5s !important; animation-iteration-count: 1 !important; }
}

/* ===================== Provably Fair window ===================== */
#fairModal .pf-card { width: min(980px, calc(100vw - 24px)); padding: 0; }
.pf-head { display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.pf-head-ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(242, 56, 74, .14); color: var(--accent-hi); border: 1px solid rgba(242, 56, 74, .3); }
.pf-head-ic svg { width: 24px; height: 24px; }
.pf-head-txt { flex: 1; min-width: 0; }
.pf-head-txt h3 { font-size: 20px; font-weight: 900; }
.pf-head-txt p { font-size: 13px; color: var(--muted); }
.pf-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 24px 0; border-bottom: 1px solid var(--line); }
.pf-games { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--input); border: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.pf-games button { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 800; color: var(--muted); }
.pf-games button svg { width: 16px; height: 16px; }
.pf-games button:hover { color: var(--text); }
.pf-games button.active { background: var(--card-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-strong) inset; }
.pf-games button.active svg { color: var(--accent-hi); }
.pf-views { display: flex; gap: 22px; }
.pf-views button { padding: 0 2px 13px; font-size: 14px; font-weight: 800; color: var(--muted); border-bottom: 2px solid transparent; }
.pf-views button.active { color: var(--text); border-color: var(--accent); }
.pf-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); min-height: 330px; }
.pf-body[hidden] { display: none; }
.pf-left { padding: 22px 24px; border-right: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.pf-right { padding: 22px 24px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.pf-label { font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pf-text { font-size: 13.5px; color: var(--text); line-height: 1.55; }
.pf-input { width: 100%; min-height: 150px; resize: vertical; padding: 12px; border-radius: 12px; background: var(--input); border: 1px solid var(--line-strong); color: var(--text); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.pf-input:focus { outline: none; border-color: var(--accent); }
.pf-input:disabled { opacity: .5; }
.pf-verify { height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; }
.pf-verify svg { width: 18px; height: 18px; }
.pf-tip { font-size: 11.5px; color: var(--subtle); line-height: 1.45; }
.pf-tip b { color: var(--muted); }
.pf-result { min-height: 106px; border-radius: 12px; border: 1px dashed var(--line-strong); padding: 14px; display: grid; gap: 10px; align-content: start; }
.pf-empty { display: grid; place-items: center; min-height: 76px; text-align: center; font-size: 13.5px; color: var(--muted); }
.pf-empty b { color: var(--text); }
.pf-verdict { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 7px 14px; border-radius: 99px; font-weight: 900; font-size: 14px; }
.pf-verdict svg { width: 16px; height: 16px; }
.pf-verdict.ok { background: rgba(52, 215, 123, .14); color: var(--win); }
.pf-verdict.bad { background: rgba(242, 56, 74, .14); color: var(--accent-hi); }
.pf-check { display: flex; gap: 10px; align-items: flex-start; }
.pf-check-ic { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.pf-check-ic svg { width: 12px; height: 12px; }
.pf-check.ok .pf-check-ic { background: rgba(52, 215, 123, .16); color: var(--win); }
.pf-check.bad .pf-check-ic { background: rgba(242, 56, 74, .16); color: var(--accent-hi); }
.pf-check strong { display: block; font-size: 13.5px; }
.pf-check small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.pf-check code { font-size: 11px; }
.pf-rolls { display: grid; gap: 5px; max-height: 180px; overflow-y: auto; }
.pf-roll { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 9px; background: var(--input); font-size: 12px; }
.pf-roll b { width: 28px; color: var(--muted); }
.pf-roll > span:last-child { margin-left: auto; font-weight: 800; color: var(--win); }
.pf-roll.bad > span:last-child { color: var(--accent-hi); }
.pf-dice { display: inline-flex; gap: 4px; }
.pf-dice .die-sq { width: 20px; height: 20px; border-radius: 5px; }
.pf-dice .die-sq::after { width: 5px; height: 5px; }
.pf-mines { display: grid; grid-template-columns: repeat(5, 26px); gap: 4px; }
.pf-mines i { width: 26px; height: 26px; border-radius: 6px; background: rgba(52, 215, 123, .18); }
.pf-mines i.mine { background: var(--accent); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .2); }
.pf-how { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.pf-how-text { padding: 22px 24px; border-right: 1px solid var(--line); font-size: 13.5px; line-height: 1.6; display: grid; gap: 10px; align-content: start; }
.pf-how-text pre { margin: 0; padding: 12px; border-radius: 10px; background: var(--input); border: 1px solid var(--line); font-size: 12px; white-space: pre-wrap; color: var(--accent-hi); }
.pf-how-text code { font-size: 12px; color: var(--accent-hi); }
.pf-how-side { padding: 22px 24px; display: grid; gap: 10px; align-content: start; }
.pf-how-side h4 { font-size: 13px; font-weight: 900; }
.pf-fees { width: 100%; border-collapse: collapse; font-size: 13px; }
.pf-fees th, .pf-fees td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pf-fees th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pf-fees td:last-child { font-weight: 900; color: var(--accent-hi); }
.pf-small { font-size: 12px; color: var(--muted); }
.pf-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.pf-steps > div { padding: 16px 24px; display: grid; gap: 4px; }
.pf-steps > div + div { border-left: 1px solid var(--line); }
.pf-steps strong { font-size: 13.5px; }
.pf-steps span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.seed-verify { margin-left: 2px; padding: 3px 10px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 900; }
.seed-verify:hover { filter: brightness(1.1); }
.mines-verify { margin-top: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.mines-verify[hidden] { display: none; }
@media (max-width: 760px) {
  .pf-body, .pf-how { grid-template-columns: minmax(0, 1fr); }
  .pf-left, .pf-how-text { border-right: 0; border-bottom: 1px solid var(--line); }
  .pf-steps { grid-template-columns: minmax(0, 1fr); }
  .pf-steps > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .pf-head-txt p { display: none; }
}

/* ===================== Rank picker (header) ===================== */
.rank-menu { width: 340px; padding: 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .85); display: grid; gap: 10px; transform-origin: top right; animation: rkIn .22s cubic-bezier(.2, .9, .3, 1.15); max-height: min(640px, calc(100vh - 90px)); overflow-y: auto; }
@keyframes rkIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.rk-top { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: radial-gradient(180px 90px at 0% 0%, color-mix(in srgb, var(--rk) 35%, transparent), transparent 70%), var(--card); border: 1px solid color-mix(in srgb, var(--rk) 35%, var(--line)); }
.rk-ring { position: relative; width: 56px; height: 56px; flex: none; display: grid; place-items: center; }
.rk-ring > svg:first-child { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.rk-ring circle { fill: none; stroke-width: 4; }
.rk-ring .t { stroke: var(--input); }
.rk-ring .f { stroke: var(--rk); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 4px var(--rk)); }
.rk-ring .rank-badge { filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--rk) 60%, transparent)); }
.rk-top-txt { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.rk-top-txt small, .rk-wag small { font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.rk-top-txt strong { font-size: 18px; font-weight: 900; }
.rk-top-txt span { font-size: 11.5px; color: var(--muted); }
.rk-wag { display: grid; justify-items: end; line-height: 1.2; }
.rk-wag b { font-size: 14px; font-weight: 900; }
.rk-next { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--input); font-size: 12px; color: var(--muted); }
.rk-next b { color: var(--text); }
.rk-next em { margin-left: auto; font-style: normal; font-weight: 800; color: var(--gold); white-space: nowrap; }
.rk-auto, .pr-auto { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-align: left; transition: border-color .2s ease, background .2s ease; }
.rk-auto:hover, .pr-auto:hover { border-color: var(--line-strong); }
.rk-auto.on, .pr-auto.on { border-color: rgba(242, 56, 74, .45); background: linear-gradient(90deg, rgba(242, 56, 74, .12), transparent), var(--card); }
.rk-auto-txt, .pr-auto > span:last-child { display: grid; line-height: 1.25; }
.rk-auto strong, .pr-auto strong { font-size: 13.5px; }
.rk-auto small, .pr-auto small { font-size: 11.5px; color: var(--muted); }
.pr-switch { position: relative; width: 38px; height: 22px; flex: none; border-radius: 99px; background: var(--input); border: 1px solid var(--line-strong); transition: background .25s ease, border-color .25s ease; }
.pr-switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #8d93a5; transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), background .25s ease; }
.on .pr-switch { background: var(--accent); border-color: var(--accent); }
.on .pr-switch i { transform: translateX(16px); background: #fff; }
.rk-label { font-size: 10.5px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 2px 2px 0; }
.rk-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.rk-tile { position: relative; display: grid; justify-items: center; gap: 3px; padding: 9px 2px 7px; border-radius: 11px; background: var(--card); border: 1px solid var(--line); text-align: center; animation: rkTile .35s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--i) * 25ms); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
@keyframes rkTile { from { opacity: 0; transform: translateY(6px) scale(.92); } }
.rk-tile:hover:not(:disabled) { transform: translateY(-2px); border-color: color-mix(in srgb, var(--rk) 60%, transparent); background: color-mix(in srgb, var(--rk) 10%, var(--card)); }
.rk-tile strong { font-size: 10.5px; font-weight: 800; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-tile small { font-size: 9.5px; color: var(--subtle); font-weight: 700; }
.rk-tile.on { border-color: var(--rk); background: color-mix(in srgb, var(--rk) 16%, var(--card)); box-shadow: 0 0 0 1px var(--rk) inset, 0 8px 20px -12px var(--rk); }
.rk-tile.on small { color: var(--text); }
.rk-tile-badge { position: relative; display: grid; place-items: center; }
.rk-tile.locked { cursor: not-allowed; }
.rk-tile.locked .rank-badge { filter: grayscale(1) brightness(.55); }
.rk-tile.locked strong { color: var(--subtle); }
.rk-lock, .pr-rk-lock { position: absolute; right: -5px; bottom: -4px; width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: var(--panel); border: 1px solid var(--line-strong); color: var(--muted); }
.rk-lock svg, .pr-rk-lock svg { width: 10px; height: 10px; }
.rk-profile { display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 10px; background: var(--input); border: 1px solid var(--line-strong); font-weight: 800; font-size: 13px; }
.rk-profile svg { width: 15px; height: 15px; transition: transform .2s ease; }
.rk-profile:hover { border-color: rgba(242, 56, 74, .5); }
.rk-profile:hover svg { transform: translateX(3px); }

/* ===================== Profile page ===================== */
.pr { display: grid; gap: 16px; max-width: 1200px; margin: 0 auto; width: 100%; }
.pr.pr-in > * { animation: prUp .55s cubic-bezier(.2, .8, .2, 1) both; }
.pr.pr-in > *:nth-child(2) { animation-delay: .07s; }
.pr.pr-in > *:nth-child(3) { animation-delay: .12s; }
.pr.pr-in > *:nth-child(4) { animation-delay: .16s; }
@keyframes prUp { from { opacity: 0; transform: translateY(14px); } }

.pr-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(220px, 280px); align-items: center; gap: 26px; padding: 30px; border-radius: 22px; border: 1px solid color-mix(in srgb, var(--rk) 35%, var(--line)); background: var(--card); isolation: isolate; }
.pr-hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.pr-hero-bg i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: prBlob 14s ease-in-out infinite alternate; }
.pr-hero-bg i:nth-child(1) { width: 380px; height: 380px; left: -120px; top: -180px; background: var(--rk); }
.pr-hero-bg i:nth-child(2) { width: 320px; height: 320px; right: 18%; bottom: -220px; background: var(--accent); animation-duration: 18s; animation-delay: -6s; }
.pr-hero-bg i:nth-child(3) { width: 220px; height: 220px; right: -60px; top: -80px; background: color-mix(in srgb, var(--rk) 60%, #fff); opacity: .25; animation-duration: 11s; }
@keyframes prBlob { to { transform: translate(50px, 30px) scale(1.15); } }
.pr-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .06) 45%, transparent 55%); transform: translateX(-100%); animation: prSweep 6s ease-in-out 1s infinite; }
@keyframes prSweep { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.pr-hero-mark { position: absolute; right: -40px; bottom: -70px; opacity: .07; transform: rotate(-14deg); }

.pr-av { position: relative; width: 150px; height: 150px; flex: none; }
.pr-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pr-ring circle { fill: none; stroke-width: 7; }
.pr-ring-track { stroke: rgba(255, 255, 255, .07); }
.pr-ring-fill { stroke: var(--rk); stroke-linecap: round; stroke-dashoffset: 440; filter: drop-shadow(0 0 6px var(--rk)); animation: prRing 1.4s .25s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes prRing { to { stroke-dashoffset: var(--to); } }
.pr-av img { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); border-radius: 50%; object-fit: cover; background: var(--input); box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .7); }
.pr-lv { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); display: inline-flex; align-items: baseline; gap: 3px; padding: 4px 12px; border-radius: 99px; background: var(--rk); color: #fff; font-weight: 900; font-size: 16px; box-shadow: 0 8px 18px -6px var(--rk), 0 0 0 3px var(--card); white-space: nowrap; }
.pr-lv small { font-size: 10px; opacity: .85; }

.pr-id { min-width: 0; display: grid; gap: 8px; }
.pr-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pr-rank, .pr-role, .pr-you { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 5px; border-radius: 99px; font-size: 12px; font-weight: 900; }
.pr-rank { background: color-mix(in srgb, var(--rk) 20%, transparent); border: 1px solid color-mix(in srgb, var(--rk) 50%, transparent); }
.pr-role { padding: 0 10px; background: rgba(245, 196, 81, .14); color: var(--gold); border: 1px solid rgba(245, 196, 81, .35); }
.pr-you { padding: 0 10px; background: var(--accent); color: #fff; }
.pr-name { margin: 0; font-size: clamp(28px, 4vw, 44px); font-weight: 900; line-height: 1; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-sub { margin: 0; font-size: 13px; color: var(--muted); }
.pr-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.pr-actions .btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; }
.pr-actions .gem-icon { width: 15px; height: 15px; }

.pr-next { display: grid; gap: 8px; padding: 16px; border-radius: 16px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .06); backdrop-filter: blur(6px); }
.pr-next small { font-size: 10.5px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pr-next-row { display: flex; align-items: center; gap: 10px; }
.pr-next-row strong { display: block; font-size: 17px; font-weight: 900; }
.pr-next-row span { font-size: 12px; color: var(--muted); }
.pr-next-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.pr-next-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold)); animation: prBar 1.2s .4s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes prBar { to { width: var(--w); } }
.pr-next em { justify-self: end; font-style: normal; font-size: 11px; font-weight: 800; color: var(--subtle); }

.pr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pr-stat { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); transition: transform .2s ease, border-color .2s ease; }
.pr-stat:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.pr-stat::before { content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 56, 74, .16), transparent 70%); }
.pr-stat-ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(242, 56, 74, .14); color: var(--accent-hi); }
.pr-stat-ic svg, .pr-stat-ic .gem-icon { width: 22px; height: 22px; }
.pr-stat-txt { min-width: 0; display: grid; gap: 2px; }
.pr-stat-txt small { font-size: 10.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pr-stat-txt strong { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pr-donut { width: 50px; height: 50px; flex: none; transform: rotate(-90deg); }
.pr-donut circle { fill: none; stroke-width: 5; stroke: var(--input); }
.pr-donut .pr-donut-fill { stroke: var(--win); stroke-linecap: round; stroke-dasharray: 100.5; stroke-dashoffset: 100.5; animation: prDonut 1.3s .4s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes prDonut { to { stroke-dashoffset: calc(100.5 - 100.5 * var(--p) / 100); } }
.pr-wl { display: flex; gap: 8px; font-size: 11px; font-weight: 800; color: var(--subtle); }
.pr-wl i { font-style: normal; }
.pr-wl .w { color: var(--win); }
.pr-wl .l { color: var(--accent-hi); }

.pr-tabs { position: relative; display: flex; gap: 4px; padding: 5px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); justify-self: start; }
.pr-tabs button { position: relative; z-index: 1; height: 38px; padding: 0 20px; border-radius: 10px; font-weight: 800; font-size: 13.5px; color: var(--muted); transition: color .2s ease; }
.pr-tabs button.active { color: #fff; }
.pr-tab-ink { position: absolute; z-index: 0; left: 0; top: 5px; height: 38px; border-radius: 10px; background: var(--accent); box-shadow: 0 8px 18px -8px rgba(242, 56, 74, .9); transition: transform .35s cubic-bezier(.3, 1.2, .5, 1), width .35s cubic-bezier(.3, 1.2, .5, 1); }
.pr-panel.pr-swap > * { animation: prUp .4s cubic-bezier(.2, .8, .2, 1) both; }
.pr-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 12px; }
.pr-side { display: grid; gap: 12px; align-content: start; }
.pr-box { padding: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.pr-box h3 { margin: 0; display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.pr-box h3 small { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); }
.pr-chart-box .pf-chart { background: transparent; border: 0; padding: 0; }
.pr-fav { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; font-size: 13px; font-weight: 700; }
.pr-fav b { color: var(--muted); }
.pr-fav-bar { grid-column: 1 / -1; height: 7px; border-radius: 99px; background: var(--input); overflow: hidden; }
.pr-fav-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); animation: prBar .9s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: var(--d); }
.pr-form { display: flex; flex-wrap: wrap; gap: 5px; }
.pr-form i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; font-style: normal; font-size: 11px; font-weight: 900; animation: rkTile .3s both; }
.pr-form i.w { background: rgba(52, 215, 123, .16); color: var(--win); }
.pr-form i.l { background: rgba(242, 56, 74, .16); color: var(--accent-hi); }
.pr-empty { margin: 0; font-size: 13px; color: var(--subtle); }

.pr-ranks-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pr-ranks-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.pr-auto { width: auto; }
.pr-road { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding-top: 6px; }
.pr-road-line { display: none; }
.pr-rk { position: relative; display: grid; justify-items: center; gap: 4px; padding: 18px 10px 14px; border-radius: 16px; text-align: center; background: linear-gradient(180deg, color-mix(in srgb, var(--rk) 12%, transparent), transparent 70%), var(--card-2); border: 1px solid var(--line); animation: prUp .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 45ms); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.pr-rk.unlocked:not(:disabled):hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--rk) 60%, transparent); box-shadow: 0 16px 30px -18px var(--rk); }
.pr-rk-badge { position: relative; display: grid; place-items: center; margin-bottom: 4px; }
.pr-rk.unlocked .rank-badge { filter: drop-shadow(0 8px 14px color-mix(in srgb, var(--rk) 55%, transparent)); }
.pr-rk.locked { background: var(--card-2); cursor: default; }
.pr-rk.locked .rank-badge { filter: grayscale(1) brightness(.5); }
.pr-rk.locked strong { color: var(--subtle); }
.pr-rk strong { font-size: 14px; font-weight: 900; }
.pr-rk small { font-size: 11.5px; color: var(--muted); }
.pr-rk em { margin-top: 6px; font-style: normal; font-size: 11px; font-weight: 900; padding: 4px 10px; border-radius: 99px; background: var(--input); color: var(--muted); }
.pr-rk.unlocked em { color: var(--text); }
.pr-rk.on { border-color: var(--rk); box-shadow: 0 0 0 1px var(--rk) inset, 0 18px 36px -20px var(--rk); }
.pr-rk.on em { background: var(--rk); color: #fff; }
.pr-rk.on::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .14) 45%, transparent 60%); background-size: 250% 100%; animation: prShine 2.8s ease-in-out infinite; }
@keyframes prShine { from { background-position: 150% 0; } to { background-position: -100% 0; } }

@media (max-width: 1100px) {
  .pr-hero { grid-template-columns: auto minmax(0, 1fr); }
  .pr-next { grid-column: 1 / -1; }
  .pr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .pr-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 22px 18px; gap: 18px; }
  .pr-tags, .pr-actions { justify-content: center; }
  .pr-av { width: 124px; height: 124px; }
  .pr-stats { grid-template-columns: minmax(0, 1fr); }
  .pr-road { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr-tabs { justify-self: stretch; }
  .pr-tabs button { flex: 1; padding: 0 8px; }
  .rank-menu { width: min(340px, calc(100vw - 24px)); }
}
@media (prefers-reduced-motion: reduce) {
  .pr-hero-bg i, .pr-hero::after, .pr-rk.on::after { animation: none; }
}
.pr-actions a.btn { text-decoration: none; }
.pr-wl { flex-wrap: wrap; gap: 4px 8px; }
.pr-wl i { white-space: nowrap; }
.rk-tile strong { white-space: normal; line-height: 1.15; min-height: 2.3em; display: grid; place-items: center; overflow: visible; }
.rank-menu { width: 360px; }

/* ===================== Lobby v2 ===================== */
.lobby-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0; background: none; border: 0; margin-bottom: 12px; }
.lobby-cards .lc { position: relative; overflow: hidden; display: grid; gap: 2px; padding: 14px 18px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.lobby-cards .lc::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 20%, rgba(242, 56, 74, .22)); }
.lobby-cards .lc-2::after { background: linear-gradient(90deg, transparent 20%, rgba(245, 196, 81, .16)); }
.lobby-cards .lc b { display: inline-flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 900; line-height: 1.1; }
.lobby-cards .lc b i { font-style: normal; }
.lobby-cards .lc b .gem-icon { width: 17px; height: 17px; }
.lobby-cards .lc span { font-size: 12px; font-weight: 700; color: var(--muted); }
.room-value { display: grid; justify-items: center; gap: 2px; }
.rv-main { display: inline-flex; align-items: center; gap: 6px; }
.rv-range { font-size: 10.5px; font-weight: 800; color: var(--muted); letter-spacing: .02em; }
.room-action { display: grid; gap: 5px; justify-items: stretch; min-width: 74px; }
.room-action .btn { height: 30px; padding: 0 16px; font-size: 12.5px; }
.room-action .btn-join { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 6px 14px -8px rgba(242, 56, 74, .9); }
.room-action .btn-join:hover { filter: brightness(1.08); }
.swords-ring, .coin-ring { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line-strong); color: var(--muted); }
.swords-ring svg { width: 19px; height: 19px; }
.coin-ring { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 56, 74, .15); }
.coin-ring .chip-coin { transform: scale(.85); }

/* ===================== Chat v2 ===================== */
.chat-msg { position: relative; display: flex; gap: 10px; padding: 7px 10px; border-radius: 10px; transition: background .15s ease; }
.chat-msg:hover { background: rgba(255, 255, 255, .03); }
.chat-msg.mentions-me { background: rgba(242, 56, 74, .07); box-shadow: inset 2px 0 0 var(--accent); }
.chat-msg.flash { animation: chatFlash 1.4s ease; }
@keyframes chatFlash { 0%, 40% { background: rgba(245, 196, 81, .16); } 100% { background: transparent; } }
.chat-msg .chat-avatar-wrap { width: 34px; height: 34px; flex: none; }
.chat-msg .chat-msg-avatar { width: 34px; height: 34px; border-radius: 50%; }
.chat-msg-header { display: flex; align-items: center; gap: 5px; min-width: 0; }
.chat-lv { flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 16px; padding: 0 5px; border-radius: 5px; background: #3a3f52; color: #fff; font-size: 10px; font-weight: 900; font-variant-numeric: tabular-nums; }
.chat-lv.lv-mid { background: #2f7de1; }
.chat-lv.lv-high { background: var(--accent); }
.chat-msg-name { font-size: 12.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.chat-msg-header .chat-rank-badge { display: inline-flex; flex: none; }
.chat-msg-time { margin-left: auto; padding-left: 6px; font-size: 10.5px; color: var(--subtle); flex: none; }
.chat-msg-text { font-size: 13px; color: #c9cdda; line-height: 1.4; word-break: break-word; margin-top: 1px; }
.chat-quote { display: grid; gap: 1px; margin: 4px 0 3px; padding: 5px 8px; border-radius: 7px; background: var(--input); border-left: 2px solid var(--line-strong); cursor: pointer; }
.chat-quote:hover { border-left-color: var(--accent); }
.chat-quote-head { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.chat-quote-head svg { width: 11px; height: 11px; }
.chat-quote-head b { color: var(--text); }
.chat-quote-head em { font-style: normal; font-size: 10px; color: var(--subtle); }
.chat-quote-text { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-btn { position: absolute; right: 8px; top: 6px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: var(--card-2); border: 1px solid var(--line-strong); color: var(--muted); opacity: 0; transform: translateY(-2px); transition: opacity .15s ease, transform .15s ease; }
.chat-reply-btn svg { width: 13px; height: 13px; }
.chat-msg:hover .chat-reply-btn, .chat-reply-btn:focus-visible { opacity: 1; transform: none; }
.chat-msg:hover .chat-msg-time { visibility: hidden; }
.chat-reply-btn:hover { color: var(--text); border-color: var(--accent); }
.chat-bet { display: flex; align-items: center; gap: 8px; margin: 2px 10px; padding: 6px 9px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); font-size: 12px; animation: rhIn .35s ease; }
.chat-bet-ic { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: rgba(242, 56, 74, .14); color: var(--accent-hi); flex: none; }
.chat-bet-ic svg { width: 13px; height: 13px; }
.chat-bet-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.chat-bet-txt b { color: var(--text); cursor: pointer; }
.chat-bet-txt em { font-style: normal; font-weight: 900; color: var(--win); }
.chat-bet.lost .chat-bet-txt em { color: var(--accent-hi); }
.chat-bet-mult { font-weight: 900; font-size: 11px; color: var(--win); }
.chat-bet.lost .chat-bet-mult { color: var(--accent-hi); }

.chat-footer { display: grid; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.chat-reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border-radius: 9px; background: var(--input); border: 1px solid rgba(242, 56, 74, .35); font-size: 12px; color: var(--muted); animation: rhIn .25s ease; }
.chat-reply-bar[hidden] { display: none; }
.chat-reply-bar > svg { width: 14px; height: 14px; color: var(--accent-hi); flex: none; }
.chat-reply-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-bar b { color: var(--text); }
.chat-reply-x { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.chat-reply-x:hover { background: var(--card-2); color: var(--text); }
.chat-reply-x .icon-svg { width: 14px; height: 14px; }
.chat-input-bar { display: flex; gap: 8px; align-items: stretch; }
.chat-input-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; border-radius: 10px; background: var(--input); border: 1px solid var(--line-strong); transition: border-color .15s ease; }
.chat-input-wrap:focus-within { border-color: var(--accent); }
.chat-input-wrap input { flex: 1; min-width: 0; height: 40px; padding: 0 6px 0 12px; background: transparent; border: 0; color: var(--text); font-size: 13px; }
.chat-input-wrap input:focus { outline: none; }
.chat-emoji-btn { width: 32px; height: 32px; margin-right: 4px; flex: none; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.chat-emoji-btn svg { width: 18px; height: 18px; }
.chat-emoji-btn:hover, .chat-emoji-btn[aria-expanded="true"] { color: var(--gold); background: var(--card-2); }
.chat-emoji-pop { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 30; width: 236px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 0 18px 40px rgba(0, 0, 0, .55); animation: rkIn .18s ease; }
.chat-emoji-pop[hidden] { display: none; }
.chat-emoji-pop button { height: 30px; border-radius: 7px; font-size: 18px; line-height: 1; transition: transform .12s ease, background .12s ease; }
.chat-emoji-pop button:hover { background: var(--card-2); transform: scale(1.15); }
.btn-chat-send { width: 42px; flex: none; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.chat-bar { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.chat-bar-online { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px 0 2px; font-weight: 900; color: var(--text); }
.chat-bar-online i { width: 7px; height: 7px; border-radius: 50%; background: var(--win); box-shadow: 0 0 8px var(--win); }
.chat-bar-btn { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 7px; font-size: 10.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); transition: background .15s ease, color .15s ease; }
.chat-bar-btn svg { width: 13px; height: 13px; }
.chat-bar-btn:hover { background: var(--card-2); color: var(--text); }
.chat-bar-btn[aria-pressed="true"] { background: rgba(242, 56, 74, .14); color: var(--accent-hi); }
.chat-bar-gap { flex: 1; }
.chat-bar .chat-rules-row { position: relative; }
.chat-bar .chat-rules { position: absolute; right: 0; bottom: calc(100% + 8px); width: 260px; z-index: 30; }
.chat-header .chat-online-count { display: none; }

/* ===================== Chat giveaway card v2 ===================== */
.cg.cg2 { position: relative; padding: 12px 12px 10px; display: grid; gap: 9px; border-radius: 14px; background: linear-gradient(180deg, rgba(242, 56, 74, .12), rgba(242, 56, 74, .02) 70%), var(--card); border: 1px solid rgba(242, 56, 74, .3); border-bottom: 2px solid var(--accent); }
.cg2-head { display: flex; align-items: center; gap: 8px; }
.cg2-who { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg2-who b { color: var(--accent-hi); font-weight: 900; cursor: pointer; }
.cg2-chev { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); flex: none; }
.cg2-chev svg { width: 15px; height: 15px; transition: transform .2s ease; }
.cg.collapsed .cg2-chev svg { transform: rotate(180deg); }
.cg2-chev:hover { background: var(--input); color: var(--text); }
.cg2-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.cg2-pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 8px; font-size: 12px; font-weight: 900; background: var(--input); border: 1px solid var(--line-strong); color: var(--text); font-variant-numeric: tabular-nums; }
.cg2-pill svg { width: 13px; height: 13px; }
.cg2-pill.lock { color: var(--gold); border-color: rgba(245, 196, 81, .45); background: rgba(245, 196, 81, .1); }
.cg2-pill.open { color: var(--win); }
.cg2-pill.ppl { color: #7fb4ff; cursor: pointer; }
.cg2-pill.ppl:hover { border-color: #7fb4ff; }
.cg2-pill.time { margin-left: auto; }
.cg2-pill.time.live { background: var(--accent); border-color: var(--accent); color: #fff; }
.cg2-prize { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cg2-art { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--input); border: 1px solid var(--line-strong); overflow: hidden; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .8); }
.cg2-art .pet-img, .cg2-art .pet-img img { width: 52px; height: 52px; }
.cg2-art.gems img { width: 34px; height: 34px; }
.cg2-prize-txt { min-width: 0; display: grid; gap: 3px; }
.cg2-prize-txt strong { font-size: 16px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg2-prize-txt span { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 800; color: var(--muted); }
.cg2-prize-txt span img { width: 15px; height: 15px; }
.cg2-req { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: var(--muted); }
.cg2-req svg { width: 11px; height: 11px; }
.cg2-req.ok svg { color: var(--win); }
.cg2-req.no svg { color: var(--accent-hi); }
.cg2-bar { width: 100%; height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; font-weight: 900; font-size: 14px; border: 1px solid transparent; }
.cg2-bar svg { width: 14px; height: 14px; }
.cg2-bar.join { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: #fff; box-shadow: 0 8px 18px -10px rgba(242, 56, 74, .9), inset 0 -2px 0 rgba(0, 0, 0, .18); transition: filter .12s ease, transform .12s ease; }
.cg2-bar.join:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cg2-bar.winner { background: rgba(242, 56, 74, .1); border-color: var(--accent); color: var(--accent-hi); }
.cg2-bar.winner b { color: var(--accent-hi); cursor: pointer; }
.cg2-bar.joined { background: rgba(52, 215, 123, .1); border-color: rgba(52, 215, 123, .35); color: var(--win); }
.cg2-bar.muted { background: var(--input); border-color: var(--line-strong); color: var(--muted); font-size: 13px; }
.cg2-bar.live { background: linear-gradient(180deg, #ffd34d, var(--gold)); color: #2a1a00; }
.cg2-pager { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; }
.cg2-pager button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--input); color: var(--text); }
.cg2-pager button.dim { opacity: .4; }
.cg2-pager button svg { width: 15px; height: 15px; }
.cg2-pager button:hover { background: var(--card-2); }

/* ===================== Upgrade result popup ===================== */
#upgResultModal .ur-card { width: min(520px, calc(100vw - 24px)); padding: 22px; display: grid; gap: 14px; animation: urIn .45s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes urIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.ur-head { display: flex; align-items: center; justify-content: space-between; }
.ur-head h3 { margin: 0; font-size: 26px; font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; }
.ur-card.lose .ur-head h3 { color: var(--accent-hi); }
.ur-prize { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 14px; background: linear-gradient(90deg, rgba(245, 196, 81, .14), transparent 60%), var(--card); border: 1px solid var(--line); border-bottom: 2px solid var(--gold); }
.ur-card.lose .ur-prize { background: linear-gradient(90deg, rgba(242, 56, 74, .14), transparent 60%), var(--card); border-bottom-color: var(--accent); }
.ur-prize::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .08) 48%, transparent 60%); transform: translateX(-100%); animation: urSweep 2.4s .4s ease-out; }
@keyframes urSweep { to { transform: translateX(100%); } }
.ur-items { width: 92px; height: 92px; flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px; border-radius: 12px; background: var(--input); border: 1px solid var(--line-strong); }
.ur-items[data-n="1"] { grid-template-columns: 1fr; }
.ur-items span { display: grid; place-items: center; border-radius: 7px; background: var(--card-2); overflow: hidden; animation: rkTile .4s cubic-bezier(.2, .9, .3, 1.3) both; }
.ur-items span:nth-child(2) { animation-delay: .08s; } .ur-items span:nth-child(3) { animation-delay: .16s; } .ur-items span:nth-child(4) { animation-delay: .24s; }
.ur-items .pet-img, .ur-items .pet-img img { width: 100%; height: 100%; object-fit: contain; }
.ur-items .more { font-size: 12px; font-weight: 900; color: var(--muted); }
.ur-items .gems img { width: 44px; height: 44px; }
.ur-prize-txt { display: grid; gap: 4px; }
.ur-prize-txt small { font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ur-prize-txt strong { font-size: 24px; font-weight: 900; line-height: 1.1; }
.ur-prize-txt span { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 900; }
.ur-prize-txt span img { width: 17px; height: 17px; }
.ur-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ur-stats > div { padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 4px; }
.ur-stats small { font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ur-stats strong { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ur-stats div:last-child { grid-template-columns: auto 1fr; align-items: baseline; column-gap: 6px; }
.ur-stats div:last-child small { grid-column: 1 / -1; }
.ur-stats em { font-style: normal; font-size: 14px; font-weight: 800; color: var(--muted); }
.ur-chance { color: var(--accent-hi); }
.ur-again { height: 44px; }
@media (max-width: 640px) { .lobby-cards .lc { padding: 10px 12px; } .lobby-cards .lc b { font-size: 16px; } }
.chat-footer { grid-template-columns: minmax(0, 1fr); }
.chat-footer > * { min-width: 0; }
.chat-input-wrap input { width: 100%; min-width: 0; height: 40px; }

/* ===================== Lobby v3 (BloxyFlip style) ===================== */
html, body { overflow-x: clip; max-width: 100%; }
.app-layout, .main-shell { max-width: 100vw; }
#diceView.active, #coinflipView.active { display: grid; gap: 12px; align-content: start; }
.lobby-cards { height: auto; margin: 0; padding: 0; }
.lobby-cards .lc { padding: 16px 20px; min-height: 76px; align-content: center; background: linear-gradient(90deg, var(--card) 35%, color-mix(in srgb, var(--accent) 16%, var(--card))); }
.lobby-cards .lc-2 { background: linear-gradient(90deg, var(--card) 35%, color-mix(in srgb, var(--gold) 13%, var(--card))); }
.lobby-cards .lc::after { display: none; }
.lobby-cards .lc b { font-size: 22px; }
.lobby-cards .lc span { font-size: 12.5px; }
.lobby-toolbar { margin: 0; }
.rooms-list { gap: 8px; }
.room-row { min-height: 76px; padding: 10px 18px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); transition: border-color .15s ease, background .15s ease; }
.room-row:hover { border-color: var(--line-strong); background: var(--card-2); }
.room-row.is-mine { border-color: rgba(242, 56, 74, .35); }
.room-score { display: grid; justify-items: center; gap: 4px; }
.dice-mini { display: inline-flex; gap: 4px; }
.dice-mini .die-sq { width: 20px; height: 20px; border-radius: 5px; }
.item-thumb { width: 44px; height: 44px; border-radius: 9px; background: var(--input); border: 1px solid var(--line-strong); }
.room-items { gap: 5px; }

/* ===================== Mobile ===================== */
@media (max-width: 860px) {
  .content-area { padding: 0 12px 90px; }
  .lobby-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .lobby-cards .lc { padding: 10px 12px; min-height: 0; }
  .lobby-cards .lc b { font-size: 16px; }
  .lobby-cards .lc span { font-size: 10.5px; }
  .lobby-toolbar { gap: 6px; }
  .lobby-toolbar .btn { height: 38px; padding: 0 12px; font-size: 13px; }
  .lobby-toolbar .toolbar-gap { display: none; }
  .room-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "players action" "items value" "score score"; gap: 8px 10px; padding: 12px; }
  .room-players { grid-area: players; }
  .room-items { grid-area: items; min-width: 0; overflow: hidden; }
  .room-value { grid-area: value; justify-items: end; }
  .room-score { grid-area: score; grid-auto-flow: column; justify-content: start; align-items: center; gap: 8px; }
  .room-score:empty { display: none; }
  .room-action { grid-area: action; grid-auto-flow: column; min-width: 0; }
  .room-action .btn { height: 32px; padding: 0 12px; }
  .item-thumb { width: 36px; height: 36px; }
  .rv-main { font-size: 15px; }
  .pr-hero-mark { display: none; }
  .modal-card { max-width: calc(100vw - 16px); }
}

/* ---- Mobile: duel views, rank menu, fair window ---- */
@media (max-width: 640px) {
  .game-view-card { width: calc(100vw - 16px); }
  .game-view-body { padding: 12px; }
  .arena, .arena.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 8px; padding: 16px 10px; }
  .arena.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .arena-player:first-child { grid-column: 1; grid-row: 1; }
  .arena:not(.three) .arena-player:nth-child(2) { grid-column: 2; grid-row: 1; }
  .arena-center, .arena.three .arena-center { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .arena-avatar, .arena.three .arena-avatar { width: 76px; height: 76px; }
  .arena-name { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #arenaDice { gap: 8px; }
  #arenaDice .die, .arena.three .die { width: 58px; height: 58px; border-radius: 12px; }
  .round-history-head { font-size: 12px; }
  .seed-line { flex-wrap: wrap; justify-content: center; font-size: 11px; }
  .seed-line code { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
  .wager-columns { grid-template-columns: minmax(0, 1fr) !important; }
  .flip-stage { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
  .rank-menu { position: fixed; top: calc(62px + env(safe-area-inset-top, 0px)); left: 8px; right: 8px; width: auto; max-height: calc(100vh - 80px); }
  #fairModal .pf-card { display: block; max-height: calc(100vh - 24px); overflow-y: auto; }
  #fairModal .pf-body { min-height: 0; }
  #hostGaModal .hg-card { max-height: calc(100vh - 24px); overflow-y: auto; display: block; }
  .ur-head h3 { font-size: 21px; }
  .ur-prize-txt strong { font-size: 20px; }
}
/* Crash removed: both game groups hold 2 cards side by side */
@media (min-width: 1101px) { .rh-gamerow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.rh-group .rh-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Mines removed: Games (2) next to House (Upgrader only) */
@media (min-width: 1101px) { .rh-gamerow { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.rh-group-house .rh-games { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) { .rh-group-house .rh-games { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* one Games group: Coinflip, Color Dice, Upgrader */
.rh-gamerow { grid-template-columns: minmax(0, 1fr) !important; }
.rh-group-pvp .rh-games { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .rh-group-pvp .rh-games { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .rh-group-pvp .rh-games > .rh-game:nth-child(3):last-child { grid-column: 1 / -1; } }

/* =========================================================
   Daily Rewards v2: vault hero, isometric boxes, 3D vault spinner
   ========================================================= */
#rewardsView { --vault-red: #f2384a; }
.rw-hero { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 26px; padding: 22px 26px; margin-bottom: 18px;
  border-radius: 20px; border: 1px solid rgba(242, 56, 74, .22); overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 140% at 0% 0%, rgba(242, 56, 74, .22), transparent 55%), radial-gradient(90% 120% at 100% 100%, rgba(255, 140, 90, .10), transparent 60%), var(--card); }
.rw-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%); mask-image: linear-gradient(90deg, #000, transparent 70%); }
.rw-ring { position: relative; width: 128px; height: 128px; flex: none; }
.rw-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rw-ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.rw-ring-bg { stroke: rgba(255, 255, 255, .07); }
.rw-ring-fg { stroke: url(#rwRingGrad); stroke-dasharray: 0 100; transition: stroke-dasharray 1s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 6px rgba(242, 56, 74, .55)); }
.rw-ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.rw-ring-in small { font-size: 10px; font-weight: 900; letter-spacing: .16em; color: var(--muted); }
.rw-ring-in strong { font-size: 38px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.rw-hero-main { display: grid; gap: 6px; min-width: 0; }
.rw-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: #ff7a86; }
.rw-eyebrow svg { width: 13px; height: 13px; }
.rw-hero-main .view-title { margin: 0; font-size: 26px; }
.rw-hero-main .view-sub { margin: 0 0 6px; }
.rw-hero .rw-progress { margin: 4px 0 0; gap: 8px; }
.rw-hero .rw-bar { height: 8px; background: rgba(0, 0, 0, .35); }
.rw-hero .rw-bar span { background: linear-gradient(90deg, #d81f3a, #ff7a86); box-shadow: 0 0 12px rgba(242, 56, 74, .6); }
.rw-hero-next { display: grid; justify-items: center; gap: 2px; padding: 12px 16px 14px; min-width: 150px; border-radius: 16px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); text-align: center; }
.rw-next-box { width: 86px; height: 86px; display: block; animation: cboxFloat 3.2s ease-in-out infinite; }
.rw-next-box svg { width: 100%; height: 100%; }
.rw-hero-next small { font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--subtle); margin-top: 4px; }
.rw-hero-next strong { font-size: 14px; font-weight: 900; }
.rw-next-lv { font-size: 11px; font-weight: 900; color: #ff7a86; padding: 2px 8px; border-radius: 99px; background: rgba(242, 56, 74, .14); margin-top: 3px; }

/* box art */
.cbox { overflow: visible; }
.cbox-glow { opacity: .55; transition: opacity .3s ease; }
.cbox-lid { transition: transform .35s cubic-bezier(.3,1.4,.5,1); transform-origin: 60px 40px; }
.cbox-spark { opacity: 0; transform-box: fill-box; transform-origin: center; }
.case-card.ready .cbox-spark, .rw-next-box .cbox-spark, .vault-head-art .cbox-spark { animation: cboxSpark 2.6s ease-in-out infinite; }
.cbox-spark.s2 { animation-delay: 1.3s !important; }
@keyframes cboxSpark { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); } 45% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes cboxFloat { 50% { transform: translateY(-6px); } }

/* vault cards */
#rwCases.case-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
#rwCases .case-card { position: relative; overflow: hidden; padding: 14px 14px 12px; gap: 10px; border-radius: 18px;
  background: radial-gradient(90% 60% at 50% 42%, hsl(var(--case-hue) 75% 45% / .22), transparent 70%), linear-gradient(180deg, hsl(var(--case-hue) 40% 16% / .6), var(--card) 70%);
  border: 1px solid hsl(var(--case-hue) 60% 50% / .18); transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s ease, box-shadow .25s ease; }
#rwCases .case-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.07) 48%, transparent 60%); transform: translateX(-120%); transition: transform .8s ease; }
#rwCases .case-card:hover { transform: translateY(-4px); border-color: hsl(var(--case-hue) 80% 62% / .7); box-shadow: 0 16px 36px -14px hsl(var(--case-hue) 80% 50% / .55); }
#rwCases .case-card:hover::after { transform: translateX(120%); }
#rwCases .case-card:hover .cbox-lid { transform: translateY(-6px) rotate(-3deg); }
#rwCases .case-card:hover .cbox-glow { opacity: .9; }
#rwCases .case-card .case-art { position: relative; width: 132px; height: 132px; margin: 0; align-self: center; animation: none; }
#rwCases .case-card.ready .case-art svg { animation: cboxFloat 3s ease-in-out infinite; }
#rwCases .case-art svg { position: relative; width: 100%; height: 100%; }
.case-pedestal { position: absolute; left: 50%; bottom: 2px; width: 110px; height: 22px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, hsl(var(--case-hue) 80% 55% / .45), transparent); filter: blur(2px); }
#rwCases .case-card:not(.unlocked) .case-art { filter: grayscale(.9) brightness(.55); }
.case-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 0 2px; }
.case-meta b { color: var(--text); }
#rwCases .case-card-head small { color: hsl(var(--case-hue) 85% 72%); }
#rwCases .case-btn { border-radius: 11px; }
#rwCases .case-btn.ready { background: linear-gradient(180deg, #ff4d5e, #d81f3a); box-shadow: 0 8px 20px -6px rgba(242, 56, 74, .7), inset 0 1px 0 rgba(255,255,255,.25); }

/* case page */
#rwCasePane .case-page-badge { display: none; }
.vault-head { display: flex; align-items: center; gap: 16px; margin: -4px 0 14px; }
.vault-head-art { width: 92px; height: 92px; flex: none; animation: cboxFloat 3.4s ease-in-out infinite; }
.vault-head-art svg { width: 100%; height: 100%; }
.vault-head > div { display: grid; gap: 2px; min-width: 0; }
.vault-head small { font-size: 10.5px; font-weight: 900; letter-spacing: .14em; color: hsl(var(--case-hue) 85% 72%); }
.vault-head strong { font-size: 24px; font-weight: 900; line-height: 1.1; }

.vault-stage { position: relative; height: 250px; margin-bottom: 14px; border-radius: 20px; overflow: hidden; perspective: 900px; isolation: isolate;
  border: 1px solid hsl(var(--case-hue, 350) 60% 50% / .25);
  background: radial-gradient(60% 90% at 50% 50%, hsl(var(--case-hue, 350) 70% 40% / .22), transparent 70%), linear-gradient(180deg, #0f1118, #0a0b10); }
.vault-stage::before, .vault-stage::after { content: ""; position: absolute; top: 0; bottom: 0; width: 22%; z-index: 150; pointer-events: none; }
.vault-stage::before { left: 0; background: linear-gradient(90deg, #0b0c12, transparent); }
.vault-stage::after { right: 0; background: linear-gradient(-90deg, #0b0c12, transparent); }
.vault-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; z-index: -1;
  background-image: linear-gradient(hsl(var(--case-hue, 350) 70% 60% / .12) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--case-hue, 350) 70% 60% / .12) 1px, transparent 1px);
  background-size: 34px 34px; transform: perspective(300px) rotateX(58deg); transform-origin: bottom; -webkit-mask-image: linear-gradient(transparent, #000); mask-image: linear-gradient(transparent, #000); }
.vault-stage.spinning .vault-floor { animation: vaultFloor .5s linear infinite; }
@keyframes vaultFloor { to { background-position: -34px 0, -34px 0; } }
.vault-track { position: absolute; inset: 0; transform-style: preserve-3d; }
.vault-track .case-tile { position: absolute; left: 50%; top: 50%; margin: 0; width: 118px; height: 132px; gap: 8px; border-radius: 16px; will-change: transform, opacity;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.015)), #161923; border: 1px solid rgba(255,255,255,.06); border-bottom: 3px solid var(--rar);
  box-shadow: 0 14px 26px -12px rgba(0,0,0,.8), inset 0 -26px 30px -22px var(--rar); backface-visibility: hidden; }
.vault-track .case-tile img, .vault-track .case-tile .case-gem { width: 62px; height: 62px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.vault-track .case-tile.center { border-color: rgba(255,255,255,.14); }
.vault-track .case-tile.won { animation: vaultWon 1.1s cubic-bezier(.2,.9,.3,1.3) forwards; box-shadow: 0 0 0 2px var(--rar), 0 0 40px var(--rar), inset 0 -40px 40px -24px var(--rar); }
@keyframes vaultWon { 30% { filter: brightness(1.8); } 100% { filter: brightness(1.12); } }

.vault-frame { position: absolute; left: 50%; top: 50%; width: 146px; height: 162px; transform: translate(-50%, -50%); z-index: 140; pointer-events: none; border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 0 40px -10px hsl(var(--case-hue, 350) 90% 60% / .55); animation: vaultBreathe 2.8s ease-in-out infinite; }
.vault-frame i { position: absolute; width: 22px; height: 22px; border: 3px solid #ff5a68; filter: drop-shadow(0 0 6px rgba(255, 90, 104, .9)); }
.vault-frame i:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.vault-frame i:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.vault-frame i:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.vault-frame i:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.vault-frame.tick { animation: vaultTick .16s ease-out; }
@keyframes vaultTick { 0% { transform: translate(-50%, -50%) scale(1.045); } 100% { transform: translate(-50%, -50%) scale(1); } }
@keyframes vaultBreathe { 50% { box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 0 56px -8px hsl(var(--case-hue, 350) 90% 60% / .75); } }
.vault-stage.reveal .vault-frame i { border-color: var(--rar); filter: drop-shadow(0 0 8px var(--rar)); }
.vault-pointer { position: absolute; left: 50%; top: 10px; z-index: 160; width: 0; height: 0; transform: translateX(-50%);
  border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 12px solid #ff5a68; filter: drop-shadow(0 0 6px rgba(255, 90, 104, .9)); }
.vault-rays { position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; z-index: 0; opacity: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, var(--rar, #f5c451) 0deg 6deg, transparent 6deg 22deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 10%, transparent 75%); mask-image: radial-gradient(closest-side, #000 10%, transparent 75%); }
.vault-stage.reveal .vault-rays { opacity: .32; animation: vaultRays 9s linear infinite, vaultRaysIn .6s ease-out; }
@keyframes vaultRays { to { transform: rotate(360deg); } }
@keyframes vaultRaysIn { from { opacity: 0; transform: scale(.4); } }
.vault-result { position: absolute; left: 50%; bottom: 10px; z-index: 160; transform: translateX(-50%); display: grid; justify-items: center; text-align: center; pointer-events: none; }
.vault-result:empty { display: none; }
.vault-result small { font-size: 10px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; color: var(--rar); }
.vault-result strong { font-size: 15px; font-weight: 900; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
.vault-stage.reveal .vault-result { animation: vaultResultIn .45s cubic-bezier(.2,.9,.3,1.3); }
@keyframes vaultResultIn { from { opacity: 0; transform: translate(-50%, 10px) scale(.9); } }

@media (max-width: 860px) {
  .rw-hero { grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 18px; }
  .rw-hero-next { display: none; }
  .rw-ring { width: 104px; height: 104px; }
  .rw-ring-in strong { font-size: 30px; }
}
@media (max-width: 560px) {
  .rw-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .rw-hero-main { justify-items: center; }
  .rw-hero .rw-progress { width: 100%; }
  #rwCases.case-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  #rwCases .case-card .case-art { width: 96px; height: 96px; }
  .case-meta { flex-direction: column; align-items: center; gap: 1px; }
  .vault-stage { height: 200px; }
  .vault-track .case-tile { width: 88px; height: 102px; }
  .vault-track .case-tile img, .vault-track .case-tile .case-gem { width: 46px; height: 46px; }
  .vault-frame { width: 108px; height: 124px; }
  .vault-head-art { width: 70px; height: 70px; }
  .vault-head strong { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .rw-next-box, .vault-head-art, #rwCases .case-card.ready .case-art svg, .vault-frame, .vault-stage.reveal .vault-rays { animation: none !important; }
}
.vault-track .case-tile { top: 45%; }
.vault-frame { top: 45%; }
@media (max-width: 560px) {
  .vault-stage { height: 220px; }
  .vault-track .case-tile, .vault-frame { top: 43%; }
  .rw-ring { width: 88px; height: 88px; }
  .rw-ring-in strong { font-size: 26px; }
  .rw-ring-in small { font-size: 8.5px; }
  .rw-hero-main .view-title { font-size: 22px; }
}
.case-tile-kind { margin-top: -6px; font-size: 9.5px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.vault-track .case-tile .pet-img { width: 66px; height: 66px; display: grid; place-items: center; }
.vault-track .case-tile .pet-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.vault-track .case-tile.center .pet-img img { animation: vaultPetBob 2.4s ease-in-out infinite; }
@keyframes vaultPetBob { 50% { transform: translateY(-3px) scale(1.04); } }
@media (max-width: 560px) { .vault-track .case-tile .pet-img { width: 48px; height: 48px; } .case-tile-kind { font-size: 8.5px; } }
/* Upgrader sound toggle */
.upg-intro-right { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.upg-sound { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--card-2); border: 1px solid var(--line); color: var(--text); cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.upg-sound:hover { border-color: rgba(242, 56, 74, .5); }
.upg-sound svg { width: 17px; height: 17px; }
.upg-sound .snd-off { display: none; }
.upg-sound.muted { color: var(--muted); }
.upg-sound.muted .snd-on { display: none; }
.upg-sound.muted .snd-off { display: block; }
/* Upgrader result: pets as a fanned stack of square cards */
.ur-items { width: auto; min-width: 92px; height: 96px; padding: 0 6px; display: flex; align-items: center; justify-content: center; gap: 0; background: none; border: 0; flex: none; }
.ur-items span { position: relative; width: 70px; height: 70px; flex: none; margin-left: -24px; padding: 6px; border-radius: 14px;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.08), transparent 70%), var(--card-2); border: 1px solid var(--line-strong);
  box-shadow: 0 10px 20px -8px rgba(0,0,0,.7); }
.ur-items span:first-child { margin-left: 0; }
.ur-items span:nth-child(1) { transform: rotate(-7deg); z-index: 1; }
.ur-items span:nth-child(2) { transform: translateY(-5px); z-index: 2; }
.ur-items span:nth-child(3) { transform: rotate(7deg); z-index: 3; }
.ur-items span:nth-child(4) { transform: rotate(12deg) translateY(4px); z-index: 4; }
.ur-items[data-n="1"] span { width: 86px; height: 86px; transform: none; }
.ur-items[data-n="2"] span:nth-child(1) { transform: rotate(-6deg); }
.ur-items[data-n="2"] span:nth-child(2) { transform: rotate(6deg); }
.ur-items .pet-img { display: block; width: 100%; height: 100%; }
.ur-items .pet-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }
.ur-items .more { display: grid; place-items: center; font-size: 15px; font-weight: 900; color: var(--text); background: linear-gradient(180deg, #2a2f3d, #1b1f29); }
.ur-card.lose .ur-items span:not(.more) { filter: grayscale(.35) brightness(.85); }
.ur-card:not(.lose) .ur-items span { border-color: rgba(245, 196, 81, .45); }
@media (max-width: 480px) { .ur-items span { width: 56px; height: 56px; margin-left: -20px; } .ur-items[data-n="1"] span { width: 70px; height: 70px; } }
.lock-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 16px; border-radius: 12px; background: linear-gradient(90deg, rgba(242, 56, 74, .18), rgba(242, 56, 74, .05)); border: 1px solid rgba(242, 56, 74, .45); font-size: 13px; line-height: 1.4; }
.lock-banner svg { width: 22px; height: 22px; flex: none; color: #ff5a68; }
.lock-banner strong { color: #ff7a86; }

/* =====================================================================
   Color Dice duel v3: BloxyGem layout (players either side, 4 big dice,
   roll history box, hash line, two wager columns). Red ROGEMS accents.
   ===================================================================== */
#matchViewModal .game-view-card { width: min(980px, calc(100vw - 24px)); padding: 0; border-radius: 18px; background: #14161f; border: 1px solid rgba(255,255,255,.06); overflow: hidden; }
#matchViewModal .game-view-head { position: relative; display: flex; justify-content: center; align-items: center; padding: 18px 20px 6px; border: 0; background: none; }
#matchViewModal .game-view-head .brand-wordmark { height: 24px; width: auto; }
#matchViewModal .game-view-head .modal-close { position: absolute; right: 14px; top: 12px; background: none; border: 0; color: #8a90a3; }
#matchViewModal .game-view-head .modal-close:hover { color: #fff; }
#matchViewModal .game-view-body { padding: 8px 28px 24px; display: grid; gap: 16px; }

/* arena: player | dice | player */
#matchViewModal .arena { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 12px; padding: 4px 0 0; background: none; border: 0; box-shadow: none; min-height: 0; }
#matchViewModal .arena:not(.three) .arena-players { display: contents; }
#matchViewModal .arena:not(.three) .arena-player:nth-child(1) { grid-column: 1; grid-row: 1; }
#matchViewModal .arena:not(.three) .arena-player:nth-child(2) { grid-column: 3; grid-row: 1; }
#matchViewModal .arena:not(.three) .arena-center { grid-column: 2; grid-row: 1; }
#matchViewModal .arena.three { grid-template-columns: minmax(0, 1fr); }
#matchViewModal .arena.three .arena-players { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

#matchViewModal .arena-player { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; background: none; border: 0; box-shadow: none; transition: opacity .4s ease, filter .4s ease; min-width: 0; }
#matchViewModal .ap-av { position: relative; width: 116px; height: 116px; }
#matchViewModal .arena-avatar { width: 116px; height: 116px; border-radius: 50%; background: #1d2030; border: 0; box-shadow: none; object-fit: cover; outline: none; transition: box-shadow .4s ease; }
#matchViewModal .arena-avatar.blank { display: grid; place-items: center; font-size: 34px; font-weight: 900; color: #4a4f63; }
#matchViewModal .ap-dots { position: absolute; right: 2px; bottom: 6px; display: flex; gap: 4px; padding: 3px; border-radius: 7px; background: rgba(12,13,18,.85); }
#matchViewModal .ap-dot { display: block; width: 11px; height: 11px; border-radius: 50%; }
#matchViewModal .ap-dot.me { border-radius: 3px; background: #fff; }
#matchViewModal .arena-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 900; color: #fff; }
#matchViewModal .arena-colors { display: flex; gap: 5px; justify-content: center; }
#matchViewModal .arena-colors .color-tag { padding: 2px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 900; color: #fff; text-transform: none; letter-spacing: 0; border: 0; box-shadow: none; filter: saturate(1.05); }
#matchViewModal .arena-player.winner .arena-avatar { box-shadow: 0 0 0 3px #14161f, 0 0 0 5px var(--ring), 0 0 34px 6px color-mix(in srgb, var(--ring) 55%, transparent); }
#matchViewModal .arena-player.loser { opacity: .35; filter: grayscale(.85); }
#matchViewModal .arena-player.winner, #matchViewModal .arena-player.loser { transform: none; }

/* dice */
#matchViewModal .arena-center { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 18px; min-width: 0; }
#matchViewModal .dice-row { display: flex; gap: 12px; min-height: 96px; align-items: center; justify-content: center; }
#matchViewModal .dice-row .die { position: relative; width: 96px; height: 96px; border-radius: 18px; display: block; padding: 0; border: 0; color: inherit;
  background: linear-gradient(180deg, #2c2f3c, #262936); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 6px 14px -8px rgba(0,0,0,.8); transform: none; animation: none; }
#matchViewModal .dice-row .die::before { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #8d92a3; box-shadow: none; }
#matchViewModal .dice-row .die::after { display: none; }
#matchViewModal .dice-row .die[class*="c-"]:not(.blank) { background: currentColor; box-shadow: 0 10px 28px -8px currentColor, inset 0 2px 0 rgba(255,255,255,.18), inset 0 -3px 0 rgba(0,0,0,.12); }
#matchViewModal .dice-row .die[class*="c-"]:not(.blank)::before { background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.65); }
#matchViewModal .dice-row .die.reveal { animation: bgDiePop .3s cubic-bezier(.2, .9, .3, 1.35) both; }
@keyframes bgDiePop { 0% { transform: scale(.35); opacity: .6; } 65% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
#matchViewModal .dice-row .die.reset { animation: none; }
#matchViewModal .dice-row .die.hit { outline: none; }
#matchViewModal .dice-count { display: none; }

#matchViewModal .dice-phase { min-height: 18px; margin: 2px 0 0; padding: 0; background: none; border: 0; font-size: 12.5px; font-weight: 700; color: #6b7083; text-align: center; letter-spacing: 0; text-transform: none; }
#matchViewModal .dice-phase b { display: none; }
#matchViewModal .dice-phase.final span, #matchViewModal .dice-phase.rolling span, #matchViewModal .dice-phase.countdown span, #matchViewModal .dice-phase.waiting span { color: #6b7083; font-size: 12.5px; }
#matchViewModal .dice-win-pill { margin-top: 6px; padding: 11px 26px; border-radius: 99px; font-size: 15px; font-weight: 900; color: #fff; background: var(--pill, #f2384a); border: 0;
  box-shadow: 0 10px 30px -8px var(--pill, #f2384a), inset 0 1px 0 rgba(255,255,255,.2); }
#matchViewModal .dice-win-pill.show { animation: bgPillIn .4s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes bgPillIn { from { transform: scale(.7); opacity: 0; } }
#matchViewModal .duel-fee-note { font-size: 11.5px; color: #6b7083; font-weight: 700; }
#matchViewModal .arena-round, #matchViewModal .arena-score, #matchViewModal .arena-status { display: none; }
#matchViewModal .arena.arena-flash::after { display: none; }

/* roll history box */
#matchViewModal .round-history { padding: 16px; border-radius: 14px; background: #191c27; border: 1px solid rgba(255,255,255,.04); min-height: 170px; }
#matchViewModal .round-history-head { margin: 0 0 12px; text-align: center; font-size: 13px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; color: #fff; }
#matchViewModal .round-history-list { display: grid; gap: 6px; max-height: 190px; overflow-y: auto; }
#matchViewModal .rh-empty { padding: 12px; border-radius: 10px; background: #1e2130; text-align: center; font-size: 12.5px; color: #6b7083; font-weight: 700; }
#matchViewModal .rh-row { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 10px; background: #1e2130; border: 0; }
#matchViewModal .rh-label { min-width: 26px; font-size: 12px; font-weight: 800; color: #5b6074; }
#matchViewModal .rh-dice { display: flex; gap: 6px; }
#matchViewModal .rh-dice .die-sq { position: relative; width: 24px; height: 24px; border-radius: 6px; background: var(--sq, #555); box-shadow: 0 3px 8px -3px var(--sq, #555); }
#matchViewModal .rh-dice .die-sq::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; }
#matchViewModal .rh-dice .die-sq.c-red { --sq: var(--c-red); } #matchViewModal .rh-dice .die-sq.c-orange { --sq: var(--c-orange); }
#matchViewModal .rh-dice .die-sq.c-yellow { --sq: var(--c-yellow); } #matchViewModal .rh-dice .die-sq.c-green { --sq: var(--c-green); }
#matchViewModal .rh-dice .die-sq.c-blue { --sq: var(--c-blue); } #matchViewModal .rh-dice .die-sq.c-purple { --sq: var(--c-purple); }
#matchViewModal .rh-tie { font-size: 11px; font-weight: 900; color: #6b7083; text-transform: uppercase; letter-spacing: .06em; }
#matchViewModal .rh-result { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6b7083; }
#matchViewModal .rh-result b { font-weight: 900; }
#matchViewModal .rh-result em { font-style: normal; color: #4a4f63; }

/* hash line */
#matchViewModal .seed-line { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0; background: none; border: 0; min-height: 22px; }
#matchViewModal .seed-line .seed-gem { width: 14px; height: 14px; }
#matchViewModal .seed-line code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #6b7083; background: none; padding: 0; max-width: none; }
#matchViewModal .seed-line button { padding: 3px 6px; border: 0; border-radius: 6px; background: none; color: #6b7083; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 800; }
#matchViewModal .seed-line button:hover { color: #fff; background: rgba(255,255,255,.05); }
#matchViewModal .seed-line .icon-svg { width: 13px; height: 13px; }

/* wagers */
#matchViewModal .arena-actions:empty { display: none; }
#matchViewModal .arena-actions { display: flex; justify-content: center; }
#matchViewModal .wager-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
#matchViewModal .wager-col { display: grid; gap: 4px; align-content: start; padding: 0; background: none; border: 0; min-width: 0; }
#matchViewModal .wager-col-head { display: flex; align-items: center; gap: 6px; padding: 0 0 8px; border: 0; background: none; }
#matchViewModal .wager-col-head strong { font-size: 15px; font-weight: 900; color: #fff; }
#matchViewModal .wager-col-head .gem-icon { width: 15px; height: 15px; }
#matchViewModal .wager-line { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 0; border: 0; background: none; font-size: 13px; font-weight: 700; color: #d6d9e3; }
#matchViewModal .wl-art { width: 36px; height: 36px; display: grid; place-items: center; }
#matchViewModal .wl-art img, #matchViewModal .wl-art .pet-img { width: 34px; height: 34px; object-fit: contain; }
#matchViewModal .wl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#matchViewModal .wl-value { display: inline-flex; align-items: center; gap: 5px; font-weight: 900; color: #fff; font-size: 13px; }
#matchViewModal .wl-value .gem-icon { width: 13px; height: 13px; }

@media (max-width: 760px) {
  #matchViewModal .game-view-body { padding: 6px 14px 18px; }
  #matchViewModal .arena { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 14px; }
  #matchViewModal .arena:not(.three) .arena-player:nth-child(2) { grid-column: 2; }
  #matchViewModal .arena:not(.three) .arena-center { grid-column: 1 / -1; grid-row: 2; padding-top: 0; }
  #matchViewModal .ap-av, #matchViewModal .arena-avatar { width: 84px; height: 84px; }
  #matchViewModal .dice-row { gap: 9px; min-height: 0; }
  #matchViewModal .dice-row .die { width: 68px; height: 68px; border-radius: 14px; }
  #matchViewModal .dice-row .die::before { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
  #matchViewModal .wager-columns { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  #matchViewModal .round-history { min-height: 120px; }
}
#matchViewModal .dice-phase span { text-transform: none !important; letter-spacing: 0 !important; font-weight: 600 !important; font-size: 12.5px !important; color: #6b7083 !important; }
#matchViewModal .game-view-head .modal-close, #matchViewModal .game-view-head .modal-close.boxed { border: 0 !important; box-shadow: none !important; background: none !important; width: 32px; height: 32px; }
#matchViewModal .dice-win-pill.lose { opacity: 1; filter: none; }
#matchViewModal .arena { overflow: visible; }
#matchViewModal .game-view-head .modal-close:focus { outline: none !important; }
#matchViewModal .game-view-head .modal-close:focus-visible { outline: 2px solid rgba(255,255,255,.25) !important; outline-offset: 2px; border-radius: 8px; }
#matchViewModal .arena { grid-template-rows: auto !important; grid-auto-rows: auto !important; height: auto !important; max-height: none !important; }
#matchViewModal .game-view-body { grid-auto-rows: auto; grid-template-rows: none; }
@media (max-width: 760px) {
  #matchViewModal .arena { grid-template-rows: auto auto !important; padding: 0 !important; }
  #matchViewModal .arena-center { margin-bottom: 4px; }
}
#matchViewModal .game-view-card { max-height: calc(100dvh - 24px); display: flex; flex-direction: column; }
#matchViewModal .game-view-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; align-content: start; }
#matchViewModal .game-view-body > *, #matchViewModal #arena { min-height: auto !important; flex-shrink: 0; }
#matchViewModal .round-history { min-height: 150px !important; }
@media (max-width: 760px) { #matchViewModal .round-history { min-height: 110px !important; } }
#matchViewModal .round-history { height: auto !important; max-height: none !important; display: flex !important; flex-direction: column; overflow: hidden !important; }
#matchViewModal .round-history-list { flex: 1 1 auto; max-height: 200px !important; height: auto !important; overflow-y: auto !important; overflow-x: hidden; align-content: start; grid-auto-rows: max-content; }
#matchViewModal .rh-row { flex-shrink: 0; }
@media (max-width: 760px) {
  #matchViewModal .rh-row { gap: 8px; padding: 8px 10px; }
  #matchViewModal .rh-dice .die-sq { width: 20px; height: 20px; }
  #matchViewModal .rh-tie { display: none; }
}
#matchViewModal .round-history { overflow: visible !important; display: block !important; }
#matchViewModal .round-history-list { min-height: 0; }
#matchViewModal .game-view-body { grid-template-rows: none !important; grid-auto-rows: max-content !important; }
#matchViewModal .game-view-head .modal-close:focus-visible { outline: none !important; color: #fff; }
/* dice: sound button + BloxyPlay-style score for first to 2 / 3 */
#matchViewModal .dv-sound { position: absolute; left: 14px; top: 12px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: #8a90a3; cursor: pointer; }
#matchViewModal .dv-sound:hover { color: #fff; background: rgba(255,255,255,.05); }
#matchViewModal .dv-sound svg { width: 18px; height: 18px; }
#matchViewModal .dv-sound .snd-off { display: none; }
#matchViewModal .dv-sound.muted .snd-on { display: none; }
#matchViewModal .dv-sound.muted .snd-off { display: block; }
#matchViewModal .arena-score:not([hidden]) { display: flex !important; align-items: baseline; justify-content: center; gap: 10px; margin-top: 4px; font-size: 30px; font-weight: 900; line-height: 1; letter-spacing: -.01em; }
#matchViewModal .arena-score b { text-shadow: 0 0 18px currentColor; font-variant-numeric: tabular-nums; }
#matchViewModal .arena-score .sep { color: #4a4f63; font-size: 24px; }
#matchViewModal .arena-score small { align-self: center; margin-left: 4px; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,.05); font-size: 10.5px; font-weight: 800; color: #6b7083; letter-spacing: 0; }
#matchViewModal .arena-score.bump b { animation: scoreBump .45s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes scoreBump { 40% { transform: scale(1.35); } }
@media (max-width: 760px) { #matchViewModal .arena-score:not([hidden]) { font-size: 24px; } }
/* score as filling dots (BloxyPlay style), centred under the dice */
#matchViewModal .arena-center > * { align-self: center; }
#matchViewModal .arena-score:not([hidden]) { display: flex !important; align-items: center; justify-content: center; gap: 14px; width: 100%; margin: 6px 0 0; font-size: 0; line-height: 0; }
#matchViewModal .arena-score .pip-group { display: flex; gap: 7px; }
#matchViewModal .arena-score .pip-group i { display: block; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #3a3f52; background: transparent; transition: background .25s ease, border-color .25s ease, box-shadow .25s ease; }
#matchViewModal .arena-score .pip-group i.on { background: var(--pc); border-color: var(--pc); box-shadow: 0 0 10px var(--pc); }
#matchViewModal .arena-score .pip-group i.pop { animation: pipPop .45s cubic-bezier(.2, .9, .3, 1.5); }
@keyframes pipPop { 0% { transform: scale(.3); } 60% { transform: scale(1.45); } 100% { transform: scale(1); } }
#matchViewModal .arena-score .pip-sep { width: 1px; height: 14px; background: #3a3f52; }
.rank-chip-wrap[hidden] { display: none !important; }
#topBotStatusPill, #topBotStatusPill[hidden] { display: none !important; }
