:root {
  --bg: #110c24;
  --bg-2: #181133;
  --card: #1e1540;
  --card-hover: #261b4f;
  --border: rgba(167, 139, 250, 0.16);
  --text: #f3f0ff;
  --muted: #a69cc9;
  --cyan: #38bdf8;
  --purple: #8b5cf6;
  --orange: #f59e0b;
  --green: #22c55e;
  --red: #ef4444;
  --gold: #fbbf24;
  --radius: 14px;
  --shadow: 0 10px 26px rgba(6, 3, 18, 0.48);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, transparent 280px),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
  overflow-x: hidden;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

button,
input,
select {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.announcement-bar {
  background: #23184b;
  border-bottom: 1px solid rgba(167, 139, 250, 0.24);
  padding: 8px 16px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 500;
  color: #e9e4ff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(17, 12, 36, 0.96);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.16s var(--ease);
}

.brand:hover {
  transform: translateY(-1px);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #2b1d5c;
  border: 1px solid rgba(167, 139, 250, 0.35);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}

.brand-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: #fff;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.nav-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.nav-btn:hover {
  color: var(--text);
  background: rgba(139, 92, 246, 0.12);
}

.nav-btn.active {
  color: #fff;
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(167, 139, 250, 0.45);
}

.nav-btn.admin-tab.active {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
}

.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.balance-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.34);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  color: #86efac;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background-color 0.15s var(--ease);
}

.balance-pill:hover {
  transform: translateY(-1px);
  background: rgba(34, 197, 94, 0.18);
}

.balance-pill span.plus {
  background: var(--green);
  color: #052e16;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  font-weight: 900;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background-color 0.16s var(--ease), border-color 0.16s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.btn-primary {
  background: #7c3aed;
  color: #fff;
  border-color: #9f67ff;
}

.btn-primary:hover:not(:disabled) {
  background: #8b5cf6;
}

.btn-accent {
  background: #d97706;
  color: #fff;
  border-color: #f59e0b;
}

.btn-accent:hover:not(:disabled) {
  background: #ea8a0a;
}

.btn-purple {
  background: #6d28d9;
  color: #fff;
  border-color: #8b5cf6;
}

.btn-success {
  background: #16a34a;
  color: #fff;
  border-color: #22c55e;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #ef4444;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 13px 24px;
  font-size: 1rem;
}

.container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 20px 18px 60px;
}

.tab-section {
  animation: fadeTab 0.18s var(--ease);
}

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

.live-drops {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #86efac;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.drops-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}

.drops-list::-webkit-scrollbar {
  display: none;
}

.drop-chip {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple);
  border-radius: 9px;
  padding: 5px 10px;
  font-size: 0.79rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.drop-chip.rarity-uncommon { border-left-color: var(--cyan); }
.drop-chip.rarity-rare { border-left-color: var(--purple); }
.drop-chip.rarity-epic { border-left-color: var(--orange); }
.drop-chip.rarity-legendary {
  border-left-color: var(--gold);
  background: rgba(251, 191, 36, 0.07);
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
}

.section-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Cases Grid in TastyDrop-like dark purple hub rhythm */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.case-card {
  background: #171030;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  position: relative;
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease), background-color 0.16s var(--ease);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.case-card:hover {
  transform: translateY(-2px);
  background: #201642;
  border-color: rgba(167, 139, 250, 0.42);
}

.case-card.active {
  border-color: var(--cyan);
  background: #231849;
}

.case-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.case-icon {
  font-size: 1.85rem;
}

.case-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
  border: 1px solid rgba(167, 139, 250, 0.28);
}

.case-card.theme-legendary .case-badge {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.4);
}

.case-name {
  font-weight: 800;
  font-size: 1rem;
}

.case-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.tier-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(167, 139, 250, 0.12);
}

.tier-strip span {
  height: 4px;
  border-radius: 2px;
  background: #334155;
}

.tier-strip span:nth-child(2) { background: var(--cyan); }
.tier-strip span:nth-child(3) { background: var(--purple); }
.tier-strip span:nth-child(4) { background: var(--gold); }

/* Roulette */
.roulette-stage {
  position: relative;
  overflow: hidden;
  background: #0d081c;
  border: 1px solid rgba(167, 139, 250, 0.28);
  border-radius: 14px;
  height: 152px;
  margin: 16px 0;
}

.roulette-stage::before,
.roulette-stage::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 72px;
  z-index: 5;
  pointer-events: none;
}

.roulette-stage::before {
  left: 0;
  background: linear-gradient(90deg, #0d081c, transparent);
}

.roulette-stage::after {
  right: 0;
  background: linear-gradient(270deg, #0d081c, transparent);
}

.roulette-pointer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--gold);
  z-index: 10;
}

.roulette-pointer::before,
.roulette-pointer::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

.roulette-pointer::before {
  top: 0;
  border-top: 10px solid var(--gold);
}

.roulette-pointer::after {
  bottom: 0;
  border-bottom: 10px solid var(--gold);
}

.roulette-track {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 10px;
  padding-left: 10px;
  will-change: transform;
}

.r-item {
  flex: 0 0 136px;
  height: 120px;
  border-radius: 11px;
  background: #191136;
  border: 1px solid var(--border);
  border-bottom: 3px solid #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9px 8px;
  user-select: none;
}

