* { box-sizing: border-box; font-family: Outfit, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif; }
body {
  margin: 0;
  color: #eef2ff;
  background:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(88, 120, 255, 0.22), transparent 55%),
    radial-gradient(circle at 18% 12%, rgba(113, 83, 255, 0.28), transparent 38%),
    radial-gradient(circle at 88% 8%, rgba(0, 200, 255, 0.14), transparent 42%),
    linear-gradient(168deg, #060912 0%, #0b1020 45%, #070b14 100%);
}
.layout { min-height: 100vh; padding: 14px; }
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 40;
  padding: 0 16px 0 12px;
  background:
    linear-gradient(120deg, rgba(58, 74, 140, 0.26), transparent 40%),
    rgba(20, 27, 45, 0.72);
  border: 1px solid rgba(183, 203, 255, 0.22);
  border-radius: 16px;
  box-shadow: 0 16px 30px rgba(3, 7, 18, 0.5);
  backdrop-filter: blur(10px);
  isolation: isolate;
  overflow: visible;
}
.topbar::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 15px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.04);
  z-index: -1;
}
.brand-wrap { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(194, 214, 255, 0.46);
  background: radial-gradient(circle at 35% 22%, rgba(129, 156, 255, 0.26), rgba(11, 18, 38, 0.94));
  box-shadow:
    0 12px 28px rgba(97, 123, 255, 0.36),
    0 0 0 3px rgba(114, 143, 230, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  padding: 5px;
}
.brand-texts { min-width: 0; }
.brand {
  font-size: 48px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-shadow: 0 10px 30px rgba(122, 149, 255, 0.24);
}
.brand-donut,
.brand-crash {
  display: inline-block;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}
.brand-donut {
  background-image: linear-gradient(180deg, #f7faff 0%, #e3ecff 55%, #d3e0ff 100%);
}
.brand-crash {
  background-image: linear-gradient(180deg, #8fc1ff 0%, #5f95ff 56%, #4f7cf2 100%);
  text-shadow: 0 10px 30px rgba(83, 130, 255, 0.34);
}
.brand-sub {
  margin-top: 3px;
  font-size: 11px;
  color: #9fb2df;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  animation: floatPulse 3.8s ease-in-out infinite;
  display: none;
}
.top-right { display: flex; align-items: center; gap: 10px; }
.top-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(142, 165, 220, 0.3);
  background: linear-gradient(180deg, rgba(21, 34, 62, 0.94), rgba(12, 22, 44, 0.88));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.wallet-chip__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
}
.wallet-chip__icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #b9d8ff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(118, 178, 255, 0.4));
}
.wallet-chip__value {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f0f6ff;
  transition: transform 0.2s ease, text-shadow 0.2s ease;
}
.wallet-chip__value.is-bumping {
  transform: translateY(-1px) scale(1.04);
  text-shadow: 0 0 18px rgba(130, 188, 255, 0.45);
}
.wallet-chip__add {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border: 0;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  color: #062412;
  background: linear-gradient(180deg, #3ce08d, #24b46e);
}
.top-link {
  text-decoration: none;
  border: 1px solid rgba(156, 183, 248, 0.28);
  background: rgba(18, 31, 56, 0.8);
  color: #cfe0ff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
}
.top-link:hover { color: #ffffff; border-color: rgba(172, 197, 255, 0.45); }
.top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 16px;
  font-size: 11px;
  border-radius: 999px;
  min-width: 88px;
  border: 1px solid rgba(120, 145, 210, 0.35);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.55px;
  text-transform: uppercase;
  color: #f2f6ff;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(52, 72, 118, 0.95), rgba(32, 46, 82, 0.98));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.22) inset,
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 8px 18px rgba(4, 8, 20, 0.42);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}
a.top-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(160, 188, 255, 0.5);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.22) inset,
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 12px 22px rgba(4, 8, 20, 0.5);
  filter: brightness(1.06);
}
@keyframes topPromoPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.22) inset,
      0 2px 0 rgba(255, 255, 255, 0.2) inset,
      0 0 28px rgba(56, 240, 168, 0.35),
      0 10px 26px rgba(12, 60, 42, 0.45);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.22) inset,
      0 2px 0 rgba(255, 255, 255, 0.26) inset,
      0 0 36px rgba(56, 240, 168, 0.55),
      0 14px 32px rgba(12, 60, 42, 0.5);
  }
}
.top-promo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.65px;
  text-transform: uppercase;
  color: #f0fff9;
  border: 1px solid rgba(160, 255, 210, 0.55);
  background: linear-gradient(168deg, #6fffd4 0%, #38e8a8 28%, #1cc97c 72%, #12965f 100%);
  text-shadow: 0 1px 2px rgba(0, 36, 24, 0.45), 0 0 18px rgba(200, 255, 230, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.22) inset,
    0 2px 0 rgba(255, 255, 255, 0.22) inset,
    0 0 28px rgba(56, 240, 168, 0.38),
    0 10px 26px rgba(12, 60, 42, 0.45);
  animation: topPromoPulse 2.6s ease-in-out infinite;
  transition: transform 0.18s ease, filter 0.2s ease;
  position: relative;
  overflow: hidden;
}
.top-promo-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 18%, rgba(255, 255, 255, 0.45) 48%, transparent 78%);
  transform: translateX(-130%);
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1);
  pointer-events: none;
}
.top-promo-btn:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.07) saturate(1.05);
  animation: none;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.22) inset,
    0 2px 0 rgba(255, 255, 255, 0.28) inset,
    0 0 40px rgba(72, 255, 190, 0.55),
    0 16px 34px rgba(10, 70, 48, 0.5);
}
.top-promo-btn:hover::after {
  transform: translateX(130%);
}
.top-promo-btn:active {
  transform: translateY(0) scale(0.98);
  filter: brightness(0.96);
}
.profile-menu-wrap { position: relative; }
.profile-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  padding: 0;
  border: 1px solid rgba(162, 184, 236, 0.3);
  background: rgba(16, 26, 48, 0.9);
  position: relative;
}
.profile-head {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  display: block;
}
.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  padding: 10px;
  display: grid;
  gap: 6px;
  border-radius: 14px;
  border: 1px solid rgba(139, 164, 225, 0.3);
  background: linear-gradient(175deg, rgba(12, 24, 44, 0.98), rgba(7, 17, 33, 0.96));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.36);
  z-index: 120;
}
.profile-menu[hidden] { display: none !important; }
.profile-menu__item {
  height: 42px;
  border: 0;
  text-align: left;
  border-radius: 10px;
  padding: 0 12px;
  background: transparent;
  color: #cfe0ff;
  font-size: 16px;
  font-weight: 600;
}
.profile-menu__item:hover { background: rgba(67, 91, 142, 0.25); color: #f4f8ff; }
.profile-menu__item--logout { color: #ffb6b6; }
.profile-menu__item--logout:hover { background: rgba(132, 42, 58, 0.25); color: #ffd1d1; }
.hidden { display: none !important; }
#authBtn.hidden, .profile-menu-wrap.hidden, .top-center.hidden { display: none !important; }
#walletAddBtn:disabled { opacity: 0.6; cursor: not-allowed; }
.profile-modal[hidden] { display: none !important; }
.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 16, 0.7);
  backdrop-filter: blur(4px);
}
.profile-modal__dialog {
  position: relative;
  width: min(980px, calc(100vw - 30px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(153, 179, 234, 0.35);
  background: linear-gradient(168deg, rgba(9, 22, 42, 0.98), rgba(5, 14, 29, 0.98));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  animation: profileModalIn 220ms ease-out;
}
.profile-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid rgba(129, 153, 206, 0.25);
}
.profile-modal__head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #f2f7ff;
}
.profile-modal__head p {
  margin: 4px 0 0;
  color: #9eb0d9;
  font-size: 13px;
}
.profile-modal__close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  font-size: 26px;
  line-height: 1;
  color: #d8e4ff;
  background: rgba(54, 74, 122, 0.5);
}
.profile-theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 6px;
}
.theme-chip {
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(140, 164, 219, 0.4);
  background: rgba(30, 46, 78, 0.6);
  color: #c8d8ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 0 10px;
  transition: all 0.16s ease;
}
.theme-chip:hover { border-color: rgba(173, 197, 255, 0.7); color: #f2f7ff; }
.theme-chip.active {
  color: #ecfff7;
  border-color: rgba(114, 220, 175, 0.82);
  background: linear-gradient(130deg, rgba(47, 122, 95, 0.7), rgba(39, 69, 123, 0.8));
}
.profile-modal__body {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 14px;
  padding: 16px;
}
.profile-modal__nav {
  display: grid;
  gap: 8px;
  align-content: flex-start;
}
.profile-nav-btn {
  height: 44px;
  border-radius: 11px;
  border: 1px solid rgba(117, 139, 190, 0.32);
  background: rgba(24, 37, 64, 0.6);
  color: #d1defb;
  text-align: left;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-nav-btn .nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.94;
}
.profile-nav-btn .nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.profile-nav-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 173, 231, 0.55);
  background: rgba(36, 52, 88, 0.72);
}
.profile-nav-btn.active {
  border-color: rgba(123, 224, 171, 0.8);
  color: #ecfff6;
  background: linear-gradient(140deg, rgba(38, 96, 89, 0.7), rgba(26, 47, 73, 0.7));
  box-shadow: 0 10px 26px rgba(46, 181, 133, 0.18);
}
.profile-modal__content {
  min-height: 420px;
  border-radius: 14px;
  border: 1px solid rgba(112, 136, 190, 0.22);
  background:
    radial-gradient(circle at 80% 0%, rgba(71, 118, 255, 0.15), transparent 40%),
    rgba(10, 20, 39, 0.7);
  padding: 16px;
}
.profile-panel { display: none; }
.profile-panel.active {
  display: block;
  animation: profilePanelIn 240ms ease;
}
.profile-panel__label {
  margin: 4px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #90a9dd;
}
.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(130, 157, 213, 0.25);
  background: linear-gradient(145deg, rgba(18, 33, 61, 0.85), rgba(13, 25, 45, 0.75));
}
.profile-hero img {
  width: 66px;
  height: 66px;
  border-radius: 14px;
  border: 1px solid rgba(163, 186, 237, 0.45);
}
.profile-hero__name { font-size: 22px; font-weight: 800; }
.profile-hero__tier { font-size: 12px; color: #9fc9b2; letter-spacing: 0.5px; text-transform: uppercase; }
.profile-hero__badge {
  margin-left: auto;
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #dcfff0;
  border: 1px solid rgba(113, 214, 165, 0.6);
  background: rgba(46, 138, 104, 0.35);
}
.profile-kpi-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.profile-kpi {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(126, 150, 203, 0.25);
  background: rgba(15, 27, 50, 0.74);
  padding: 12px 13px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.profile-kpi::after {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(127, 185, 255, 0.26), transparent 38%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.profile-kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(151, 176, 236, 0.5);
  box-shadow: 0 10px 24px rgba(8, 20, 44, 0.38);
}
.profile-kpi:hover::after { opacity: 1; }
.profile-kpi span { font-size: 12px; color: #99acd6; }
.profile-kpi strong {
  margin-top: 8px;
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 20px;
  color: #f3f7ff;
}
.profile-card-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.profile-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(127, 150, 203, 0.24);
  background: linear-gradient(160deg, rgba(20, 34, 63, 0.8), rgba(14, 24, 43, 0.7));
  padding: 14px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.profile-card::after {
  content: "";
  position: absolute;
  inset: -35%;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(121, 214, 173, 0.24), transparent 42%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.profile-card:hover {
  transform: translateY(-2px);
  border-color: rgba(158, 184, 241, 0.56);
  box-shadow: 0 12px 28px rgba(8, 18, 40, 0.42);
}
.profile-card:hover::after { opacity: 1; }
.profile-card h4 { margin: 0 0 8px; font-size: 17px; }
.profile-card p { margin: 0 0 14px; color: #a7b7de; font-size: 13px; line-height: 1.45; }
.profile-card__btn {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: #07220d;
  background: linear-gradient(180deg, #58e9a7, #2fc481);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
.profile-card__btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 8px 18px rgba(47, 196, 129, 0.32);
}
.profile-card__btn--ghost {
  color: #dce8ff;
  background: rgba(64, 86, 135, 0.42);
  border: 1px solid rgba(137, 160, 215, 0.3);
}
.profile-card__btn--ghost:hover {
  box-shadow: 0 8px 18px rgba(74, 105, 182, 0.25);
}
.wallet-form-card {
  border-radius: 12px;
  border: 1px solid rgba(124, 152, 208, 0.28);
  background: linear-gradient(160deg, rgba(12, 28, 52, 0.84), rgba(10, 20, 39, 0.78));
  padding: 14px;
}
.wallet-form-card + .wallet-form-card { margin-top: 10px; }
.wallet-form-card label {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  color: #d8e6ff;
  font-weight: 600;
}
.wallet-form-card input {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(117, 142, 196, 0.35);
  background: rgba(8, 17, 34, 0.66);
  color: #e4edff;
  font-size: 15px;
  padding: 0 12px;
  margin-bottom: 10px;
}
.wallet-form-card p {
  margin: 0 0 12px;
  font-size: 12px;
  color: #9db3df;
}
.wallet-command {
  margin-top: 12px;
  border: 1px solid rgba(115, 205, 165, 0.32);
  border-radius: 10px;
  background: rgba(10, 23, 36, 0.66);
  padding: 10px;
}
.wallet-command__title {
  font-weight: 700;
  color: #e7fdf2;
  margin-bottom: 8px;
}
.wallet-command__row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.wallet-command__row code {
  flex: 1;
  border-radius: 8px;
  border: 1px solid rgba(103, 169, 245, 0.25);
  background: rgba(8, 14, 28, 0.82);
  padding: 9px 10px;
  color: #84f0b8;
  font-size: 14px;
}
.wallet-command__hint {
  margin-top: 8px;
  font-size: 12px;
  color: #9eb5df;
}
.referral-kpi-footnote {
  margin-top: 10px;
  margin-bottom: 4px;
  line-height: 1.45;
}
.referral-card #referralCodeText {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.4px;
  color: #a8f3c7;
}
.wallet-history {
  border-radius: 12px;
  border: 1px solid rgba(121, 149, 203, 0.26);
  background: rgba(8, 17, 33, 0.62);
  padding: 10px;
}
.wallet-history__row {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 0.7fr;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: #d6e3ff;
  padding: 7px 6px;
  border-bottom: 1px solid rgba(96, 120, 170, 0.25);
}
.wallet-history__row:last-child { border-bottom: 0; }
.wallet-history__empty {
  font-size: 13px;
  color: #9fb2dd;
  padding: 6px 4px;
}
.wallet-pill {
  justify-self: start;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(150, 172, 222, 0.36);
  color: #cfdefa;
}
.wallet-pill--ok {
  border-color: rgba(106, 221, 169, 0.58);
  color: #b8f2d8;
}
.wallet-pill--bad {
  border-color: rgba(255, 118, 137, 0.58);
  color: #ffbecb;
}
.profile-big {
  display: block;
  margin-top: 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 30px;
  letter-spacing: -0.03em;
  color: #f2f8ff;
}

@keyframes profileModalIn {
  from { transform: translateY(8px) scale(0.99); opacity: 0.4; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes profilePanelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.profile-modal[data-theme="midnight"] .profile-modal__dialog {
  border-color: rgba(110, 133, 194, 0.3);
  background: linear-gradient(168deg, rgba(6, 13, 27, 0.98), rgba(3, 8, 20, 0.98));
}
.profile-modal[data-theme="midnight"] .profile-modal__content {
  background: radial-gradient(circle at 80% 0%, rgba(58, 92, 188, 0.12), transparent 40%), rgba(8, 14, 28, 0.72);
}
.profile-modal[data-theme="midnight"] .profile-nav-btn.active {
  border-color: rgba(140, 162, 252, 0.85);
  background: linear-gradient(140deg, rgba(54, 70, 132, 0.76), rgba(28, 43, 86, 0.86));
}
.profile-modal[data-theme="royal"] .profile-modal__dialog {
  border-color: rgba(177, 150, 241, 0.38);
  background: linear-gradient(168deg, rgba(20, 11, 40, 0.98), rgba(9, 8, 25, 0.98));
}
.profile-modal[data-theme="royal"] .profile-modal__content {
  background: radial-gradient(circle at 80% 0%, rgba(175, 95, 255, 0.16), transparent 45%), rgba(20, 13, 41, 0.72);
}
.profile-modal[data-theme="royal"] .profile-nav-btn.active {
  border-color: rgba(211, 158, 255, 0.8);
  background: linear-gradient(140deg, rgba(95, 52, 142, 0.78), rgba(58, 34, 112, 0.82));
}
.profile-modal[data-theme="royal"] .profile-card__btn {
  color: #22132f;
  background: linear-gradient(180deg, #d89bff, #b973ff);
}
.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  border-radius: 12px;
  border: 1px solid rgba(126, 150, 206, 0.4);
  background: linear-gradient(170deg, rgba(16, 31, 58, 0.95), rgba(10, 20, 39, 0.95));
  color: #dbe7ff;
  padding: 10px 12px;
  box-shadow: 0 12px 26px rgba(2, 8, 18, 0.45);
  animation: toastIn 180ms ease;
  font-size: 13px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}
.toast__row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast__icon {
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9bc0ff;
}
.toast__icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toast__text {
  flex: 1;
  min-width: 0;
}
.toast__count {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(160, 182, 235, 0.4);
  background: rgba(54, 76, 122, 0.42);
  color: #cfe0ff;
}
.toast__close {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 7px;
  line-height: 1;
  color: #d7e5ff;
  background: rgba(58, 81, 132, 0.45);
}
.toast__progress {
  margin-top: 8px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(146, 184, 255, 0.88), rgba(114, 231, 175, 0.82));
  transform-origin: left center;
  animation: toastProgress 2.8s linear forwards;
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
}
.toast.is-bump {
  transform: translateY(-2px) scale(1.01);
}
.toast--success { border-color: rgba(95, 220, 161, 0.55); }
.toast--error { border-color: rgba(255, 122, 140, 0.55); }
.toast--info { border-color: rgba(126, 172, 255, 0.55); }
.toast--success .toast__icon { color: #6ce3ab; }
.toast--error .toast__icon { color: #ff9cae; }
.toast--info .toast__icon { color: #9bc0ff; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastProgress {
  from { transform: scaleX(1); opacity: 0.9; }
  to { transform: scaleX(0); opacity: 0.3; }
}

@media (max-width: 980px) {
  .profile-modal__body { grid-template-columns: 1fr; }
  .profile-modal__nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-card-row, .profile-kpi-grid { grid-template-columns: 1fr; }
  .profile-hero__badge { display: none; }
  .profile-theme-switch { display: none; }
  .wallet-history__row { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 980px) {
  .wallet-chip__value { font-size: 17px; }
  .wallet-chip__icon { font-size: 13px; }
  .wallet-chip__add { width: 22px; height: 22px; font-size: 18px; }
  .topbar { gap: 8px; }
  .brand { font-size: 30px; }
  .top-center { left: 52%; }
}
.main-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 2fr 0.88fr 1fr;
  gap: 12px;
  height: calc(100vh - 104px);
  position: relative;
}
.main-grid::before {
  content: "";
  position: absolute;
  inset: -6px -6px auto -6px;
  height: 180px;
  background: radial-gradient(circle at 50% 0%, rgba(99, 131, 246, 0.16), transparent 64%);
  pointer-events: none;
}
.panel {
  background: linear-gradient(165deg, rgba(22, 30, 50, 0.88), rgba(14, 20, 36, 0.92));
  border: 1px solid rgba(169, 190, 255, 0.14);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 16px 40px rgba(2, 6, 18, 0.55);
  overflow: hidden;
  position: relative;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.05), transparent 38%);
  pointer-events: none;
  z-index: 0;
}
.panel > * { position: relative; z-index: 1; }
.panel:hover {
  border-color: rgba(175, 198, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 45px rgba(2, 6, 18, 0.62);
}
.section-kicker {
  display: none;
  font-size: 10px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: #98acda;
  font-weight: 700;
  margin: 2px 0 6px 2px;
  opacity: 0.9;
  animation: sectionReveal 420ms ease both;
}
.section-kicker--tabs { margin: 0; }
.section-kicker--edge { margin: 0; }
.left-col { display: grid; grid-template-rows: 1.1fr 1fr; gap: 12px; min-height: 0; }
.graph-panel {
  position: relative;
  padding: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 10%, rgba(101, 132, 240, 0.18), transparent 40%),
    linear-gradient(165deg, rgba(20, 30, 56, 0.94), rgba(10, 18, 36, 0.94));
}
.graph-max-bet {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(168, 190, 235, 0.72);
  pointer-events: none;
}
.graph-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 18%, rgba(255, 255, 255, 0.06), transparent 52%);
  pointer-events: none;
  z-index: 0;
}
.panel-title { color: #e9eeff; text-align: center; font-size: 17px; font-weight: 700; letter-spacing: 0.7px; margin-top: 4px; }
.round-state { position: relative; z-index: 2; text-align: center; font-size: 12px; color: #aebce0; margin-top: 16px; text-transform: uppercase; letter-spacing: 1px; }
.mult-stage { position: relative; z-index: 2; max-width: 520px; margin: 6px auto 0; }
.countdown-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(167, 188, 243, 0.18);
  overflow: hidden;
  margin-bottom: 10px;
}
.countdown-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5ad0ff, #7b8dff 45%, #c4a7ff);
  box-shadow: 0 0 14px rgba(122, 168, 255, 0.55);
  transition: width 0.08s linear;
}
.mult-stage.mult-running .countdown-fill { width: 100%; opacity: 0.35; }
.multiplier {
  position: relative;
  z-index: 2;
  text-align: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(52px, 10vw, 92px);
  font-weight: 800;
  margin-top: 4px;
  color: #f4f7ff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  text-shadow: 0 0 40px rgba(120, 155, 255, 0.45), 0 12px 36px rgba(0, 0, 0, 0.45);
  transition: color 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.round-hint { position: relative; z-index: 2; text-align: center; margin-top: 2px; font-size: 11px; color: #b7c4e4; letter-spacing: 0.7px; }
.multiplier.mult-running { transform: scale(1.01); }
.multiplier.crashed {
  color: #ff9a9a;
  transform: scale(1.04);
  text-shadow: 0 0 28px rgba(255, 106, 106, 0.55), 0 10px 28px rgba(0, 0, 0, 0.5);
}
.scale-lines { position: absolute; left: 0; right: 0; top: 54px; bottom: 78px; background-image: linear-gradient(to bottom, rgba(175,186,219,0.14) 1px, transparent 1px), linear-gradient(to right, rgba(175,186,219,0.08) 1px, transparent 1px); background-size: 100% 28px, 56px 100%; pointer-events: none; }
.graph-canvas { position: absolute; left: 0; right: 0; top: 54px; bottom: 78px; width: 100%; height: calc(100% - 132px); z-index: 1; pointer-events: none; }
.crash-overlay {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 60px;
  bottom: 90px;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  background: radial-gradient(circle at center, rgba(255, 95, 95, 0.16), rgba(8, 12, 24, 0.08) 55%, transparent 78%);
  pointer-events: none;
}
.crash-overlay.is-visible { display: flex; }
.graph-panel .mult-stage,
.graph-panel .round-hint,
.graph-panel .subinfo {
  transition: opacity 0.18s ease;
}
.graph-panel.crash-mode .mult-stage,
.graph-panel.crash-mode .round-hint,
.graph-panel.crash-mode .subinfo {
  opacity: 0;
}
.crash-overlay__title {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(44px, 8.4vw, 104px);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ff6363;
  text-shadow: 0 0 26px rgba(255, 84, 84, 0.52), 0 8px 28px rgba(0, 0, 0, 0.45);
}
.crash-overlay__value {
  margin-top: 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(32px, 6.2vw, 72px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgba(255, 98, 98, 0.96);
  text-shadow: 0 0 20px rgba(255, 84, 84, 0.45);
}
.subinfo { margin-top: 18px; position: relative; display: flex; justify-content: space-between; color: #96a6cc; font-size: 11px; z-index: 2; }
.history-list {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(8, 12, 24, 0.55);
  border: 1px solid rgba(120, 145, 210, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 140, 200, 0.35) transparent;
}
.history-list::-webkit-scrollbar { height: 5px; }
.history-list::-webkit-scrollbar-thumb {
  background: rgba(120, 140, 200, 0.35);
  border-radius: 999px;
}
.bubble {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(123, 164, 129, 0.45);
  background: linear-gradient(180deg, rgba(36, 72, 48, 0.55), rgba(22, 40, 30, 0.75));
  color: #b8ffc8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: default;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.bubble[role="listitem"] { cursor: pointer; }
.bubble:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.bubble--t1 { border-color: rgba(100, 140, 120, 0.4); color: #a8e8c0; background: linear-gradient(180deg, rgba(32, 58, 44, 0.75), rgba(18, 32, 26, 0.9)); }
.bubble--t2 { border-color: rgba(220, 170, 80, 0.45); color: #ffe6a8; background: linear-gradient(180deg, rgba(72, 52, 22, 0.82), rgba(40, 28, 14, 0.92)); }
.bubble--t3 { border-color: rgba(255, 130, 90, 0.5); color: #ffd0c0; background: linear-gradient(180deg, rgba(88, 36, 28, 0.85), rgba(48, 20, 18, 0.94)); }
.bubble--t4 { border-color: rgba(200, 120, 255, 0.55); color: #f0d8ff; background: linear-gradient(180deg, rgba(72, 32, 88, 0.88), rgba(36, 16, 52, 0.95)); box-shadow: 0 0 14px rgba(180, 100, 255, 0.22); }
.bottom-tabs { display: flex; flex-direction: column; min-height: 0; }
.tab-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(162, 183, 233, 0.18);
  padding: 8px 8px 0;
  gap: 8px;
}
.tab-btn {
  background: rgba(23, 31, 45, 0.52);
  color: #b2c0e4;
  border: 1px solid rgba(162, 183, 233, 0.14);
  height: 38px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.tab-btn.active {
  background: linear-gradient(180deg, rgba(84, 108, 172, 0.76), rgba(58, 79, 136, 0.84));
  color: #f1f5ff;
  border-color: rgba(177, 201, 255, 0.35);
}
.tab-body { flex: 1; min-height: 0; }
.tab-pane { display: none; height: 100%; }
.tab-pane.active { display: flex; flex-direction: column; }
.tab-pane--enter { animation: tabPaneFadeIn 220ms ease-out; }
.chat-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  font-size: 13px;
  color: #c1cdeb;
  background: linear-gradient(180deg, rgba(11, 18, 33, 0.45), rgba(11, 17, 31, 0.15));
}
.chat-line {
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(23, 34, 56, 0.36);
  border: 1px solid rgba(130, 155, 218, 0.1);
}
.chat-line b { color: #f1f5ff; }
.chat-input-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(162, 183, 233, 0.16);
  background: rgba(10, 16, 29, 0.45);
}
.history-tab-strip {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 12px;
  gap: 10px;
  overflow-y: auto;
}
.history-tab-strip__hint {
  font-size: 11px;
  color: #8a9bc4;
  letter-spacing: 0.2px;
  line-height: 1.35;
}
.round-history-detail {
  flex: 1;
  min-height: 44px;
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(10, 16, 30, 0.65);
  border: 1px solid rgba(120, 145, 210, 0.12);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 140, 200, 0.35) transparent;
}
.round-history-detail::-webkit-scrollbar { height: 5px; }
.round-history-detail::-webkit-scrollbar-thumb { background: rgba(120, 140, 200, 0.35); border-radius: 999px; }
.round-detail-card {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(14, 22, 40, 0.75);
  border: 1px solid rgba(140, 165, 230, 0.14);
  font-size: 12px;
  color: #c8d4ee;
  line-height: 1.55;
}
.round-detail-card__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.55px;
  color: #9eb0db;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.round-detail-card__crash {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 20px;
  font-weight: 800;
  color: #f0f4ff;
  margin-bottom: 8px;
}
.round-detail-card__meta { font-size: 11px; color: #8a9bc4; word-break: break-all; margin-bottom: 10px; }
.round-detail-bets { list-style: none; margin: 0; padding: 0; }
.round-detail-bets li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid rgba(120, 145, 210, 0.1);
  font-size: 12px;
}
.round-detail-bets li:first-child { border-top: 0; padding-top: 0; }
.round-detail-bets .name { color: #e8eeff; font-weight: 600; }
.round-detail-bets .amt { font-family: "JetBrains Mono", ui-monospace, monospace; color: #b7c8ec; }
.round-detail-empty { font-size: 12px; color: #8a9bc4; padding: 4px 0; }
.round-detail-bust { color: #ff9a9a; font-weight: 600; }
.round-detail-slot { flex-shrink: 0; }
.settings-grid { display: grid; gap: 8px; padding: 12px; }
.bet-col { display: flex; flex-direction: column; min-height: 0; }
.bet-col {
  background:
    radial-gradient(circle at 70% 8%, rgba(102, 129, 235, 0.14), transparent 34%),
    linear-gradient(165deg, rgba(21, 30, 52, 0.9), rgba(12, 19, 36, 0.94));
}
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 4px 10px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(126, 152, 224, 0.24);
  background: linear-gradient(180deg, rgba(14, 23, 41, 0.9), rgba(10, 17, 32, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 18px rgba(4, 8, 18, 0.28);
}
.mode-btn {
  height: 44px;
  border: 0;
  background: rgba(28, 39, 60, 0.58);
  color: #b5c3e8;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}
.mode-btn.active {
  background: linear-gradient(180deg, rgba(95, 117, 182, 0.88), rgba(66, 86, 148, 0.9));
  color: #f5f8ff;
}
.bet-card {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 11px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(9, 16, 30, 0.76), rgba(8, 14, 26, 0.88));
  border: 1px solid rgba(122, 148, 219, 0.14);
}
input, button {
  border: 1px solid rgba(167, 188, 243, 0.24);
  background: linear-gradient(180deg, rgba(14, 24, 42, 0.92), rgba(10, 18, 34, 0.94));
  color: #edf2ff;
  padding: 12px;
  border-radius: 13px;
}
input::placeholder { color: #8d9ec8; }
input {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), inset 0 -8px 16px rgba(0, 0, 0, 0.12);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
input:focus {
  outline: none;
  border-color: rgba(124, 154, 235, 0.58);
  box-shadow: 0 0 0 2px rgba(100, 128, 214, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(18, 29, 52, 0.95), rgba(12, 21, 38, 0.95));
}
button {
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(58, 78, 122, 0.88), rgba(40, 56, 92, 0.9));
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 16px rgba(8, 12, 24, 0.35); filter: brightness(1.06); }
button:disabled { cursor: not-allowed; opacity: 0.48; }
.big-btn {
  position: relative;
  height: 88px;
  font-size: 23px;
  letter-spacing: 0.7px;
  border: 0;
  border-radius: 16px;
  text-transform: uppercase;
  font-weight: 800;
  overflow: hidden;
}
.big-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 24%, rgba(255, 255, 255, 0.2) 44%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.42s ease;
  pointer-events: none;
}
.big-btn:hover:not(:disabled)::after { transform: translateX(120%); }
.big-btn.btn-pop { animation: actionBtnPop 180ms cubic-bezier(0.2, 0.9, 0.2, 1); }
.login-style {
  background: linear-gradient(180deg, #6f84ff, #4b60d2);
  color: #eef2ff;
  box-shadow: 0 14px 26px rgba(84, 108, 240, 0.34), 0 0 0 1px rgba(167, 188, 243, 0.18) inset;
}
.register-style {
  background: linear-gradient(180deg, #3fe2aa, #1eb985);
  color: #effff4;
  box-shadow: 0 14px 28px rgba(28, 191, 130, 0.36), 0 0 0 1px rgba(173, 255, 225, 0.2) inset;
}
button.secondary { background: linear-gradient(180deg, #4092ff, #2f6fd1); }
.activity-panel {
  margin-top: auto;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(140, 165, 230, 0.12);
  background: linear-gradient(180deg, rgba(18, 27, 48, 0.42), rgba(8, 12, 22, 0.65));
}
.message {
  min-height: 22px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid rgba(140, 165, 230, 0.12);
  background: rgba(16, 24, 44, 0.55);
}
.message--muted { color: #a8b8dc; border-style: dashed; opacity: 0.85; }
.message--info { color: #d4e2ff; border-color: rgba(120, 160, 255, 0.22); background: rgba(24, 36, 72, 0.45); }
.message--success { color: #c4ffd8; border-color: rgba(80, 200, 140, 0.28); background: rgba(18, 48, 36, 0.4); }
.message--error { color: #ffc9c9; border-color: rgba(255, 120, 120, 0.28); background: rgba(48, 22, 28, 0.45); }
.me-info { margin-top: 10px; }
.me-info--guest { font-size: 12px; color: #96a6cc; line-height: 1.45; padding: 2px 0; }
.stat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #dce6ff;
  background: rgba(22, 32, 54, 0.75);
  border: 1px solid rgba(140, 165, 230, 0.14);
}
.stat-chip b { font-weight: 800; color: #fff; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; }
.stat-chip--ok { border-color: rgba(80, 200, 140, 0.25); color: #b8f5d0; }
.stat-chip--wait { border-color: rgba(255, 200, 100, 0.25); color: #ffe8b8; }
.auto-controls { border-top: 1px solid rgba(162, 183, 233, 0.2); margin-top: 2px; padding-top: 10px; display: grid; gap: 8px; }
.checkline { font-size: 12px; color: #d4dcf0; display: flex; gap: 6px; align-items: center; }
.auth-info { white-space: pre-wrap; min-height: 66px; padding: 10px; font-size: 12px; border: 1px solid rgba(167, 188, 243, 0.24); color: #c4d2ee; background: rgba(10, 16, 30, 0.88); border-radius: 10px; }
.right-col {
  display: grid;
  grid-template-rows: 44px 1fr 44px;
  min-height: 0;
  background:
    radial-gradient(circle at 90% 10%, rgba(91, 126, 235, 0.13), transparent 30%),
    linear-gradient(165deg, rgba(19, 28, 49, 0.92), rgba(11, 18, 34, 0.94));
}
.table-head, .table-row, .table-footer { display: grid; grid-template-columns: 1.35fr 0.58fr 0.7fr 0.85fr; align-items: center; }
.table-head {
  padding: 0 12px;
  font-size: 11px;
  color: #aab8de;
  border-bottom: 1px solid rgba(162, 183, 233, 0.17);
  letter-spacing: 0.9px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(15, 23, 40, 0.55);
}
.players-table { overflow: auto; }
.players-empty {
  padding: 28px 14px;
  text-align: center;
  font-size: 13px;
  color: #8a9bc4;
  letter-spacing: 0.2px;
}
.table-row {
  padding: 0 12px;
  height: 36px;
  font-size: 12px;
  border-bottom: 1px solid rgba(153, 175, 227, 0.09);
  color: #d2dcf4;
}
.table-row:nth-child(odd) { background: rgba(21, 29, 47, 0.35); }
.table-row .profit-win { color: #53e796; }
.table-row .profit-loss { color: #ff8f8f; }
.table-footer {
  padding: 0 12px;
  font-size: 11px;
  color: #becbea;
  border-top: 1px solid rgba(162, 183, 233, 0.17);
  letter-spacing: 0.7px;
  text-transform: uppercase;
  background: rgba(15, 23, 40, 0.5);
}

@keyframes floatPulse {
  0%, 100% { transform: translateY(0); opacity: 0.86; }
  50% { transform: translateY(-1px); opacity: 1; }
}

@keyframes ringPulse {
  0% { box-shadow: 0 0 0 0 rgba(113, 154, 255, 0.38); }
  70% { box-shadow: 0 0 0 8px rgba(113, 154, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(113, 154, 255, 0); }
}

@keyframes sectionReveal {
  from { transform: translateY(4px); opacity: 0; }
  to { transform: translateY(0); opacity: 0.92; }
}

@keyframes actionBtnPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.028); }
  100% { transform: scale(1); }
}

@keyframes tabPaneFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
}
.login-wrap { width: min(560px, 92vw); }
.login-back {
  display: inline-block;
  margin-bottom: 12px;
  color: #bcd0ff;
  text-decoration: none;
  font-size: 13px;
}
.login-back:hover { color: #e8efff; }
.login-card { padding: 18px; }
.login-brand { margin-bottom: 10px; }
.login-hint { margin: 6px 0 14px; color: #9cb0dd; font-size: 13px; }
.login-form { display: grid; gap: 10px; }
.verify-panel {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(151, 176, 235, 0.24);
  background: linear-gradient(160deg, rgba(11, 19, 36, 0.88), rgba(8, 16, 32, 0.76));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px rgba(0, 0, 0, 0.22);
  display: grid;
  gap: 8px;
}
.verify-panel__label { font-size: 13px; color: #d9e4ff; font-weight: 700; letter-spacing: 0.2px; }
.verify-panel__desc { font-size: 12px; color: #9fb2dd; margin-top: -2px; }
.verify-steps {
  margin: 2px 0 4px 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #b3c4ea;
}
.verify-steps li span { color: #7fd1ff; font-weight: 700; }
.verify-panel__amount {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 36px;
  font-weight: 800;
  color: #ffe7b3;
  letter-spacing: -0.02em;
}
.verify-panel__meta { font-size: 12px; color: #aebee5; }
.verify-command-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.verify-command-label {
  font-size: 11px;
  color: #97aad6;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.verify-command-row input {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  color: #d9e6ff;
}

/* Compact premium login modal */
.login-wrap--compact { width: min(560px, 92vw); }
.login-modal {
  padding: 22px 20px 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 15% 8%, rgba(116, 142, 255, 0.2), transparent 38%),
    linear-gradient(165deg, rgba(12, 24, 44, 0.96), rgba(8, 18, 34, 0.94));
  border: 1px solid rgba(146, 171, 236, 0.2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.login-modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.login-modal-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: rgba(24, 41, 76, 0.58);
  border: 1px solid rgba(144, 168, 230, 0.2);
}
.login-close {
  color: #9eb3de;
  text-decoration: none;
  font-size: 26px;
  line-height: 1;
  padding: 4px;
}
.login-close:hover { color: #e4ecff; }
.login-title {
  margin: 12px 0 4px;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #f2f7ff;
}
.login-title--small { font-size: 42px; margin-top: 4px; }
.login-subtitle {
  margin: 0 0 16px;
  color: #9fb2dd;
  font-size: 16px;
}
.login-step { display: grid; gap: 0; }
.login-step[hidden] { display: none !important; }
#usernameStep:not([hidden]) ~ #loginMessage { display: none !important; }
.login-footnote {
  margin: 12px 2px 4px;
  color: #8ea2cf;
  font-size: 13px;
}
.login-footnote span { color: #79d2ff; font-weight: 700; }
.login-field-label {
  font-size: 13px;
  color: #c9d7fa;
  margin-bottom: 3px;
  font-weight: 600;
}
.login-form .big-btn {
  height: 72px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  border-radius: 14px;
}
.verify-panel__amount { font-size: 48px; margin: 2px 0 4px; }
.verify-panel { margin-top: 8px; }
.login-waiting {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(84, 188, 137, 0.28);
  background: linear-gradient(180deg, rgba(24, 56, 52, 0.55), rgba(14, 36, 34, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 18px rgba(5, 14, 12, 0.28);
  color: #d7f6e6;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.1px;
}
.login-waiting.message--success { color: #d7f6e6; }
.login-waiting.message--error {
  border-color: rgba(255, 126, 126, 0.3);
  background: linear-gradient(180deg, rgba(58, 26, 36, 0.65), rgba(34, 16, 22, 0.86));
  color: #ffd2d2;
}
.login-waiting::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 45%, rgba(255, 255, 255, 0.05));
  pointer-events: none;
}
.login-waiting-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.login-waiting-dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #36d089;
  opacity: 0.3;
  animation: verifyPulse 1.1s ease-in-out infinite;
}
.login-waiting-dots i:nth-child(2) { animation-delay: 0.15s; }
.login-waiting-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes verifyPulse {
  0%, 80%, 100% { opacity: 0.26; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 740px) {
  .login-title { font-size: 44px; }
  .login-form .big-btn { height: 62px; font-size: 28px; }
}

@media (max-width: 1200px) {
  .main-grid { grid-template-columns: 1fr; height: auto; }
  .left-col { grid-template-rows: 420px 340px; }
  .brand { font-size: 32px; }
  .brand-sub { display: none; }
  .topbar { height: 64px; }
  .brand-logo { width: 40px; height: 40px; }
}

/* Referral landing */
.ref-body {
  background:
    radial-gradient(ellipse 100% 80% at 50% -40%, rgba(56, 240, 168, 0.12), transparent 50%),
    radial-gradient(circle at 18% 12%, rgba(113, 83, 255, 0.22), transparent 38%),
    radial-gradient(circle at 88% 8%, rgba(0, 200, 255, 0.12), transparent 42%),
    linear-gradient(168deg, #060912 0%, #0b1020 45%, #070b14 100%);
}
.ref-body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 32%, rgba(56, 240, 168, 0.16), transparent 44%),
    radial-gradient(circle at 78% 22%, rgba(95, 149, 255, 0.18), transparent 42%),
    radial-gradient(circle at 50% 88%, rgba(120, 90, 255, 0.1), transparent 48%);
  opacity: 0.95;
  animation: refAuroraDrift 18s ease-in-out infinite alternate;
}
@keyframes refAuroraDrift {
  from { transform: translate(-2%, -1%) scale(1); }
  to { transform: translate(2%, 1%) scale(1.04); }
}
.ref-page {
  position: relative;
  min-height: 100vh;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ref-topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 12px;
  background:
    linear-gradient(120deg, rgba(58, 74, 140, 0.28), transparent 42%),
    linear-gradient(180deg, rgba(28, 38, 64, 0.88), rgba(16, 24, 44, 0.82));
  border: 1px solid rgba(183, 203, 255, 0.24);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 16px 34px rgba(3, 7, 18, 0.55);
  backdrop-filter: blur(12px);
}
.ref-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.ref-brand__logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}
.ref-brand__text {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.ref-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.ref-main {
  flex: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ref-hero {
  position: relative;
  padding: clamp(20px, 3vw, 28px);
  border-radius: 20px;
  border: 1px solid rgba(140, 175, 255, 0.22);
  background:
    radial-gradient(ellipse 90% 80% at 0% 0%, rgba(56, 240, 168, 0.2), transparent 52%),
    radial-gradient(ellipse 70% 60% at 100% 0%, rgba(118, 178, 255, 0.2), transparent 48%),
    linear-gradient(165deg, rgba(22, 32, 58, 0.94), rgba(10, 16, 30, 0.92));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 22px 50px rgba(3, 7, 18, 0.58);
  overflow: hidden;
}
.ref-hero__mesh {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image:
    linear-gradient(rgba(180, 210, 255, 0.9) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 210, 255, 0.9) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black, transparent);
  pointer-events: none;
}
.ref-hero__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: clamp(18px, 3vw, 32px);
  align-items: center;
}
.ref-hero__copy { min-width: 0; }
.ref-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(120, 255, 190, 0.45);
  background: linear-gradient(180deg, rgba(18, 48, 38, 0.75), rgba(8, 22, 18, 0.85));
  color: #c9ffe8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.75px;
  text-transform: uppercase;
  box-shadow: 0 0 24px rgba(56, 240, 168, 0.15);
}
.ref-hero__title {
  margin: 14px 0 10px;
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: #f2f6ff;
}
.ref-hero__fuel {
  background-image: linear-gradient(180deg, #ffffff 0%, #c8dcff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ref-hero__accent {
  display: inline-block;
  margin-left: 0.12em;
  background-image: linear-gradient(110deg, #9dffcf 0%, #38f0a8 40%, #1cc97c 55%, #6fffd4 70%, #38f0a8 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: refAccentShift 5s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(56, 240, 168, 0.35));
}
@keyframes refAccentShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.ref-hero__sub {
  margin: 0;
  max-width: 640px;
  color: #aabee8;
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.6;
}
.ref-hero__sub strong {
  color: #e4f7ff;
  font-weight: 700;
}
.ref-hero__cta {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.ref-btn-hero {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #f0fff9;
  border: 1px solid rgba(160, 255, 210, 0.55);
  background: linear-gradient(168deg, #6fffd4 0%, #38e8a8 30%, #1cc97c 72%, #12965f 100%);
  text-shadow: 0 1px 2px rgba(0, 36, 24, 0.45);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2) inset,
    0 2px 0 rgba(255, 255, 255, 0.2) inset,
    0 0 32px rgba(56, 240, 168, 0.4),
    0 12px 28px rgba(10, 50, 36, 0.45);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}
.ref-btn-hero__txt {
  position: relative;
  z-index: 1;
}
.ref-btn-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(120deg, transparent 10%, rgba(255, 255, 255, 0.32) 45%, transparent 78%);
  transform: translateX(-100%);
  transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.2, 1);
  pointer-events: none;
}
.ref-btn-hero:hover {
  transform: translateY(-2px);
  filter: brightness(1.06) saturate(1.05);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2) inset,
    0 2px 0 rgba(255, 255, 255, 0.26) inset,
    0 0 44px rgba(72, 255, 190, 0.5),
    0 16px 36px rgba(10, 50, 36, 0.5);
}
.ref-btn-hero:hover::after {
  transform: translateX(100%);
}
.ref-btn-hero--compact {
  min-height: 40px;
  padding: 0 20px;
  font-size: 11px;
  letter-spacing: 0.65px;
}
.ref-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #dce6ff;
  border: 1px solid rgba(156, 183, 248, 0.35);
  background: rgba(12, 20, 40, 0.65);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.ref-btn-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(180, 205, 255, 0.55);
  background: rgba(20, 32, 58, 0.85);
  color: #ffffff;
}
.ref-hero__deck {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 280px;
  margin-left: auto;
}
.ref-hero__deck--solo {
  max-width: min(320px, 100%);
}
.ref-deck-card--hero-code {
  padding: 16px 16px 14px;
}
.ref-hero-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.ref-hero-code-display {
  flex: 1;
  min-width: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(17px, 2.4vw, 22px);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(200, 214, 245, 0.55);
  line-height: 1.25;
  word-break: break-all;
}
.ref-hero-code-display.ref-hero-code-display--live {
  font-size: clamp(20px, 2.8vw, 28px);
  letter-spacing: 0.18em;
  color: #f2fff9;
  text-shadow:
    0 0 22px rgba(56, 240, 168, 0.45),
    0 0 40px rgba(56, 200, 255, 0.2),
    0 2px 0 rgba(0, 0, 0, 0.35);
}
.ref-pill-btn--hero {
  flex-shrink: 0;
  height: 32px;
}
#refUserPanel .ref-code:not(.ref-code--sm) {
  font-size: clamp(22px, 3.2vw, 30px);
  letter-spacing: 0.16em;
  padding: 16px 14px;
  color: #f6fffc;
  border-color: rgba(120, 255, 190, 0.35);
  background: linear-gradient(180deg, rgba(12, 32, 28, 0.95), rgba(6, 14, 26, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 28px rgba(56, 240, 168, 0.22),
    0 10px 28px rgba(0, 0, 0, 0.35);
  text-shadow: 0 0 20px rgba(120, 255, 210, 0.35);
}
.ref-deck-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(142, 165, 220, 0.22);
  background: linear-gradient(145deg, rgba(26, 38, 68, 0.9), rgba(10, 16, 30, 0.75));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.22s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.ref-deck-card:hover {
  transform: translateY(-2px);
  border-color: rgba(120, 255, 190, 0.35);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32), 0 0 20px rgba(56, 240, 168, 0.12);
}
.ref-deck-card__k {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.65px;
  text-transform: uppercase;
  color: #8ea2cf;
}
.ref-deck-card__v {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 14px;
  font-weight: 700;
  color: #eef3ff;
}
.ref-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ref-step {
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid rgba(160, 188, 255, 0.16);
  background: linear-gradient(180deg, rgba(18, 26, 48, 0.82), rgba(10, 14, 26, 0.88));
  box-shadow: 0 12px 28px rgba(3, 7, 18, 0.4);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.ref-step:hover {
  transform: translateY(-3px);
  border-color: rgba(120, 255, 190, 0.28);
}
.ref-step__num {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #062a1c;
  background: linear-gradient(168deg, #6fffd4, #1cc97c);
  box-shadow: 0 0 20px rgba(56, 240, 168, 0.35);
  margin-bottom: 10px;
}
.ref-step__title {
  margin: 0 0 6px;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.ref-step__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #9eb4df;
}
.ref-step__text strong {
  color: #c9ffe8;
  font-weight: 700;
}
.ref-guest__lead strong {
  color: #dfffea;
  font-weight: 700;
}
.ref-card {
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid rgba(160, 188, 255, 0.18);
  background: linear-gradient(180deg, rgba(22, 32, 58, 0.88), rgba(12, 18, 34, 0.86));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 14px 32px rgba(3, 7, 18, 0.48);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.ref-card:hover {
  border-color: rgba(180, 205, 255, 0.26);
}
.ref-card--guest {
  border-color: rgba(120, 255, 190, 0.22);
  background: linear-gradient(165deg, rgba(18, 42, 36, 0.55), rgba(14, 22, 42, 0.9));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 40px rgba(56, 240, 168, 0.08),
    0 16px 36px rgba(3, 7, 18, 0.45);
}
.ref-guest {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px 28px;
  align-items: center;
}
.ref-guest__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f4f8ff;
}
.ref-guest__lead {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: #b7c7ef;
  max-width: 52ch;
}
.ref-legal-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(120, 255, 190, 0.18);
  background: rgba(6, 18, 14, 0.45);
  font-size: 12px;
  line-height: 1.55;
  color: #9eb4df;
  max-width: 56ch;
}
.ref-legal-note strong {
  color: #d4e8ff;
  font-weight: 700;
}
.ref-guest__action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.ref-guest__action .ref-btn-hero--compact {
  min-width: 148px;
  white-space: nowrap;
}
.ref-deck-card__tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  vertical-align: 0.08em;
  color: #0a2418;
  background: linear-gradient(180deg, #8fffd8, #38e8a8);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.ref-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.ref-card__title {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.ref-card__text {
  margin: 0;
  color: #a9b9e6;
  font-size: 13px;
  line-height: 1.55;
}
.ref-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ref-card--wide { grid-column: 1 / -1; }
.ref-card--table { grid-column: 1 / -1; }
.ref-pill-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(156, 183, 248, 0.35);
  background: rgba(16, 26, 48, 0.9);
  color: #e7eeff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
}
.ref-pill-btn:hover {
  border-color: rgba(172, 197, 255, 0.55);
  color: #ffffff;
}
.ref-code {
  margin-top: 8px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(120, 255, 190, 0.2);
  background: linear-gradient(180deg, rgba(14, 26, 48, 0.92), rgba(8, 14, 28, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  color: #f0f6ff;
}
.ref-code--sm { font-size: 16px; letter-spacing: 0.08em; }
.ref-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #8ea2cf;
}
.ref-metrics {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ref-metric {
  padding: 10px 10px 9px;
  border-radius: 12px;
  border: 1px solid rgba(142, 165, 220, 0.22);
  background: rgba(10, 16, 30, 0.55);
}
.ref-metric__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.55px;
  text-transform: uppercase;
  color: #8ea2cf;
}
.ref-metric__value {
  margin-top: 4px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 20px;
  font-weight: 800;
  color: #f0f6ff;
}
.ref-apply-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ref-input {
  flex: 1;
  min-width: 180px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(142, 165, 220, 0.28);
  background: rgba(10, 16, 30, 0.65);
  color: #f0f6ff;
  padding: 0 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ref-input:focus {
  outline: none;
  border-color: rgba(120, 255, 190, 0.45);
  box-shadow: 0 0 0 3px rgba(56, 240, 168, 0.12);
}
.ref-chip {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.55px;
  text-transform: uppercase;
  color: #8ea2cf;
  border: 1px solid rgba(142, 165, 220, 0.22);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(10, 16, 30, 0.45);
}
.ref-table-wrap { margin-top: 8px; }
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ref-table th,
.ref-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(142, 165, 220, 0.12);
}
.ref-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.55px;
  text-transform: uppercase;
  color: #9eb4df;
  border-bottom-color: rgba(120, 255, 190, 0.2);
}
.ref-table__num {
  text-align: right;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
}
.ref-foot {
  width: min(1100px, 100%);
  margin: 0 auto 6px;
  padding: 0 4px;
  font-size: 12px;
  color: #7f93c4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ref-foot__sep { opacity: 0.55; }
.ref-foot__link { color: #b9d8ff; text-decoration: none; font-weight: 700; }
.ref-foot__link:hover { color: #ffffff; }

@media (max-width: 900px) {
  .ref-hero__layout {
    grid-template-columns: 1fr;
  }
  .ref-hero__deck {
    max-width: none;
    margin-left: 0;
    width: 100%;
  }
  .ref-hero__deck--solo {
    flex-direction: column;
    width: 100%;
  }
  .ref-hero__deck--solo .ref-deck-card {
    flex: none;
    width: 100%;
  }
  .ref-guest {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .ref-guest__lead,
  .ref-legal-note {
    max-width: 40rem;
  }
  .ref-guest__action {
    justify-content: center;
    width: 100%;
    padding-top: 4px;
  }
  .ref-steps {
    grid-template-columns: 1fr;
  }
  .ref-grid { grid-template-columns: 1fr; }
  .ref-metrics { grid-template-columns: 1fr; }
  .ref-topbar { height: auto; padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
}

/* ========== Narrow screens / phone (≤768px) ========== */
@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
  }
  button,
  a.top-btn,
  a.top-link,
  a.top-promo-btn,
  .tab-btn,
  .big-btn,
  .ref-btn-hero,
  .ref-btn-secondary {
    touch-action: manipulation;
  }

  .layout {
    padding: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom));
    padding-top: max(8px, env(safe-area-inset-top));
  }

  /* Play — top bar as 2-row grid */
  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "wallet wallet";
    height: auto;
    min-height: 0;
    padding: 10px 12px;
    gap: 8px 10px;
    align-items: center;
    border-radius: 14px;
  }
  .brand-wrap {
    grid-area: brand;
    min-width: 0;
    gap: 10px;
  }
  .brand {
    font-size: clamp(22px, 6.5vw, 30px) !important;
    letter-spacing: -0.02em;
  }
  .brand-logo {
    width: 36px !important;
    height: 36px !important;
  }
  .top-center {
    grid-area: wallet;
    position: static !important;
    left: auto !important;
    transform: none !important;
    justify-self: stretch;
    display: flex;
    justify-content: center;
    width: 100%;
  }
  .wallet-chip {
    width: 100%;
    max-width: 340px;
    justify-content: space-between;
  }
  .top-right {
    grid-area: actions;
    justify-self: end;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .top-promo-btn {
    padding: 0 11px;
    min-width: 0;
    font-size: 10px;
    letter-spacing: 0.45px;
  }
  .top-btn {
    min-width: 72px;
    padding: 0 11px;
    font-size: 10px;
  }
  .profile-btn {
    width: 42px;
    height: 42px;
  }

  .main-grid {
    margin-top: 8px;
    gap: 10px;
    height: auto;
    min-height: 0;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }
  .left-col {
    grid-template-rows: minmax(240px, 46vh) minmax(200px, 36vh);
    gap: 10px;
  }
  .graph-panel {
    padding: 10px;
    border-radius: 14px;
  }
  .graph-max-bet {
    left: 10px;
    top: 8px;
    font-size: 9px;
    letter-spacing: 0.35px;
  }
  .multiplier {
    font-size: clamp(34px, 13vw, 52px) !important;
    margin-top: 2px;
  }
  .round-state {
    margin-top: 10px;
    font-size: 10px;
  }
  .round-hint {
    font-size: 10px;
    line-height: 1.35;
    padding: 0 8px;
  }
  .subinfo {
    font-size: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 4px 10px;
  }
  .subinfo span {
    word-break: break-all;
  }

  .bet-col .bet-card {
    padding: 12px;
    gap: 10px;
  }
  .bet-card input {
    padding: 10px;
    font-size: 15px;
  }
  .bet-col .big-btn {
    height: 72px;
    font-size: 20px;
  }
  .table-head {
    font-size: 10px;
    padding: 6px 8px;
    gap: 4px;
  }
  .players-table {
    font-size: 12px;
  }
  .table-footer {
    font-size: 10px;
    flex-wrap: wrap;
    gap: 4px;
  }

  .toast-stack {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
  }

  .profile-modal {
    align-items: flex-end;
    padding: 0;
  }
  .profile-modal__dialog {
    width: 100%;
    max-width: none;
    max-height: min(94dvh, 100%);
    border-radius: 18px 18px 0 0;
    margin: 0;
  }
  .profile-modal__head {
    padding: 14px 14px 10px;
  }
  .profile-modal__head h2 {
    font-size: 19px;
  }
  .profile-modal__body {
    padding: 12px;
    gap: 10px;
  }

  /* Referral page */
  .ref-body .ref-page {
    padding: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom));
    padding-top: max(8px, env(safe-area-inset-top));
    gap: 12px;
  }
  .ref-topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
  }
  .ref-brand {
    justify-content: center;
  }
  .ref-brand__text {
    font-size: 22px;
  }
  .ref-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    justify-content: stretch;
  }
  .ref-nav .top-link,
  .ref-nav .top-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
  }
  .ref-main {
    gap: 12px;
  }
  .ref-hero {
    padding: 16px 14px 14px;
    border-radius: 16px;
  }
  .ref-hero__mesh {
    opacity: 0.045;
  }
  .ref-hero__title {
    font-size: 1.45rem;
    line-height: 1.12;
    margin: 10px 0 6px;
  }
  .ref-hero__sub {
    font-size: 13px;
    line-height: 1.55;
  }
  .ref-hero__sub strong {
    font-weight: 700;
  }
  .ref-deck-card--hero-code {
    padding: 14px 12px;
  }
  .ref-hero-code-display {
    font-size: 15px;
    letter-spacing: 0.05em;
    text-align: center;
    width: 100%;
  }
  .ref-hero-code-display.ref-hero-code-display--live {
    font-size: clamp(17px, 5.2vw, 22px);
    letter-spacing: 0.1em;
    line-height: 1.3;
  }
  .ref-hero-code-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .ref-pill-btn--hero {
    width: 100%;
    height: 36px;
  }
  .ref-step {
    padding: 14px 12px;
    border-radius: 14px;
  }
  .ref-step__num {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
  .ref-card {
    padding: 14px 12px;
    border-radius: 14px;
  }
  .ref-guest__title {
    font-size: 17px;
  }
  .ref-guest__lead,
  .ref-legal-note {
    font-size: 13px;
  }
  .ref-guest .ref-legal-note {
    text-align: center;
  }
  #refUserPanel .ref-code:not(.ref-code--sm) {
    font-size: clamp(18px, 5vw, 24px);
    letter-spacing: 0.1em;
    padding: 14px 10px;
  }
  .ref-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .login-wrap {
    width: 100%;
    padding: 0 max(12px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-right));
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .login-card {
    border-radius: 14px;
  }
  .login-title {
    font-size: 34px !important;
  }
}
