/* =============================================================
   THANHUB DASHBOARD — DESIGN SYSTEM v4 (ULTRA PREMIUM)
   Matches landpage.css & apple-pages.css tokens.
   Premium dark glassmorphism SaaS dashboard.
   ============================================================= */

:root {
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);

  /* Obsidian Color Palette */
  --bg:             #000000;
  --bg-dark:        #040508;
  --bg-gradient:    linear-gradient(180deg, #030407 0%, #06080d 50%, #020305 100%);

  /* Glass Surfaces */
  --surface:        rgba(255, 255, 255, 0.03);
  --surface-mid:    rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.09);

  /* Borders and Lines */
  --line:           rgba(255, 255, 255, 0.06);
  --line-mid:       rgba(255, 255, 255, 0.12);
  --line-strong:    rgba(255, 255, 255, 0.20);

  /* Typography */
  --text:           #f5f5f7;
  --muted:          #9aa0a6;
  --subtle:         #636366;

  /* Accents */
  --blue:           #4aa3ff;
  --blue-dark:      #2c85ff;
  --blue-glow:      rgba(74, 163, 255, 0.28);
  --violet:         #1e6fff;
  --green:          #34c759;
  --green-soft:     rgba(52, 199, 89, 0.12);
  --green-line:     rgba(52, 199, 89, 0.22);
  --red:            #ff453a;
  --amber:          #ff9f0a;
  --amber-soft:     rgba(255, 159, 10, 0.12);

  /* Shadow System */
  --shadow:         0 12px 40px rgba(0, 0, 0, 0.65);
  --shadow-lg:      0 32px 80px rgba(0, 0, 0, 0.8);

  /* Borders & Spacing */
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   22px;
  --r-xl:   28px;
  --r-pill: 999px;

  --sidebar-w: 272px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  overscroll-behavior-x: none;
  position: relative;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; vertical-align: middle; }
button { cursor: pointer; font-family: inherit; appearance: none; -webkit-appearance: none; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* Cyber-Grid Dot Texture */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 100%);
  z-index: 0;
}

/* Drifting Gradient Blobs */
body::before {
  content: "";
  position: fixed;
  width: 600px; height: 600px;
  top: -200px; left: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 163, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: bg-drift 20s ease-in-out infinite alternate;
}

@keyframes bg-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.08); }
}

/* ── Layout ── */
.dashboard-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: rgba(8, 9, 12, 0.95);
  border-right: 1px solid var(--line-mid);
  z-index: 200;
  padding: 22px 14px 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0.6;
}

/* ── Sidebar Header ── */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 26px;
  flex: 0 0 auto;
}

.sidebar-logo {
  width: 30px; height: 30px;
  object-fit: contain;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-mid);
  padding: 3px;
  background: rgba(74, 163, 255, 0.08);
}

.sidebar-brand {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, #fff 30%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Sidebar Nav ── */
.sidebar-nav {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%);
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(74, 163, 255, 0.28);
  border-radius: 999px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: all 0.18s ease;
}

.sidebar-link:hover {
  background: var(--surface-mid);
  color: var(--text);
  border-color: var(--line-mid);
}

.sidebar-link.active {
  background: rgba(74, 163, 255, 0.1);
  border-color: rgba(74, 163, 255, 0.3);
  color: var(--blue);
  box-shadow: 0 0 20px rgba(74, 163, 255, 0.06) inset;
}

.sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px; height: 18px;
}

.sidebar-icon svg { width: 18px; height: 18px; }
.sidebar-spacer { flex: 1; }

.sidebar-section-title {
  font-size: 9px;
  font-weight: 900;
  color: var(--subtle);
  letter-spacing: 1.8px;
  padding: 14px 12px 6px;
  text-transform: uppercase;
}

.sidebar-divider {
  height: 1px;
  background: var(--line);
  margin: 10px 8px;
  border: none;
}

/* ── Sidebar User ── */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 14px 10px calc(6px + var(--safe-bottom));
  border-top: 1px solid var(--line-mid);
  margin-top: 10px;
}

.user-avatar-placeholder { flex: 0 0 auto; }

.user-avatar-placeholder img {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--line-mid);
  background: var(--surface-mid);
  padding: 2px;
  transition: all 0.2s ease;
}

.user-avatar-placeholder img:hover { border-color: rgba(74, 163, 255, 0.5); }

.user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role { font-size: 11px; color: var(--blue); font-weight: 600; }

.logout-btn {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 69, 58, 0.2);
  background: rgba(255, 69, 58, 0.07);
  color: var(--red);
  transition: all 0.18s ease;
}

.logout-btn:hover {
  background: rgba(255, 69, 58, 0.18);
  border-color: rgba(255, 69, 58, 0.45);
  transform: translateY(-1px);
}

.logout-btn svg { width: 15px; height: 15px; }

.mobile-close-btn { display: none; }
.menu-toggle-btn { display: none; }

/* ── Main Content Area ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 30px 36px 56px;
  width: calc(100% - var(--sidebar-w));
}

/* ── Top Status Bar ── */
.top-status-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 28px;
  min-height: 38px;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

#timer-text {
  color: var(--blue);
  background: rgba(74, 163, 255, 0.06);
  border: 1px solid rgba(74, 163, 255, 0.2);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
}

.pulse-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.7);
}

.pulse-dot::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: inherit;
  animation: pulse-ring 2.2s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(3.5); opacity: 0; }
}

