@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg:        #0a0d14;
  --sf:        #12151f;
  --bd:        #1d2130;
  --tx:        #e2e8f0;
  --tm:        #64748b;
  --neon:      #00ff9d;
  --neon-dim:  rgba(0,255,157,.15);
  --neon-glow: 0 0 16px rgba(0,255,157,.35);
  --gold:      #ffd700;
  --gold-dim:  rgba(255,215,0,.15);
  --gold-glow: 0 0 16px rgba(255,215,0,.35);
  --danger:    #ff4757;
  --sidebar-w: 300px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--tx);
  min-height: 100vh;
  display: flex;
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--tm); }

/* ══ SIDEBAR ══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #12151f 0%, #0d1020 100%);
  border-right: 1px solid var(--bd);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  padding: 32px 24px 28px;
  text-align: center;
  border-bottom: 1px solid var(--bd);
  background: radial-gradient(ellipse at top, rgba(0,255,157,.06) 0%, transparent 70%);
}

.header img {
  height: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px rgba(0,255,157,.3));
}

.header h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #00ff9d, #00e5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.header p {
  color: var(--tm);
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* Menu Groups */
.menu-group { padding: 8px 0; }

.menu-title {
  color: var(--tm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 16px 24px 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 11px 24px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  gap: 12px;
  border-right: 2px solid transparent;
}

.menu-item:hover {
  background: rgba(0,255,157,.05);
  color: var(--tx);
}

.menu-item.active {
  background: rgba(0,255,157,.08);
  color: var(--neon);
  border-right-color: var(--neon);
}

.menu-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.menu-item .badge {
  margin-left: auto;
  background: var(--neon-dim);
  color: var(--neon);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ══ MAIN CONTENT ═════════════════════════════════════ */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 32px;
  min-height: 100vh;
}

/* Page Header */
.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #00ff9d, #00e5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.page-sub {
  color: var(--tm);
  font-size: 14px;
}

/* Date Tabs */
.date-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.date-tab {
  padding: 9px 20px;
  background: var(--sf);
  border: 1px solid var(--bd);
  border-radius: 24px;
  color: var(--tm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  flex-shrink: 0;
}

.date-tab:hover {
  border-color: var(--neon);
  color: var(--neon);
}

.date-tab.active {
  background: var(--neon-dim);
  border-color: var(--neon);
  color: var(--neon);
  box-shadow: var(--neon-glow);
}

/* Search Box */
.search-box {
  background: var(--sf);
  border: 1px solid var(--bd);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tm);
  font-size: 14px;
}

.search-input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 12px;
  color: var(--tx);
  font-size: 14px;
  transition: all .2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: var(--neon-glow);
}

.search-input::placeholder { color: var(--tm); }

/* No Data */
.no-data {
  text-align: center;
  padding: 60px 20px;
  color: var(--tm);
  background: var(--sf);
  border: 1px solid var(--bd);
  border-radius: 16px;
}

.no-data i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  color: var(--bd);
}

.no-data p {
  font-size: 15px;
}

/* Winner Table */
.winner-section {
  background: var(--sf);
  border: 1px solid var(--bd);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,.2);
}


table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: rgba(0,0,0,.2);
  color: var(--tm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 24px;
  text-align: left;
}

tbody td {
  padding: 14px 24px;
  border-top: 1px solid var(--bd);
  font-size: 14px;
}

tbody tr:hover { background: rgba(0,255,157,.02); }

.rank-num {
  color: var(--tm);
  font-size: 13px;
  font-weight: 600;
  width: 40px;
}

.username {
  color: var(--neon);
  font-family: 'Courier New', monospace;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.prize {
  color: var(--gold);
  font-family: 'Courier New', monospace;
  font-weight: 700;
}

.date-col {
  color: var(--tm);
  font-size: 13px;
}

/* ══ MOBILE BOTTOM NAV ════════════════════════════════ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(18,21,31,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--bd);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--tm);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  padding: 8px 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s;
}

.nav-item.active {
  color: var(--neon);
}

.nav-item i {
  font-size: 20px;
}

/* ══ MENU SHEET ═══════════════════════════════════════ */
.menu-sheet {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #12151f;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 0 0 calc(80px + env(safe-area-inset-bottom));
  z-index: 101;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  max-height: 80vh;
  overflow-y: auto;
}

.menu-sheet.open { transform: translateY(0); }

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--bd);
  border-radius: 2px;
  margin: 12px auto 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--bd);
  position: sticky;
  top: 0;
  background: #12151f;
  z-index: 1;
}

.sheet-title {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #00ff9d, #00e5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sheet-close {
  background: var(--bd);
  border: none;
  color: var(--tm);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.sheet-close:hover {
  background: var(--tm);
  color: var(--tx);
}

/* ══ OVERLAY ══════════════════════════════════════════ */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
}

.overlay.show { display: block; }

/* ══ WIN POPUP ════════════════════════════════════════ */
.win-popup {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--sf);
  border: 1px solid var(--neon);
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  z-index: 1000;
  width: min(400px, 90vw);
  box-shadow: var(--neon-glow), 0 20px 60px rgba(0,0,0,.5);
  animation: popupIn .4s cubic-bezier(.4,0,.2,1);
}

.win-glow {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: radial-gradient(ellipse at top, rgba(0,255,157,.08) 0%, transparent 60%);
  pointer-events: none;
}

.win-popup img {
  width: 100px;
  margin-bottom: 20px;
  filter: drop-shadow(var(--neon-glow));
}

.win-popup h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--neon);
  text-shadow: var(--neon-glow);
  margin-bottom: 8px;
}

.win-popup p {
  color: var(--tm);
  font-size: 15px;
  margin-bottom: 12px;
}

.win-prize {
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: var(--gold-glow);
  margin-bottom: 24px;
}

.win-popup button {
  background: linear-gradient(135deg, var(--neon), #00cc7d);
  border: none;
  border-radius: 12px;
  color: var(--bg);
  font-size: 15px;
  font-weight: 700;
  padding: 13px 40px;
  cursor: pointer;
  transition: all .2s;
}

.win-popup button:hover {
  transform: translateY(-2px);
  box-shadow: var(--neon-glow);
}

@keyframes popupIn {
  from { transform: translate(-50%, -55%); opacity: 0; }
  to   { transform: translate(-50%, -50%); opacity: 1; }
}

/* ══ TELEGRAM BUTTON ══════════════════════════════════ */
.telegram-btn {
  position: fixed;
  bottom: 100px;
  right: 24px;
  background: #0088cc;
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(0,136,204,.4);
  z-index: 99;
  text-decoration: none;
  transition: all .2s;
}

.telegram-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,136,204,.6);
}

/* ══ RESPONSIVE ═══════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { display: none; }

  .main {
    margin-left: 0;
    padding: 20px 16px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom) + 16px);
  }

  .mobile-nav { display: block; }
  .menu-sheet { display: block; }

  .date-tabs {
    margin: 0 -16px 20px;
    padding: 0 16px 4px;
  }

  .telegram-btn {
    bottom: calc(80px + env(safe-area-inset-bottom) + 16px);
    right: 16px;
  }

  .page-title { font-size: 22px; }

  thead th, tbody td { padding: 12px 16px; }

}
