/* ---------- Level ring, XP bar, sidebar badges ---------- */

.level-ring {
  --p: 0;
  --rank: #d08a4c;
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(var(--rank) calc(var(--p) * 360deg), var(--bg-3) 0);
  transition: --p 600ms;
}
.level-ring > .avatar { box-shadow: 0 0 0 3px var(--bg-1); }
.level-ring__badge {
  position: absolute;
  right: -6px;
  bottom: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--rank);
  color: #0b111d;
  font-size: 10px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-1);
}
.level-ring.is-levelup { animation: ring-pop 700ms var(--ease-spring); }
@keyframes ring-pop { 40% { transform: scale(1.25); box-shadow: 0 0 20px var(--rank); } }

.xp-bar {
  display: block;
  height: 6px;
  border-radius: 6px;
  background: var(--bg-0);
  overflow: hidden;
}
.xp-bar__fill {
  --p: 0;
  display: block;
  height: 100%;
  width: calc(var(--p) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  transition: width 600ms var(--ease-out);
}
.xp-bar--big { height: 10px; }
.menu__xp { display: grid; gap: 6px; padding: 0 10px 10px; }
.menu__xp-text { color: var(--text-3); font-size: 11.5px; font-weight: 600; }

.nav__dot {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--win);
  animation: pulse 1.4s ease-in-out infinite;
}
.nav__count {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.shell.is-collapsed .nav__dot, .shell.is-collapsed .nav__count {
  position: absolute;
  top: 6px;
  right: 10px;
  margin: 0;
}

/* ---------- Level-up overlay ---------- */

.levelup {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  background: rgb(3 6 12 / 0.7);
  cursor: pointer;
  animation: fade-in 240ms var(--ease-out);
}
.levelup.is-leaving { pointer-events: none; animation: fade-out 300ms forwards; }
.levelup__card {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 32px 48px;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rank) 30%, var(--bg-2)), var(--bg-1) 70%);
  box-shadow: 0 0 0 2px var(--rank), 0 30px 80px rgb(0 0 0 / 0.6), 0 0 80px color-mix(in srgb, var(--rank) 40%, transparent);
  animation: bigwin-in 700ms var(--ease-spring);
}
.levelup__eyebrow { color: var(--text-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; }
.levelup__level { font-family: var(--font-display); font-size: 96px; font-weight: 900; line-height: 1; color: var(--rank); }
.levelup__rank { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.levelup__reward { margin-top: 8px; padding: 6px 14px; border-radius: 999px; background: var(--win); color: var(--win-ink); font-weight: 800; }

/* ---------- Wheel ---------- */

.wheel-layout {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 32px;
  border-radius: 24px;
  background: radial-gradient(500px 400px at 30% 50%, rgb(255 197 61 / 0.1), transparent 70%), var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
}
.wheel { position: relative; }
.wheel svg { width: 100%; height: auto; filter: drop-shadow(0 20px 40px rgb(0 0 0 / 0.5)); }
.wheel__disc { transform-box: fill-box; transform-origin: center; }
.wheel__bulb { animation: pulse 900ms steps(2) infinite; }
.wheel__bulb:nth-of-type(even) { animation-delay: -450ms; }
.wheel__pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 34px;
  height: 42px;
  translate: -50% 0;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.5));
}
.wheel__side { display: grid; gap: 16px; align-content: center; }
.wheel__status { color: var(--text-2); font-weight: 650; }
.wheel__prize {
  display: grid;
  gap: 2px;
  padding: 16px 20px;
  border-radius: var(--radius-l);
  background: color-mix(in srgb, var(--win) 14%, var(--bg-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--win) 40%, transparent);
  animation: result-in 500ms var(--ease-spring);
}
.wheel__prize span { color: var(--text-2); font-weight: 650; }
.wheel__prize strong { font-family: var(--font-display); font-size: 30px; color: var(--win); }
.wheel__odds { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; }
.wheel__odds li { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; background: var(--bg-2); color: var(--text-2); font-weight: 600; }

/* ---------- Missions and achievements ---------- */

.missions__reset { color: var(--text-3); font-weight: 650; font-size: 13px; }
.missions { display: grid; gap: 10px; }
.mission {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
  animation: rise-in 360ms var(--ease-out) backwards;
}
.mission:nth-child(2) { animation-delay: 60ms; }
.mission:nth-child(3) { animation-delay: 120ms; }
.mission.is-complete { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 24px rgb(255 197 61 / 0.12); }
.mission.is-claimed { opacity: 0.6; }
.mission__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-3);
  color: var(--text-2);
}
.mission.is-complete .mission__icon { background: var(--accent); color: var(--accent-ink); }
.mission.is-claimed .mission__icon { background: var(--win); color: var(--win-ink); }
.mission__body { display: grid; gap: 6px; }
.mission__bar { height: 8px; border-radius: 8px; background: var(--bg-0); overflow: hidden; }
.mission__bar span {
  --p: 0;
  display: block;
  height: 100%;
  width: calc(var(--p) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--info), var(--win));
  transition: width 600ms var(--ease-out);
}
.mission__progress { color: var(--text-3); font-size: 12px; font-weight: 650; }

.achievements__count { color: var(--text-2); margin-bottom: 12px; font-weight: 600; }
.achievements__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.achievement {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-3);
  font-size: 12.5px;
}
.achievement strong { color: var(--text-2); font-size: 14px; }
.achievement__icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 6px; border-radius: 50%; background: var(--bg-2); }
.achievement.is-unlocked { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--bg-1)), var(--bg-1) 60%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text-2); }
.achievement.is-unlocked strong { color: var(--text); }
.achievement.is-unlocked .achievement__icon { background: var(--accent); color: var(--accent-ink); }
.achievement__date { color: var(--text-3); font-size: 11.5px; }