/* ── Tab Animation ── */
.dashboard-tab {
  animation: tab-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes tab-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page Header ── */
.header-section { text-align: center; margin-bottom: 36px; }

.gradient-text {
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, #fff 20%, #60aeff 65%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle { margin-top: 10px; color: var(--muted); font-size: 14px; font-weight: 500; }

/* ── Browser Glass Panel ── */
.browser-card {
  background: rgba(10, 11, 16, 0.8);
  border: 1px solid var(--line-mid);
  border-radius: var(--r-xl);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.browser-card::before {
  content: "";
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0.5;
}

.browser-card > * { position: relative; z-index: 1; }

/* ── Game Switch ── */
.game-switch {
  display: flex;
  align-items: center;
  width: fit-content;
  margin: 0 auto 22px;
  padding: 5px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-mid);
  border-radius: var(--r-pill);
}

.game-tab {
  min-height: 36px;
  min-width: 88px;
  padding: 0 18px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.18s ease;
}

.game-tab.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 18px rgba(74, 163, 255, 0.35);
}

/* ── Controls ── */
.controls {
  display: none;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.controls.controls-visible {
  display: flex;
}

.search-wrapper { flex: 1; position: relative; min-width: 180px; }

input[type="text"],
input[type="number"] {
  width: 100%; min-width: 0;
  height: 46px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: 14px;
  padding: 0 20px;
  outline: none;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]::placeholder,
input[type="number"]::placeholder { color: var(--muted); }

input[type="text"]:focus,
input[type="number"]:focus {
  border-color: rgba(74, 163, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(74, 163, 255, 0.12);
}

.refresh-btn {
  height: 42px;
  padding: 0 20px;
  border: 1px solid rgba(74, 163, 255, 0.35);
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, rgba(74, 163, 255, 0.18) 0%, rgba(44, 133, 255, 0.12) 100%);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(74, 163, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.refresh-btn:hover {
  background: linear-gradient(135deg, rgba(74, 163, 255, 0.28) 0%, rgba(44, 133, 255, 0.22) 100%);
  border-color: rgba(74, 163, 255, 0.6);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(74, 163, 255, 0.25);
}

.refresh-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(74, 163, 255, 0.15);
}

.filter-toggle-btn {
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line-mid);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: all 0.18s ease;
  user-select: none;
}

.filter-toggle-btn:hover {
  background: var(--surface-mid);
  border-color: rgba(74, 163, 255, 0.3);
}

.filter-toggle-btn.active {
  background: rgba(74, 163, 255, 0.12);
  border-color: rgba(74, 163, 255, 0.35);
  color: var(--blue);
}

/* ── Filter Panel ── */
.filter-panel {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--line-mid);
  border-radius: var(--r-lg);
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding 0.25s ease;
  margin-bottom: 18px;
}

.filter-panel.show {
  max-height: 500px;
  opacity: 1;
  padding: 18px 20px;
}

.filter-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.filter-tags-grid::-webkit-scrollbar { width: 4px; }
.filter-tags-grid::-webkit-scrollbar-track { background: transparent; }
.filter-tags-grid::-webkit-scrollbar-thumb { background: var(--surface-strong); border-radius: 4px; }

.filter-tag-pill {
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line-mid);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.18s ease;
  user-select: none;
}

.filter-tag-pill:hover {
  background: rgba(74, 163, 255, 0.08);
  color: var(--blue);
  border-color: rgba(74, 163, 255, 0.25);
}

.filter-tag-pill.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* ── Loader ── */
.loader {
  width: 32px; height: 32px;
  border: 2px solid rgba(74, 163, 255, 0.15);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 60px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Server Grid ── */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

/* ── Server Card ── */
.server-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
  padding: 20px;
  background: rgba(10, 11, 16, 0.85);
  border: 1px solid var(--line-mid);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: var(--shadow);
}

.server-item::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(74, 163, 255, 0.06) 0%, transparent 55%);
}

.server-item > * { position: relative; z-index: 1; }

.server-item:hover {
  transform: translateY(-5px);
  border-color: rgba(74, 163, 255, 0.38);
  box-shadow: var(--shadow-lg), 0 0 1px rgba(74, 163, 255, 0.18) inset;
}

.server-item > div:nth-child(3) {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.server-item > .join-btn { margin-top: auto; }

.server-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.server-index {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  background: rgba(74, 163, 255, 0.08);
  color: var(--blue);
  border: 1px solid rgba(74, 163, 255, 0.22);
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 7px;
}

.card-kicker {
  display: block;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.event-name {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 5px;
}

.pet-name {
  display: block;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 9px;
  line-height: 1.25;
}

.status-badge {
  position: absolute;
  top: 18px; right: 18px;
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.12), 0 0 12px rgba(52, 199, 89, 0.5);
}

/* ── Event Tags ── */
.event-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.event-tag {
  height: 24px;
  padding: 0 10px;
  background: rgba(74, 163, 255, 0.08);
  border: 1px solid rgba(74, 163, 255, 0.2);
  color: #93c5fd;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
}

/* ── Rarity Tags ── */
.rarity-tag {
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 800;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
}

.rarity-tag.rarity-common    { color: var(--muted); background: rgba(142, 142, 147, 0.08); border-color: rgba(142, 142, 147, 0.16); }
.rarity-tag.rarity-uncommon  { color: #4ade80; background: rgba(52, 199, 89, 0.08); border-color: rgba(52, 199, 89, 0.18); }
.rarity-tag.rarity-rare      { color: var(--blue); background: rgba(74, 163, 255, 0.08); border-color: rgba(74, 163, 255, 0.18); }
.rarity-tag.rarity-legendary { color: #fbbf24; background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.18); }
.rarity-tag.rarity-mythic    { color: #e879f9; background: rgba(217, 70, 239, 0.08); border-color: rgba(217, 70, 239, 0.18); }
.rarity-tag.rarity-super     { color: #27e0c8; background: rgba(39, 224, 200, 0.08); border-color: rgba(39, 224, 200, 0.18); }

/* ── Server Meta Details ── */
.server-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin: 10px 0;
}

.server-meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 50px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  gap: 2px;
  transition: all 0.18s ease;
}

.server-meta-item:hover { border-color: var(--line-mid); }

.server-meta-label {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.server-meta-item span:last-child {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

/* ── Relic / Info / Pet Boxes ── */
.relic-box, .info-box, .pet-timer-box, .high-fruit-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.relic-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  transition: all 0.18s ease;
}

.relic-box:hover { border-color: var(--line-mid); }

.relic-box.ready {
  background: var(--green-soft);
  border-color: var(--green-line);
}

.relic-orb {
  width: 20px; height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.85), transparent 18%),
    linear-gradient(135deg, #4aa3ff, #1e6fff);
}

.relic-box.ready .relic-orb {
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.9), transparent 18%),
    linear-gradient(135deg, #67e8f9, #34c759);
}

.relic-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.relic-copy span { color: var(--subtle); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.relic-copy strong { color: var(--text); font-size: 13px; font-weight: 900; }
.relic-box.empty .relic-copy strong { color: var(--muted); }

.info-box { padding: 10px 14px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }

.pet-timer-box {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px; min-height: 54px;
  padding: 12px 14px;
  margin-top: 7px;
  color: var(--text);
}

.pet-timer-label { color: var(--subtle); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.pet-timer-box strong { font-size: 14px; font-weight: 900; }

.high-fruit-box {
  display: flex; flex-direction: column;
  gap: 3px; min-height: 66px;
  margin-top: 9px; padding: 12px 14px;
  color: var(--text);
}

.high-fruit-label { color: var(--subtle); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.high-fruit-value { font-size: 13px; font-weight: 900; }
.high-fruit-price { color: var(--amber); font-size: 12px; font-weight: 800; }
.high-fruit-box.muted .high-fruit-value,
.high-fruit-box.muted .high-fruit-price { color: var(--muted); }

/* ── Join Button ── */
.join-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 18px rgba(74, 163, 255, 0.3);
  margin-top: 12px;
}

.join-btn:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(74, 163, 255, 0.45);
}

.join-btn:active { transform: translateY(0); }

.join-btn:disabled {
  background: var(--surface-strong);
  border: 1px solid var(--line-mid);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Copy Job ID ── */
.copy-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; }

.job-id-text {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-id-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-mid);
  background: var(--surface-mid);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  transition: all 0.18s ease;
}

.copy-id-btn:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 14px; opacity: 0.35; }
.empty-state h3 { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── GAG2 Pet Grid ── */
.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.pet-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: rgba(10, 11, 16, 0.85);
  border: 1px solid var(--line-mid);
  border-radius: var(--r-lg);
  text-align: center;
  transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pet-card:hover {
  transform: translateY(-3px);
  border-color: rgba(74, 163, 255, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.pet-card img {
  width: 60px; height: 60px;
  object-fit: contain;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
}

.pet-card-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}


/* ─── GAG2 Filter Pill buttons ─── */
.gag-filter-btn {
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line-mid);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: all 0.18s ease;
}

.gag-filter-btn:hover { background: var(--surface-mid); color: var(--text); border-color: var(--line-strong); }
.gag-filter-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ─── Mobile overlay & responsive ─── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 190;
}

@media (max-width: 1024px) {
  body::before, body::after {
    animation: none !important;
  }
  .sidebar {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    padding-top: max(22px, calc(14px + var(--safe-top)));
    padding-bottom: max(14px, calc(10px + var(--safe-bottom)));
    -webkit-transform: translateX(-100%);
    transform: translateX(-100%);
    -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .sidebar.mobile-open {
    -webkit-transform: translateX(0);
    transform: translateX(0);
  }
  .sidebar-overlay.show { display: block; }
  .mobile-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    background: transparent;
    border: none;
    color: var(--muted);
    margin-left: auto;
  }
  .menu-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border: 1px solid var(--line-mid);
    background: rgba(10, 11, 16, 0.85);
    border-radius: var(--r-sm);
    color: var(--text);
  }
  .main-content { margin-left: 0; width: 100%; padding: max(16px, calc(10px + var(--safe-top))) 16px 64px; }
  .top-status-bar { justify-content: space-between; margin-bottom: 16px; }
  .header-section { margin-bottom: 24px; }
  .browser-card { padding: 18px 16px; }
}