.r-item .r-icon { font-size: 1.85rem; margin-bottom: 5px; }
.r-item .r-title { font-size: 0.84rem; font-weight: 800; line-height: 1.2; }
.r-item .r-sub { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }

.r-item.rarity-common { border-bottom-color: #64748b; }
.r-item.rarity-uncommon { border-bottom-color: var(--cyan); }
.r-item.rarity-rare { border-bottom-color: var(--purple); }
.r-item.rarity-epic { border-bottom-color: var(--orange); }
.r-item.rarity-legendary {
  border-bottom-color: var(--gold);
  background: #261b12;
}

.roulette-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.prizes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.prize-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-top: 3px solid #64748b;
  border-radius: 12px;
  padding: 13px 11px;
  text-align: center;
  position: relative;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}

.prize-card:hover {
  transform: translateY(-2px);
}

.prize-card.rarity-uncommon { border-top-color: var(--cyan); }
.prize-card.rarity-rare { border-top-color: var(--purple); }
.prize-card.rarity-epic { border-top-color: var(--orange); }
.prize-card.rarity-legendary {
  border-top-color: var(--gold);
  background: #231838;
}

.chance-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.prize-card .p-icon { font-size: 1.8rem; margin: 6px 0; }
.prize-card .p-title { font-weight: 800; font-size: 0.92rem; }
.prize-card .p-sub { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }

/* Shop & Tariffs */
.currency-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.curr-btn {
  background: var(--bg-2);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.curr-btn.active {
  color: #fff;
  background: #7c3aed;
  border-color: #9f67ff;
}

.tariffs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 14px;
}

.tariff-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease);
}

.tariff-card:hover {
  transform: translateY(-2px);
  border-color: rgba(167, 139, 250, 0.45);
}

.tariff-card.featured {
  border-color: rgba(245, 158, 11, 0.45);
  background: #1f1542;
}

.tariff-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
}

.tariff-card.featured .tariff-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--gold);
}

.tariff-name { font-size: 1.15rem; font-weight: 800; margin-bottom: 8px; }
.tariff-price { font-size: 1.9rem; font-weight: 900; color: #fff; line-height: 1.1; }
.tariff-alt { font-size: 0.82rem; color: var(--muted); margin: 4px 0 12px; }
.tariff-desc { font-size: 0.87rem; color: #ddd6fe; margin-bottom: 12px; }

.tariff-features {
  list-style: none;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}

.tariff-features li::before {
  content: "✓ ";
  color: var(--green);
  font-weight: 900;
}

.tariff-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Forms, Topup & Profile */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.amount-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.amt-btn {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 13px;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.amt-btn.active {
  background: rgba(139, 92, 246, 0.24);
  border-color: var(--purple);
  color: #fff;
}

.method-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.method-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.method-card.active {
  border-color: var(--purple);
  background: rgba(139, 92, 246, 0.16);
}

.method-card .m-title { font-weight: 800; font-size: 0.9rem; }
.method-card .m-sub { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }

.requisites-box {
  background: #130c29;
  border: 1px dashed rgba(167, 139, 250, 0.36);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.field { margin-bottom: 12px; }

.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 600;
}

.input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s var(--ease);
}

.input:focus {
  border-color: var(--purple);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
}

.stat-label { font-size: 0.76rem; color: var(--muted); }
.stat-value { font-size: 1.35rem; font-weight: 900; margin-top: 4px; color: #fff; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  text-align: left;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.badge-pending { background: rgba(251, 191, 36, 0.16); color: var(--gold); }
.badge-approved { background: rgba(34, 197, 94, 0.16); color: #86efac; }
.badge-rejected { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }

.shards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.shard-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shard-card.ready {
  border-color: var(--green);
}

.shard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shard-title { font-weight: 800; font-size: 0.9rem; }
.shard-count { font-weight: 900; font-size: 0.9rem; color: var(--cyan); }

.shard-bar {
  height: 7px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.shard-bar-fill {
  height: 100%;
  background: var(--purple);
  transition: width 0.24s var(--ease);
}

.shard-card.ready .shard-bar-fill {
  background: var(--green);
}

.key-highlight {
  background: #120b26;
  border: 1px dashed var(--gold);
  border-radius: 11px;
  padding: 13px;
  margin: 12px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--gold);
  word-break: break-all;
}

.key-code-inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
  color: var(--gold);
  background: rgba(251, 191, 36, 0.1);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.82rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 5, 19, 0.78);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal {
  background: var(--card);
  border: 1px solid rgba(167, 139, 250, 0.34);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
  animation: fadeTab 0.16s var(--ease);
}

.modal-wide { max-width: 680px; }

.modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.05rem;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  background: rgba(139, 92, 246, 0.24);
  border-color: var(--purple);
  color: #fff;
}

.toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #1d143d;
  border: 1px solid var(--purple);
  color: #fff;
  padding: 11px 15px;
  border-radius: 11px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  max-width: 340px;
  animation: fadeTab 0.15s var(--ease);
}

.toast.error { border-color: var(--red); }
.toast.success { border-color: var(--green); }

@media (max-width: 720px) {
  .topbar-inner { justify-content: center; }
  .section-title { font-size: 1.2rem; }
  .roulette-controls { flex-direction: column; align-items: stretch; }
}