/* ---------- Leaderboard ---------- */

.leaderboard { display: grid; gap: 6px; }
.leaderboard__skeleton { height: 320px; }
.leader {
  display: grid;
  grid-template-columns: 36px auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-m);
  background: var(--bg-1);
  font-weight: 650;
  animation: rise-in 300ms var(--ease-out) backwards;
}
.leader__rank { color: var(--text-3); font-family: var(--font-display); font-weight: 800; text-align: center; }
.leader__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader__bets { color: var(--text-3); font-size: 12.5px; }
.leader__value { min-width: 120px; text-align: right; font-weight: 800; }
.leader.is-top { background: linear-gradient(90deg, color-mix(in srgb, var(--medal) 16%, var(--bg-1)), var(--bg-1) 60%); box-shadow: inset 3px 0 0 var(--medal); }
.leader.is-top .leader__rank { color: var(--medal); font-size: 18px; }
.leader.is-top-1 { --medal: #ffc53d; }
.leader.is-top-2 { --medal: #c3cbdc; }
.leader.is-top-3 { --medal: #d08a4c; }
.leader.is-me { box-shadow: inset 0 0 0 2px var(--info); }

/* ---------- Profile ---------- */

.profile-card {
  --rank: var(--accent);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 28px;
  border-radius: 24px;
  background: radial-gradient(500px 300px at 0% 0%, color-mix(in srgb, var(--rank) 20%, transparent), transparent 70%), var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
}
.profile-card__main { display: grid; gap: 8px; }
.profile-card__main h2 { font-size: 28px; }
.profile-card__rank { color: var(--rank); font-weight: 800; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.profile-card__xp { color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.profile-card__facts { display: grid; gap: 12px; margin: 0; }
.profile-card__facts div { padding: 10px 16px; border-radius: var(--radius-m); background: var(--bg-2); }
.profile-card__facts dt { color: var(--text-3); font-size: 12px; font-weight: 600; }
.profile-card__facts dd { margin: 0; font-size: 18px; font-weight: 800; }
.profile-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.profile-totals div { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius-m); background: var(--bg-1); }
.profile-totals span { color: var(--text-3); font-size: 12px; font-weight: 600; }
.profile-totals strong { font-size: 18px; }
.profile-totals .is-win { color: var(--win); }
.profile-totals .is-loss { color: var(--loss); }

/* ---------- Live feed ---------- */

.feed .cell-user { display: inline-flex; align-items: center; gap: 8px; }
.section__head h2 .badge { vertical-align: middle; margin-right: 6px; }

@media (max-width: 900px) {
  .wheel-layout { grid-template-columns: 1fr; padding: 20px; }
  .profile-card { grid-template-columns: 1fr; justify-items: start; }
  .leader { grid-template-columns: 30px auto minmax(0, 1fr) auto; }
  .leader__bets { display: none; }
  .feed th:nth-child(3), .feed td:nth-child(3) { display: none; }
}
@media (max-width: 600px) {
  .mission { grid-template-columns: minmax(0, 1fr); }
  .mission__icon { display: none; }
  .feed th:nth-child(4), .feed td:nth-child(4) { display: none; }
}

/* ---------- Crown coin, VIP club, rakeback ---------- */

.coin-mark { display: inline-grid; width: 22px; height: 22px; flex: none; }
.coin-mark svg { width: 100%; height: 100%; }
.wallet-pill__coin { width: 24px; height: 24px; filter: drop-shadow(0 2px 4px rgb(255 179 0 / 0.35)); }

.rakeback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 16px;
  padding: 24px 28px;
  border-radius: 20px;
  background: radial-gradient(420px 220px at 0% 50%, rgb(255 197 61 / 0.14), transparent 70%), var(--bg-1);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.rakeback__main { display: grid; gap: 6px; }
.rakeback__label { color: var(--text-2); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.rakeback__amount { display: flex; align-items: center; gap: 12px; }
.rakeback__amount strong { font-family: var(--font-display); font-size: 36px; font-weight: 900; }
.rakeback__coin { width: 38px; height: 38px; }
.rakeback__note { max-width: 560px; color: var(--text-3); font-size: 13px; }

.vip-explainer { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.vip-explainer > div { display: grid; gap: 6px; padding: 16px 18px; border-radius: var(--radius-l); background: var(--bg-1); }
.vip-explainer p { color: var(--text-2); font-size: 13.5px; }

.vip-ladder { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.vip-tier {
  --rank: var(--accent);
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
  opacity: 0.7;
  transition: opacity 200ms, box-shadow 200ms;
}
.vip-tier.is-reached { opacity: 1; }
.vip-tier.is-current {
  opacity: 1;
  background: linear-gradient(160deg, color-mix(in srgb, var(--rank) 16%, var(--bg-1)), var(--bg-1) 60%);
  box-shadow: inset 0 0 0 2px var(--rank), 0 0 30px color-mix(in srgb, var(--rank) 20%, transparent);
}
.vip-tier__head { display: flex; align-items: center; gap: 10px; }
.vip-tier__head strong { font-family: var(--font-display); font-size: 17px; color: var(--rank); }
.vip-tier__gem { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--rank) 20%, var(--bg-2)); color: var(--rank); }
.vip-tier__rate { margin-left: auto; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); font-size: 12px; font-weight: 700; }
.vip-tier__levels { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.vip-tier__levels li { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; background: var(--bg-2); color: var(--text-2); font-weight: 600; }

.profile-links { display: flex; gap: 10px; margin-top: 14px; }

@media (max-width: 700px) {
  .rakeback { flex-direction: column; align-items: stretch; padding: 20px; }
}