@media (max-width: 768px) {

  .controls.controls-visible {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .search-wrapper {
    grid-column: span 2;
  }
  .controls > button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .server-grid { grid-template-columns: 1fr; }
  .server-meta { grid-template-columns: 1fr; }
  .gradient-text { font-size: clamp(24px, 8vw, 36px); letter-spacing: -0.5px; }
  .main-content { padding: max(14px, calc(8px + var(--safe-top))) 12px 56px; }
  .controls.controls-visible {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .search-wrapper { grid-column: span 1; }
  .pagination-container { flex-direction: column; gap: 12px; align-items: stretch; }
  .page-btn { justify-content: center; }
  .page-info { order: -1; }


}

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

/* ─── Pagination Controls ─── */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-mid);
  gap: 16px;
}

.page-btn {
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-mid);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  user-select: none;
}

.page-btn:hover:not(:disabled) {
  background: var(--surface-mid);
  border-color: rgba(74, 163, 255, 0.35);
  color: var(--blue);
  transform: translateY(-1px);
}

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

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: transparent;
  border-color: var(--line);
}

.page-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.page-info div {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.page-info span {
  color: var(--text);
}

.page-counter {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.page-counter strong {
  color: var(--text);
  font-weight: 900;
}

.total-players-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  background: rgba(74, 163, 255, 0.08);
  border: 1px solid rgba(74, 163, 255, 0.18);
  color: var(--blue);
  border-radius: var(--r-pill);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* ─── Admin Whitelist Panel ─── */
.admin-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line-mid);
  padding-bottom: 12px;
}

.admin-header h2 {
  font-size: 1rem;
  color: var(--text);
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  align-items: start;
}

.admin-form-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-title-whitelist {
  font-size: 0.75rem;
  color: #818cf8;
  margin: 0 0 4px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.admin-title-unwhitelist {
  font-size: 0.75rem;
  color: #ef4444;
  margin: 0 0 4px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.unwhitelist-col {
  border-left: 1px solid var(--line-mid);
  padding-left: 32px;
}

.admin-input-row {
  display: flex;
  gap: 8px;
}

.admin-input-row .flex-1 { flex: 1; min-width: 0; }
.admin-input-row .flex-2 { flex: 2; min-width: 0; }

/* admin-input inherits from global input[type] rules — just override border-radius */
.admin-input {
  border-radius: var(--r-md) !important;
  height: 42px;
  font-size: 13px;
  padding: 0 16px;
}

.btn-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(185, 28, 28, 0.15) 100%) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
  box-shadow: 0 2px 12px rgba(239, 68, 68, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-danger:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.32) 0%, rgba(185, 28, 28, 0.25) 100%) !important;
  border-color: rgba(239, 68, 68, 0.65) !important;
  color: #fff !important;
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.25) !important;
}

@media (max-width: 768px) {
  .unwhitelist-col {
    border-left: none;
    border-top: 1px solid var(--line-mid);
    padding-left: 0;
    padding-top: 24px;
  }

  .admin-input-row {
    flex-direction: column;
  }

  .admin-input-row .flex-1,
  .admin-input-row .flex-2 {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* ─── Scrollable Dashboard Sub-Tabs ─── */
.dashboard-sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line-mid);
  padding-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dashboard-sub-tabs::-webkit-scrollbar {
  display: none;
}

.dashboard-sub-tabs button {
  flex: 0 0 auto;
}

/* ═══════════════════════════════════════════
   USER INFO TAB — Mobile-First Clean Rewrite
   ═══════════════════════════════════════════ */

.ui-page {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 32px;
}

/* Card base */
.ui-card {
  background: rgba(10, 11, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.ui-card:hover {
  transform: translateY(-2px);
  border-color: rgba(74, 163, 255, 0.25);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.ui-card::before {
  content: "";
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74, 163, 255, 0.5), transparent);
}

/* Identity card top row */
.ui-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

.ui-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(74, 163, 255, 0.4);
  padding: 3px;
  background: rgba(74, 163, 255, 0.08);
  flex-shrink: 0;
  object-fit: cover;
}

.ui-identity-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ui-username {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-badge-plan {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #60a5fa;
  background: rgba(30, 111, 255, 0.10);
  border: 1px solid rgba(30, 111, 255, 0.25);
  border-radius: 99px;
  padding: 2px 10px;
  width: fit-content;
}

.ui-status-pill {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(52, 199, 89, 0.1);
  border: 1px solid rgba(52, 199, 89, 0.3);
  color: #34c759;
  white-space: nowrap;
}

/* Stats row — always 2 col */
.ui-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ui-stat-card {
  background: rgba(10, 11, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.ui-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(74, 163, 255, 0.25);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.ui-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ui-stat-icon svg {
  width: 18px;
  height: 18px;
}

.ui-stat-blue {
  background: rgba(74, 163, 255, 0.1);
  border: 1px solid rgba(74, 163, 255, 0.2);
  color: #4aa3ff;
}

.ui-stat-violet {
  background: rgba(30, 111, 255, 0.10);
  border: 1px solid rgba(30, 111, 255, 0.22);
  color: #60a5fa;
}

.ui-stat-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ui-stat-num {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

/* Labels */
.ui-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 2px;
}

/* Card heading */
.ui-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ui-card-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.3px;
}

.ui-card-icon {
  width: 16px;
  height: 16px;
  color: var(--blue);
  opacity: 0.7;
}

/* Fields */
.ui-field {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ui-field-last {
  border-bottom: none;
  padding-bottom: 0;
}

.ui-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.ui-mono {
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 13px;
  color: var(--blue);
  letter-spacing: 0.3px;
}

/* Key box */
.ui-key-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 4px;
  overflow: hidden;
}

.ui-key-text {
  flex: 1;
  min-width: 0;
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 13px;
  color: var(--blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.ui-key-text.key-hidden {
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 2px;
}

.ui-key-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ui-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.ui-icon-btn svg {
  width: 15px;
  height: 15px;
}

.ui-icon-btn:hover, .ui-icon-btn:active {
  background: rgba(74, 163, 255, 0.1);
  border-color: rgba(74, 163, 255, 0.3);
  color: var(--blue);
}

.ui-key-note {
  margin-top: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 5px;
}

.ui-key-note svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* =============================================================
   SEED RESTOCK MODULE (SRM) — Premium Mobile-First UI
   ============================================================= */

/* ── Header bar ── */
.srm-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* ── Timer block ── */
.srm-timer-block {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.srm-timer-ring {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  will-change: transform;    /* promote to compositor layer */
}

.srm-timer-ring svg {
  width: 100%;
  height: 100%;
  display: block;
}

.srm-timer-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.srm-timer-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--muted);
  text-transform: uppercase;
}

.srm-timer-val {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 1.35rem;
  font-weight: 700;
  color: #6366f1;
  letter-spacing: 2px;
  line-height: 1;
  min-width: 60px;   /* prevent layout shift */
}

/* ── Badges ── */
.srm-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.srm-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  border: 1px solid;
  min-width: 68px;
  text-align: center;
}

.srm-badge--green {
  background: rgba(52,199,89,0.06);
  border-color: rgba(52,199,89,0.18);
}

.srm-badge--gray {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.08);
}

.srm-badge-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.srm-badge--green .srm-badge-label { color: #34c759; }

.srm-badge-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.srm-badge--green .srm-badge-val { color: #34c759; }

/* ── Controls (search + filter pills + refresh) ── */
.srm-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.srm-filter-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.srm-pill {
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.10);
  background: transparent;
  color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
  white-space: nowrap;
}

.srm-pill:hover,
.srm-pill:active {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.35);
  color: #a5b4fc;
}

.srm-pill--active {
  background: rgba(99,102,241,0.20);
  border-color: rgba(99,102,241,0.50);
  color: #c7d2fe;
}

.srm-refresh {
  flex-shrink: 0;
}

/* ── Seed Grid ── */
.srm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

@media (max-width: 480px) {
  .srm-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .srm-header { padding: 12px; gap: 10px; }
  .srm-timer-val { font-size: 1.1rem; }
  .srm-controls { gap: 6px; }
}

/* ── Seed Card ── */
.srm-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-top: 2px solid var(--srm-col, rgba(255,255,255,0.1));
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* GPU compositing: avoid layout & paint during scroll */
  contain: layout style;
  will-change: auto;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.srm-card:hover {
  box-shadow: 0 0 0 1px var(--srm-col, rgba(255,255,255,0.15)),
              0 8px 24px rgba(0,0,0,0.4);
}

.srm-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.srm-seed-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 3px;
  flex-shrink: 0;
  /* prevent reflow jank on image load */
  aspect-ratio: 1;
}

.srm-seed-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.srm-seed-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.srm-seed-status {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ── Card Meta rows ── */
.srm-card-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.srm-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.srm-meta-k {
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}

.srm-meta-v {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* =============================================================
   THANHUB PREMIUM DASHBOARD BLUE/BLACK REFRESH
   Mobile-first, lower GPU cost, modern dashboard surfaces.
   ============================================================= */
:root {
  --bg: #020617;
  --bg-dark: #030712;
  --bg-gradient: radial-gradient(circle at 12% -8%, rgba(37, 99, 235, 0.25), transparent 34rem), linear-gradient(180deg, #020617 0%, #071225 48%, #020617 100%);
  --surface: rgba(15, 23, 42, 0.64);
  --surface-mid: rgba(30, 41, 59, 0.72);
  --surface-strong: rgba(51, 65, 85, 0.82);
  --line: rgba(147, 197, 253, 0.12);
  --line-mid: rgba(147, 197, 253, 0.22);
  --line-strong: rgba(191, 219, 254, 0.36);
  --text: #f8fbff;
  --muted: #9fb0c7;
  --subtle: #64748b;
  --blue: #38bdf8;
  --blue-dark: #2563eb;
  --blue-glow: rgba(56, 189, 248, 0.28);
  --violet: #3b82f6;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --green-line: rgba(34, 197, 94, 0.22);
  --amber: #93c5fd;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 28px 72px rgba(2, 6, 23, 0.76);
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --sidebar-w: 288px;
}

body::before { animation: none; width: 720px; height: 720px; background: radial-gradient(circle, rgba(37, 99, 235, 0.18) 0%, transparent 68%); }
body::after { background-size: 36px 36px; opacity: .7; }

.sidebar {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.96), rgba(8, 15, 31, 0.96));
  border-right-color: var(--line-mid);
  padding: 18px 14px 14px;
}
.sidebar-logo { border-color: rgba(56,189,248,.28); background: rgba(56,189,248,.10); }
.sidebar-brand { background: linear-gradient(135deg, #fff 20%, #93c5fd 55%, #38bdf8 100%); -webkit-background-clip: text; background-clip: text; }
.sidebar-link { min-height: 46px; border-radius: 10px; font-weight: 750; }
.sidebar-link:hover { background: rgba(30, 41, 59, .72); border-color: rgba(147,197,253,.22); }
.sidebar-link.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, .24), rgba(56, 189, 248, .12));
  color: #dbeafe;
  border-color: rgba(56, 189, 248, .42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 26px rgba(37,99,235,.14);
}
.sidebar-section-title { color: #6f86a8; letter-spacing: 1.4px; }
.sidebar-user { background: rgba(15,23,42,.58); border: 1px solid rgba(147,197,253,.14); border-radius: 14px; padding: 12px; }
.logout-btn { border-radius: 10px; }

.main-content { padding: 24px 28px 44px; }
.top-status-bar { min-height: 44px; margin-bottom: 22px; }
.nav-status { border: 1px solid rgba(147,197,253,.16); background: rgba(15,23,42,.62); border-radius: 999px; padding: 8px 12px; }
#timer-text { background: rgba(37,99,235,.16); border-color: rgba(56,189,248,.32); color: #bfdbfe; }

.header-section { text-align: left; margin-bottom: 24px; }
.gradient-text { background: linear-gradient(135deg, #fff 16%, #93c5fd 58%, #38bdf8 100%); -webkit-background-clip: text; background-clip: text; letter-spacing: -1px; }
.subtitle { max-width: 760px; line-height: 1.7; }
.browser-card, .server-item, .ui-card, .ui-stat-card, .srm-header, .pet-card, .stock-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, .84), rgba(3, 7, 18, .9)) !important;
  border: 1px solid rgba(147, 197, 253, .18) !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow) !important;
}
.browser-card { padding: 20px; }
.browser-card::before, .server-item::before { background: linear-gradient(90deg, transparent, rgba(56,189,248,.7), transparent); opacity: .55; }

.controls { gap: 10px; }
input[type="text"], input[type="number"], input[type="search"] {
  height: 44px;
  border-radius: 10px;
  background: rgba(2, 6, 23, .72);
  border-color: rgba(147,197,253,.22);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.refresh-btn, .game-tab.active, .filter-tag-pill.active, .join-btn, .page-btn:not(:disabled) {
  background: linear-gradient(135deg, #2563eb, #38bdf8) !important;
  border-color: rgba(147,197,253,.45) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(37,99,235,.22) !important;
  border-radius: 10px !important;
}
.filter-toggle-btn, .filter-tag-pill, .page-btn, .game-switch { border-radius: 10px; background: rgba(15,23,42,.64); border-color: rgba(147,197,253,.16); }
.server-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.server-item { min-height: 230px; padding: 18px; }
.server-item:hover { transform: translateY(-2px); border-color: rgba(56,189,248,.42) !important; }
.event-tag, .server-index, .total-players-badge { background: rgba(37,99,235,.16); border-color: rgba(56,189,248,.28); color: #bfdbfe; }

.ui-page { max-width: 980px; margin: 0 auto; }
.ui-card, .ui-stat-card { padding: 18px !important; }
.ui-avatar { border-color: rgba(56,189,248,.4) !important; }
.ui-status-pill, .ui-badge-plan { background: rgba(37,99,235,.16) !important; border-color: rgba(56,189,248,.28) !important; color: #bfdbfe !important; }
.ui-icon-btn { border-radius: 10px !important; border-color: rgba(147,197,253,.18) !important; background: rgba(15,23,42,.72) !important; }

@media (max-width: 900px) {
  .sidebar { width: min(88vw, 320px); transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; width: 100%; padding: calc(14px + var(--safe-top)) 14px calc(28px + var(--safe-bottom)); }
  .menu-toggle-btn { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid rgba(147,197,253,.2); background: rgba(15,23,42,.78); color: #dbeafe; }
  .top-status-bar { justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 120; padding: 8px 0; background: linear-gradient(180deg, rgba(2,6,23,.96), rgba(2,6,23,.72)); backdrop-filter: blur(10px); }
  .nav-status { min-width: 0; overflow: hidden; white-space: nowrap; font-size: 10px; }
  .header-section { text-align: left; margin: 18px 0; }
  .gradient-text { font-size: clamp(28px, 9vw, 42px); }
  .browser-card { padding: 14px; border-radius: 12px !important; }
  .controls.controls-visible { display: grid; grid-template-columns: 1fr; }
  .search-wrapper { min-width: 0; }
  .server-grid { grid-template-columns: 1fr; gap: 12px; }
  .server-item:hover { transform: none; }
  .pagination-container { gap: 8px; }
}

@media (hover: none), (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .server-item:hover, .refresh-btn:hover, .logout-btn:hover { transform: none !important; }
  .sidebar, .browser-card, .server-item, .ui-card, .ui-stat-card { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}

/* THANHUB 2026 PREMIUM WORKSPACE */
body { background-color: #020617; background-image: radial-gradient(circle at 8% -10%, rgba(37,99,235,.25), transparent 32rem), linear-gradient(180deg,#020617 0%,#07152f 55%,#020617 100%); }
body::before, body::after { animation: none !important; opacity: .22; }
.dashboard-container { background: transparent; }
.sidebar { background: linear-gradient(180deg, rgba(2,6,23,.98), rgba(5,16,38,.96)); border-right: 1px solid rgba(125,211,252,.18); }
.sidebar-header { min-height: 68px; border-bottom-color: rgba(125,211,252,.12); }
.sidebar-logo { width: 38px; height: 38px; padding: 7px; border-radius: 12px; background: rgba(14,165,233,.13); border-color: rgba(56,189,248,.36); }
.sidebar-brand { letter-spacing: .14em; }
.sidebar-link { min-height: 48px; margin: 2px 0; border: 1px solid transparent; border-radius: 12px; color: #9fb0c7; }
.sidebar-link:hover { background: rgba(30,64,115,.38); border-color: rgba(125,211,252,.16); color: #f8fbff; }
.sidebar-link.active { background: linear-gradient(135deg, rgba(37,99,235,.30), rgba(14,165,233,.13)); border-color: rgba(56,189,248,.44); color: #e0f2fe; box-shadow: 0 10px 28px rgba(37,99,235,.16), inset 0 1px 0 rgba(255,255,255,.08); }
.sidebar-section-title { color: #6f86a8; font-size: 10px; letter-spacing: .16em; }
.sidebar-user { background: rgba(7,23,52,.75); border-color: rgba(125,211,252,.16); border-radius: 16px; }
.main-content { background: transparent; }
.top-status-bar { border-bottom-color: rgba(125,211,252,.12); }
.nav-status { background: rgba(7,20,45,.76); border-color: rgba(125,211,252,.18); }
#timer-text { background: rgba(37,99,235,.22); border-color: rgba(56,189,248,.35); color: #bae6fd; }
.header-section { max-width: 980px; }
.gradient-text { background: linear-gradient(135deg,#fff 12%,#bfdbfe 50%,#38bdf8 100%); -webkit-background-clip:text; background-clip:text; }
.subtitle { color: #9fb0c7; }
.browser-card, .server-item, .ui-card, .ui-stat-card, .srm-header, .pet-card, .stock-card { background: linear-gradient(145deg, rgba(8,22,48,.94), rgba(3,9,25,.96)) !important; border-color: rgba(125,211,252,.18) !important; border-radius: 16px !important; box-shadow: 0 18px 44px rgba(0,0,0,.36) !important; }
.browser-card { padding: 22px; }
.controls { padding: 12px; border: 1px solid rgba(125,211,252,.12); border-radius: 14px; background: rgba(2,8,24,.48); }
input[type="text"], input[type="number"], input[type="search"] { background: rgba(2,8,24,.84); border-color: rgba(125,211,252,.20); border-radius: 11px; }
.refresh-btn, .game-tab.active, .filter-tag-pill.active, .join-btn, .page-btn:not(:disabled) { background: linear-gradient(135deg,#2563eb,#0ea5e9) !important; border-color: rgba(125,211,252,.42) !important; box-shadow: 0 10px 24px rgba(37,99,235,.22) !important; }
.filter-toggle-btn, .filter-tag-pill, .page-btn, .game-switch { border-color: rgba(125,211,252,.18); background: rgba(7,20,45,.75); border-radius: 11px; }
.server-grid { gap: 16px; }
.server-item { min-height: 236px; }
.server-item:hover { border-color: rgba(56,189,248,.48) !important; box-shadow: 0 20px 44px rgba(0,0,0,.42), 0 0 0 1px rgba(56,189,248,.08) inset !important; }
.event-tag, .server-index, .total-players-badge { background: rgba(37,99,235,.20); border-color: rgba(56,189,248,.30); color: #bfdbfe; }
.ui-status-pill, .ui-badge-plan { background: rgba(37,99,235,.18) !important; border-color: rgba(56,189,248,.32) !important; color: #bae6fd !important; }
.ui-icon-btn { background: rgba(7,20,45,.84) !important; border-color: rgba(125,211,252,.18) !important; border-radius: 11px !important; }
@media (max-width: 900px) {
  .main-content { padding: calc(12px + var(--safe-top)) 12px calc(28px + var(--safe-bottom)); }
  .top-status-bar { border-bottom: 0; }
  .browser-card { padding: 14px; }
  .controls { padding: 10px; }
  .server-item { min-height: 0; }
}
/* THANHUB 2026 WORKSPACE LAYOUT PASS */
.main-content { max-width: 1540px; margin-right: auto; }
.top-status-bar { position: sticky; top: 0; z-index: 120; padding: 10px 0; background: linear-gradient(180deg, rgba(2,6,23,.96), rgba(2,6,23,.82), transparent); backdrop-filter: blur(12px); }
.top-status-bar::before { content: "THANHUB / PREMIUM WORKSPACE"; margin-right: auto; color: #6f86a8; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
#tab-thanserver, #tab-gag2, #tab-userinfo, #tab-fisch, #tab-admin-cmd, #tab-admin-logs, #tab-bot-logs, #tab-admin-sessions { max-width: 1420px; margin: 0 auto; }
.header-section { position: relative; padding-left: 18px; }
.header-section::before { content: "LIVE OPERATIONS"; display: block; margin-bottom: 10px; color: #38bdf8; font-size: 10px; font-weight: 900; letter-spacing: .18em; }
#tab-gag2 .header-section::before { content: "GROW A GARDEN / LIVE DATA"; }
#tab-userinfo .header-section::before { content: "ACCOUNT CENTER"; }
#mainBrowserCard { padding: 24px !important; }
#mainBrowserCard::after { content: "LIVE INDEX"; position: absolute; top: 20px; right: 24px; color: #6f86a8; font-size: 9px; font-weight: 900; letter-spacing: .16em; }
#serverGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.server-item { min-height: 268px; padding: 20px; border-radius: 17px !important; }
.server-item::after { content: ""; position: absolute; inset: auto 18px 0; height: 2px; background: linear-gradient(90deg, transparent, rgba(56,189,248,.65), transparent); opacity: .45; }
.server-card-head { padding-right: 18px; }
.server-meta-item { background: rgba(2,8,24,.52); border-color: rgba(125,211,252,.12); }
.relic-box, .pet-timer-box, .high-fruit-box, .info-box { background: rgba(2,8,24,.58); border-color: rgba(125,211,252,.13); }
.join-btn { min-height: 46px; letter-spacing: .08em; }
#paginationControls { max-width: 700px; margin-inline: auto; }
#filterPanel { background: rgba(2,8,24,.54); }
#tab-gag2 .dashboard-sub-tabs { display: flex; flex-wrap: wrap; gap: 8px !important; padding: 6px; width: fit-content; max-width: 100%; border: 1px solid rgba(125,211,252,.14); border-radius: 14px; background: rgba(2,8,24,.46); }
#tab-gag2 .dashboard-sub-tabs button { min-height: 40px; border-radius: 10px !important; padding-inline: 14px !important; }
#admin-logs-container, #bot-logs-container { background: rgba(2,8,24,.74) !important; border-color: rgba(125,211,252,.16) !important; }
.ui-page { max-width: 1120px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ui-page > .ui-identity-card, .ui-page > .ui-stats-row { grid-column: 1 / -1; }
.ui-identity-card { padding: 24px !important; }
.ui-stats-row { gap: 16px; }
.ui-stat-card { min-height: 96px; }
.ui-page > .ui-card { min-height: 170px; }
.sidebar-overlay { background: rgba(1,5,18,.76); backdrop-filter: blur(4px); }
@media (max-width: 1180px) { #serverGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .top-status-bar::before { content: "THANHUB / LIVE"; font-size: 9px; }
  #mainBrowserCard { padding: 16px !important; }
  #mainBrowserCard::after { top: 16px; right: 16px; }
  #serverGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: 18px 0 48px rgba(0,0,0,.48); }
  .ui-page { grid-template-columns: 1fr; }
  .ui-page > .ui-card { min-height: 0; }
}
@media (max-width: 640px) {
  .top-status-bar::before { content: "THANHUB"; }
  .header-section { padding-left: 0; }
  .header-section::before { margin-bottom: 8px; }
  #serverGrid { grid-template-columns: 1fr; }
  .server-item { min-height: 0; }
  #tab-gag2 .dashboard-sub-tabs { width: 100%; }
  #tab-gag2 .dashboard-sub-tabs button { flex: 1 1 30%; }
}
/* THANHUB MOBILE READABILITY PASS */
body { font-size: 15px; line-height: 1.55; }
.gradient-text { font-size: 42px; line-height: 1.12; letter-spacing: 0; }
.subtitle { font-size: 15px; line-height: 1.65; }
.header-section::before { font-size: 11px; letter-spacing: .14em; }
.nav-status, #timer-text { font-size: 11px; letter-spacing: .04em; }
.game-tab, #tab-gag2 .dashboard-sub-tabs button { font-size: 13px !important; min-height: 44px; }
.filter-toggle-btn, .filter-tag-pill, .refresh-btn, .page-btn, .join-btn { font-size: 13px; }
.event-name { font-size: 17px; line-height: 1.35; }
.pet-name { font-size: 18px; }
.card-kicker, .server-index { font-size: 11px; letter-spacing: .04em; }
.server-meta-label, .relic-copy span, .pet-timer-label, .high-fruit-label { font-size: 10px; letter-spacing: .04em; }
.server-meta-item span:last-child, .relic-copy strong, .high-fruit-value { font-size: 14px; }
.info-box, .high-fruit-price, .job-id-text, .copy-id-btn { font-size: 12px; line-height: 1.5; }
.ui-label, .ui-badge-plan, .ui-status-pill { font-size: 11px; }
.ui-card-title { font-size: 14px; }
.ui-value { font-size: 15px; }
.ui-key-text, .ui-mono { font-size: 14px; }
.srm-timer-label, .srm-badge-label { font-size: 10px; letter-spacing: .08em; }
.srm-timer-val { font-size: 22px; letter-spacing: 1px; }
.srm-badge-val { font-size: 22px; }
.srm-pill { min-height: 38px; padding: 7px 13px; font-size: 12px; }
.srm-seed-name { font-size: 14px; line-height: 1.35; }
.srm-seed-status, .srm-meta-row { font-size: 12px; }

@media (max-width: 640px) {
  .main-content { padding-inline: 14px; }
  .top-status-bar { min-height: 52px; gap: 8px; }
  .top-status-bar::before { font-size: 10px; letter-spacing: .1em; }
  .nav-status { padding: 8px 10px; font-size: 11px; gap: 8px; }
  #timer-text { padding: 5px 9px; font-size: 11px; }
  .header-section { margin: 22px 0 26px; }
  .gradient-text { font-size: 32px; line-height: 1.15; letter-spacing: 0; overflow-wrap: anywhere; }
  .subtitle { margin-top: 12px; font-size: 15px; line-height: 1.6; }
  .header-section::before { font-size: 10px; letter-spacing: .12em; }
  #tab-gag2 .dashboard-sub-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px !important; }
  #tab-gag2 .dashboard-sub-tabs button { width: 100%; min-width: 0; padding: 8px 6px !important; font-size: 12px !important; line-height: 1.25; }
  #mainBrowserCard { padding: 14px !important; }
  .controls { gap: 9px; }
  input[type="text"], input[type="number"], input[type="search"] { min-height: 46px; font-size: 16px; padding-inline: 14px; }
  .filter-toggle-btn, .refresh-btn, .join-btn, .page-btn { min-height: 44px; font-size: 13px; }
  .server-item { padding: 17px; }
  .event-name { font-size: 17px; }
  .server-meta-item { min-height: 56px; }
  .ui-card, .ui-stat-card { padding: 16px !important; }
  .ui-username { font-size: 18px; }
  .ui-stat-num { font-size: 24px; }

  .srm-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px 10px;
    padding: 15px;
  }
  .srm-timer-ring { width: 52px; height: 52px; }
  .srm-timer-block { min-width: 0; gap: 9px; }
  .srm-timer-val { font-size: 20px; }
  .srm-badges { flex-wrap: nowrap; gap: 6px; }
  .srm-badge { min-width: 62px; padding: 8px 10px; }
  .srm-controls { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; width: 100%; gap: 9px; }
  #srm-search { width: 100%; max-width: none !important; min-width: 0 !important; }
  .srm-filter-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .srm-pill { width: 100%; min-width: 0; min-height: 42px; padding-inline: 6px; font-size: 12px; }
  .srm-refresh { width: 100%; justify-content: center; min-height: 44px; }
  .srm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .srm-card { min-width: 0; padding: 13px; gap: 11px; }
  .srm-card-top { align-items: flex-start; gap: 9px; }
  .srm-seed-img { width: 42px; height: 42px; }
  .srm-seed-name { white-space: normal; overflow-wrap: anywhere; }
  .srm-meta-row { gap: 8px; }
}

@media (max-width: 380px) {
  .main-content { padding-inline: 10px; }
  .gradient-text { font-size: 29px; }
  .top-status-bar::before { display: none; }
  .srm-header { grid-template-columns: 1fr; }
  .srm-badges, .srm-controls { grid-column: 1; }
  .srm-badges { width: 100%; }
  .srm-badge { flex: 1; }
  .srm-grid { grid-template-columns: 1fr; }
}

/* =============================================================
   THANHUB DASHBOARD — UI/UX ANIMATION SYSTEM 2026
   Space Grotesk · Scroll Reveal · Micro-interactions · Stagger
   Based on UI UX Pro Max Skill (motion.csv)
   ============================================================= */

/* ── Space Grotesk for dashboard headings ── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

.gradient-text, .sidebar-brand, h1, h2, h3, .section-title {
  font-family: "Space Grotesk", "Inter", -apple-system, sans-serif !important;
}

/* ── Motion Variables ── */
:root {
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:    150ms;
  --dur-med:     280ms;
  --dur-slow:    450ms;
}

/* ── Scroll Reveal System ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }

/* ── Stagger for server grids ── */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.38s var(--ease-out), transform 0.38s var(--ease-out);
}
.reveal-stagger.visible > *:nth-child(1)  { opacity:1; transform:none; transition-delay:0.00s; }
.reveal-stagger.visible > *:nth-child(2)  { opacity:1; transform:none; transition-delay:0.05s; }
.reveal-stagger.visible > *:nth-child(3)  { opacity:1; transform:none; transition-delay:0.10s; }
.reveal-stagger.visible > *:nth-child(4)  { opacity:1; transform:none; transition-delay:0.15s; }
.reveal-stagger.visible > *:nth-child(5)  { opacity:1; transform:none; transition-delay:0.20s; }
.reveal-stagger.visible > *:nth-child(6)  { opacity:1; transform:none; transition-delay:0.25s; }
.reveal-stagger.visible > *:nth-child(7)  { opacity:1; transform:none; transition-delay:0.30s; }
.reveal-stagger.visible > *:nth-child(8)  { opacity:1; transform:none; transition-delay:0.35s; }
.reveal-stagger.visible > *:nth-child(9)  { opacity:1; transform:none; transition-delay:0.40s; }
.reveal-stagger.visible > *:nth-child(10) { opacity:1; transform:none; transition-delay:0.45s; }
.reveal-stagger.visible > *:nth-child(n+11) { opacity:1; transform:none; transition-delay:0.50s; }

/* ── Keyframes ── */
@keyframes shimmer-sweep {
  0%   { background-position: 200% 50%; }
  100% { background-position: -200% 50%; }
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes tab-slide-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ── Dashboard gradient text shimmer ── */
.gradient-text {
  background-size: 250% 100% !important;
  animation: shimmer-sweep 7s ease-in-out infinite !important;
}

/* ── Sidebar enhancements ── */
.sidebar {
  transition: width var(--dur-slow) var(--ease-out);
}
.sidebar::before {
  animation: glow-pulse 4s ease-in-out infinite;
}
.sidebar-link {
  transition: all var(--dur-med) var(--ease-out) !important;
  will-change: transform;
}
.sidebar-link:hover {
  transform: translateX(3px);
}
.sidebar-link.active {
  box-shadow: 0 0 20px rgba(74, 163, 255, 0.08) inset !important;
}

/* ── Browser card stagger ── */
.browser-card {
  transition: transform var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out),
              border-color var(--dur-med) var(--ease-out);
}
.browser-card:hover {
  transform: translateY(-4px);
  border-color: rgba(74, 163, 255, 0.35) !important;
  box-shadow: 0 20px 48px rgba(0,0,0,0.65), 0 0 0 1px rgba(74,163,255,0.1) inset;
}

/* ── Server row hover ── */
.server-row {
  transition: background var(--dur-fast), border-color var(--dur-fast),
              transform var(--dur-med) var(--ease-out) !important;
}
.server-row:hover {
  transform: translateX(3px);
  border-color: rgba(74,163,255,0.3) !important;
}

/* ── Tab transitions ── */
.dashboard-tab {
  animation: tab-slide-in 0.3s var(--ease-out) both !important;
}

/* ── Tab button enhanced ── */
.tab-btn {
  position: relative;
  transition: all var(--dur-med) var(--ease-out) !important;
}
.tab-btn::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 20%; right: 20%;
  height: 2px;
  background: var(--blue);
  border-radius: var(--r-pill);
  transform: scaleX(0);
  transition: transform var(--dur-med) var(--ease-out);
}
.tab-btn.active::after { transform: scaleX(1); }

/* ── Search/filter input glow ── */
.search-input:focus,
.filter-select:focus,
input[type="text"]:focus,
input[type="search"]:focus {
  border-color: rgba(74,163,255,0.5) !important;
  box-shadow: 0 0 0 3px rgba(74,163,255,0.08) !important;
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

/* ── Join button pulse on hover ── */
.join-btn {
  transition: all var(--dur-med) var(--ease-out) !important;
  position: relative;
  overflow: hidden;
}
.join-btn::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.join-btn:hover::after { opacity: 1; }
.join-btn:active { transform: scale(0.96) !important; }

/* ── Pulse dot enhanced ── */
.pulse-dot {
  position: relative;
}
.pulse-dot::before {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--green);
  opacity: 0;
  animation: pulse-ring 2.5s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ── Stats card enhanced ── */
.ui-stat-card,
.stat-card {
  transition: transform var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out) !important;
}
.ui-stat-card:hover, .stat-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5) !important;
}

/* ── Sidebar entrance animation ── */
@media (min-width: 768px) {
  .sidebar { animation: slide-in-left 0.4s var(--ease-out) both; }
}

/* ── Shimmer loading bar ── */
.loading-bar {
  height: 2px;
  background: linear-gradient(90deg, #2563eb, #38bdf8, #7dd3fc, #2563eb);
  background-size: 200%;
  animation: shimmer-sweep 1.5s linear infinite;
  border-radius: var(--r-pill);
}

/* ── Mobile sidebar enhanced slide ── */
.sidebar.mobile-open {
  animation: slide-in-left 0.35s var(--ease-out) both;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; }
  .gradient-text, .sidebar::before { animation: none !important; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --- SESSIONS MANAGEMENT TAB (MOBILE & DESKTOP ULTRA UI/UX) --- */
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

@media (max-width: 640px) {
    .sessions-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.session-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.7));
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 16px;
    padding: 18px;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.session-card:hover {
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.15);
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.session-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    color: #38bdf8;
    font-size: 15px;
    letter-spacing: 0.02em;
}

.session-live-dot {
    width: 9px;
    height: 9px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981, 0 0 4px #10b981;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.session-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
    color: #94a3b8;
}

.session-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.session-detail-label {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.session-detail-val {
    color: #f1f5f9;
    font-weight: 600;
    font-family: 'Inter', monospace;
    text-align: right;
    word-break: break-all;
}

.session-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.session-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.session-btn-msg {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(14, 165, 233, 0.1));
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.session-btn-msg:active, .session-btn-msg:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(14, 165, 233, 0.25));
    border-color: #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.session-btn-shutdown {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(225, 29, 72, 0.1));
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.session-btn-shutdown:active, .session-btn-shutdown:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(225, 29, 72, 0.25));
    border-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

/* Modals for Mobile & iOS/Android Touch */
.th-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.th-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.th-modal-card {
    background: #0f172a;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.th-modal-backdrop.active .th-modal-card {
    transform: translateY(0) scale(1);
}

.th-modal-card input.admin-input,
.th-modal-card textarea.admin-input {
    background: #020617 !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    color: #f8fafc !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    outline: none !important;
}

.th-modal-card input.admin-input:focus,
.th-modal-card textarea.admin-input:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25) !important;
}