/* ============================================================
   MINESITE — server.css
   Design tokens + fonts synced with style.css (homepage)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables (mirrored from style.css) ── */
:root {
  /* Backgrounds */
  --bg:           #060b06;
  --bg-2:         #0d160d;
  --bg-3:         #131f13;
  --bg-card:      #0f1a0f;
  --bg-elevated:  #172417;

  /* Borders */
  --border:       #1f3320;
  --border-2:     #2e5030;
  --border-focus: #4ade80;

  /* Brand palette */
  --green:        #4ade80;
  --mc:           #4ade80;   /* alias used in server rows */
  --green-dim:    #34c265;
  --mc-dim:       #34c265;
  --green-muted:  #2a9e52;
  --green-glow:   rgba(74, 222, 128, 0.18);
  --mc-glow:      rgba(74, 222, 128, 0.12);
  --green-soft:   rgba(74, 222, 128, 0.08);

  /* Accents */
  --gold:         #f59e0b;
  --gold-soft:    rgba(245, 158, 11, 0.1);
  --cyan:         #06b6d4;
  --cyan-soft:    rgba(6, 182, 212, 0.08);
  --amber:        #fb923c;

  /* Text */
  --text:         #e2f0e2;
  --text-2:       #9dbe9d;
  --text-3:       #5e7e5e;
  --text-inv:     #060b06;

  /* Semantic */
  --danger:       #f87171;
  --success:      #4ade80;
  --warning:      #f59e0b;

  /* Typography — synced with homepage */
  --sans:   'DM Sans', system-ui, -apple-system, sans-serif;
  --mono:   'DM Mono', 'Courier New', monospace;
  --pixel:  'Press Start 2P', cursive;

  /* Layout */
  --radius:      6px;
  --radius-lg:   12px;
  --radius-xl:   18px;
  --sidebar-w:   260px;
  --header-h:    68px;
  --bar-h:       48px;
  --sticky-top:  calc(var(--header-h) + var(--bar-h));

  /* Motion */
  --dur-fast:  0.15s;
  --dur-base:  0.22s;
  --dur-slow:  0.4s;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --transition: all var(--dur-base) var(--ease);
}

/* ── Reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
    --dur-slow: 0ms;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image:
    linear-gradient(rgba(74,222,128,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74,222,128,0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Global focus ── */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ── Utilities ── */
.pixel     { font-family: var(--pixel); letter-spacing: 0.05em; }
.mono      { font-family: var(--mono); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }

.skip-link {
  position: absolute; top: -60px; left: 1rem;
  background: var(--green); color: var(--bg);
  padding: 10px 20px; font-weight: 700; font-size: 0.9rem;
  text-decoration: none; z-index: 9999;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }


/* ============================================================
   HEADER — identical to homepage style.css
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(6, 11, 6, 0.9);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.nav-container {
  display: flex; align-items: center;
  justify-content: space-between;
  height: 68px; gap: 1rem;
}

/* Logo */
.logo {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none; flex-shrink: 0;
  transition: var(--transition);
}
.logo-icon-svg {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 8px; border: 1px solid var(--border-2);
}
.logo-text {
  font-family: var(--pixel); font-size: 0.65rem;
  color: var(--green); letter-spacing: 0.1em;
  text-shadow: 0 0 16px rgba(74, 222, 128, 0.55);
  transition: color var(--dur-base) var(--ease);
}
.logo:hover .logo-text { color: #b9f5d0; }

/* Nav links */
.main-nav ul  { display: flex; gap: 1.5rem; list-style: none; align-items: center; }
.main-nav a {
  font-family: var(--sans); font-size: 0.875rem;
  font-weight: 500; color: var(--text-2);
  text-decoration: none; letter-spacing: 0.01em;
  transition: color var(--dur-base) var(--ease);
  position: relative; padding-bottom: 2px;
}
.main-nav a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--green); border-radius: 1px;
  transition: width var(--dur-base) var(--ease);
}
.main-nav a:hover        { color: var(--text); }
.main-nav a:hover::after { width: 100%; }
.main-nav a.active       { color: var(--green); }
.main-nav a.active::after { width: 100%; }

/* Download CTA */
.nav-cta {
  background: var(--green-soft) !important;
  border: 1px solid var(--border-2) !important;
  border-radius: 999px !important;
  padding: 0.42rem 1.1rem !important;
  color: var(--green) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}
.nav-cta:hover {
  background: rgba(74, 222, 128, 0.14) !important;
  border-color: var(--green-muted) !important;
  color: #b9f5d0 !important;
}
.nav-cta::after { display: none !important; }

/* Hamburger */
.mobile-menu-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 1px solid transparent; cursor: pointer;
  padding: 0.5rem; border-radius: var(--radius);
  transition: border-color var(--dur-base) var(--ease);
}
.mobile-menu-toggle:hover { border-color: var(--border-2); }
.burger-line {
  display: block; width: 22px; height: 2px;
  background: var(--text-2); border-radius: 2px;
  transition: var(--transition);
}


/* ============================================================
   EDITION BAR
   ============================================================ */
.edition-bar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  height: var(--bar-h);
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  display: flex;
  align-items: center;
}
.edition-bar-inner {
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; height: 100%;
}
.edition-explain {
  font-size: 0.75rem; color: var(--text-3); line-height: 1.5;
  font-family: var(--sans);
}
.edition-toggle {
  display: flex; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; flex-shrink: 0;
}
.edition-tab {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 1rem; background: transparent;
  border: none; border-right: 1px solid var(--border);
  color: var(--text-3); font-family: var(--sans);
  font-size: 0.78rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: var(--transition);
}
.edition-tab:last-child { border-right: none; }
.edition-tab:hover  { color: var(--text-2); background: var(--bg-3); }
.edition-tab.active { background: rgba(74,222,128,0.07); color: var(--green); }
.ed-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-java    { background: var(--cyan); }
.dot-bedrock { background: var(--gold); }
.dot-all     { background: var(--green); }


/* ============================================================
   LAYOUT + SIDEBAR
   ============================================================ */
.layout { display: flex; flex: 1; }
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1.75rem 1.25rem;
  position: sticky;
  top: var(--sticky-top);
  height: calc(100vh - var(--sticky-top));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

.sidebar-title {
  font-family: var(--pixel); font-size: 0.48rem;
  color: var(--text-3); letter-spacing: 0.2em;
  text-transform: uppercase; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.search-box { position: relative; }
.search-box svg {
  position: absolute; left: 0.75rem; top: 50%;
  transform: translateY(-50%); color: var(--text-3); pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 0.65rem 0.75rem 0.65rem 2.2rem;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  font-family: var(--sans); font-size: 0.85rem;
  transition: var(--transition);
}
.search-input:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px var(--mc-glow);
}
.search-input::placeholder { color: var(--text-3); }

.filter-section-label {
  font-size: 0.48rem; font-family: var(--pixel);
  color: var(--text-3); letter-spacing: 0.15em;
  text-transform: uppercase; margin-bottom: 0.6rem;
}

.edition-filters { display: flex; flex-direction: column; gap: 0.3rem; }
.edition-btn {
  padding: 0.5rem 0.75rem; background: transparent;
  border: 1px solid var(--border); color: var(--text-2);
  font-family: var(--sans); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; border-radius: var(--radius);
  text-align: left; display: flex; align-items: center; gap: 0.6rem;
  transition: var(--transition);
}
.edition-btn:hover { border-color: var(--border-2); color: var(--text); }
.edition-btn.active-all     { border-color: var(--green);  color: var(--green);  background: rgba(74,222,128,0.07); }
.edition-btn.active-java    { border-color: var(--cyan);   color: var(--cyan);   background: rgba(6,182,212,0.07); }
.edition-btn.active-bedrock { border-color: var(--gold);   color: var(--gold);   background: rgba(245,158,11,0.07); }

.edition-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-all     { background: var(--green); }
.dot-java    { background: var(--cyan); }
.dot-bedrock { background: var(--gold); }

.filter-group { display: flex; flex-direction: column; gap: 0.2rem; }
.filter-label {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.4rem 0.5rem; cursor: pointer; border-radius: var(--radius);
  font-size: 0.82rem; color: var(--text-2); font-family: var(--sans);
  transition: var(--transition);
}
.filter-label:hover { background: var(--bg-3); color: var(--text); }

.filter-checkbox {
  appearance: none; width: 15px; height: 15px;
  border: 1px solid var(--border-2); background: var(--bg);
  border-radius: 3px; cursor: pointer; flex-shrink: 0; position: relative;
  transition: var(--transition);
}
.filter-checkbox:checked { background: var(--green); border-color: var(--green); }
.filter-checkbox:checked::after {
  content: '✓'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%); color: var(--bg); font-size: 9px; font-weight: 700;
}

.filter-tag-name { flex: 1; }
.filter-count {
  font-size: 0.65rem; color: var(--text-3); background: var(--bg-3);
  border: 1px solid var(--border); padding: 0.08rem 0.38rem;
  border-radius: 10px; min-width: 22px; text-align: center;
  font-family: var(--mono);
}

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 0.5rem; }

.status-legend {
  display: flex; gap: 1rem; font-size: 0.75rem; color: var(--text-3);
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem; align-items: center;
}
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.35rem; }
.online-dot  { background: var(--green); }
.offline-dot { background: var(--danger); }

.reset-btn {
  padding: 0.55rem 1rem; background: transparent;
  border: 1px solid var(--border); color: var(--text-3);
  font-family: var(--sans); font-size: 0.8rem; cursor: pointer;
  border-radius: var(--radius); width: 100%;
  transition: var(--transition);
}
.reset-btn:hover { border-color: var(--border-2); color: var(--text-2); background: var(--bg-3); }

/* Close button in sidebar (hidden on desktop) */
.close-mobile-btn {
  display: none; 
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--danger);
}
.close-mobile-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}


/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main {
  flex: 1; padding: 2rem 2rem 3rem;
  min-width: 0; display: flex; flex-direction: column; gap: 1.25rem;
}

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }

.page-title {
  font-family: var(--pixel); font-size: 0.75rem;
  color: var(--green); letter-spacing: 0.08em; line-height: 1.6;
  margin-bottom: 0.35rem;
  text-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}
.page-subtitle {
  font-size: 0.9rem; color: var(--text-2); margin-bottom: 0.25rem;
}
.page-count {
  font-size: 0.8rem; color: var(--text-3);
  font-family: var(--mono);
}
.page-count span { color: var(--green); font-weight: 600; }

/* Sort bar */
.sort-bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
}
.sort-label { font-size: 0.8rem; color: var(--text-3); font-family: var(--sans); white-space: nowrap; }
.sort-select {
  padding: 0.42rem 0.85rem; background: var(--bg-card);
  border: 1px solid var(--border); color: var(--text);
  font-family: var(--sans); font-size: 0.82rem; border-radius: var(--radius);
  cursor: pointer; transition: var(--transition);
}
.sort-select:focus { outline: none; border-color: var(--green); }
.sort-select:hover { border-color: var(--border-2); }

/* Filter button — only visible on tablet/mobile via media query */
.filter-sort-btn { display: none; }

/* Table header */
.table-header {
  display: grid;
  grid-template-columns: 42px 1fr 130px 200px;
  padding: 0.5rem 1rem;
  font-size: 0.65rem; font-family: var(--pixel);
  color: var(--text-3); letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
}
.th-rank    { text-align: center; }
.th-players { text-align: center; }
.th-ip      { text-align: right; }

/* Server list */
.server-list {
  display: flex; flex-direction: column; gap: 0.4rem;
}

/* ── Skeleton loader ── */
.skeleton-row {
  height: 72px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Server row ── */
.server-row {
  display: grid;
  grid-template-columns: 42px 1fr 130px 200px;
  align-items: center;
  min-height: 72px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0 1rem;
  gap: 0.5rem;
  transition: border-color var(--dur-base) var(--ease),
              background    var(--dur-base) var(--ease),
              transform     var(--dur-base) var(--ease),
              box-shadow    var(--dur-base) var(--ease);
}
.server-row:hover {
  border-color: var(--border-2);
  background: var(--bg-elevated);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.server-row.online  {
  border-left: 3px solid rgba(74,222,128,0.5);
}
.server-row.online:hover {
  border-color: rgba(74,222,128,0.45);
}

/* Rank */
.row-rank {
  text-align: center; font-family: var(--mono);
  font-size: 0.72rem; color: var(--text-3);
}

/* Info block */
.row-info {
  display: flex; align-items: center; gap: 0.85rem; min-width: 0;
}

.row-icon {
  width: 48px; height: 48px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease);
}
.row-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.server-row:hover .row-icon { transform: scale(1.05); }

.row-text { flex: 1; min-width: 0; }

.row-name-line {
  display: flex; align-items: center; gap: 0.5rem;
  flex-wrap: nowrap; margin-bottom: 0.2rem; overflow: hidden;
}
.row-name {
  font-weight: 600; font-size: 0.92rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0; font-family: var(--sans);
}
.row-desc {
  font-size: 0.78rem; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 0.3rem; max-width: 440px;
  font-family: var(--sans);
}
.row-tags { display: flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; }
.row-tag {
  font-size: 0.62rem; padding: 0.12rem 0.45rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-3); border-radius: 4px;
  font-family: var(--mono); white-space: nowrap;
}

/* Edition badges */
.edition-badge {
  font-family: var(--mono); font-size: 0.58rem;
  letter-spacing: 0.06em; padding: 0.15rem 0.48rem;
  border-radius: 4px; font-weight: 600; flex-shrink: 0;
}
.badge-java    { background: rgba(74,222,128,0.12);  color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
.badge-bedrock { background: rgba(245,158,11,0.10);  color: var(--gold);  border: 1px solid rgba(245,158,11,0.3); }
.badge-both    { background: rgba(6,182,212,0.10);   color: var(--cyan);  border: 1px solid rgba(6,182,212,0.3); }

/* Status dot */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  transition: background var(--dur-slow) var(--ease);
}
.status-dot.online  { background: var(--green); box-shadow: 0 0 6px rgba(74,222,128,0.5); }
.status-dot.offline { background: var(--danger); }

/* Players */
.row-players {
  text-align: center; font-family: var(--mono); font-size: 0.78rem; padding: 0 0.5rem;
}
.players-online  { color: var(--green); font-weight: 600; }
.players-offline { color: var(--text-3); }
.players-loading {
  display: inline-block; width: 48px; height: 10px;
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-3) 50%, var(--bg-elevated) 75%);
  border-radius: 4px;
  animation: shimmer 1.4s infinite linear;
  background-size: 200% 100%;
}

/* IP / Copy */
.row-ip { display: flex; align-items: center; justify-content: flex-end; }
.copy-btn {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  background: rgba(74,222,128,0.07);
  border: 1px solid var(--border-2);
  color: var(--green); border-radius: var(--radius);
  cursor: pointer; font-family: var(--mono); font-size: 0.72rem;
  transition: var(--transition); white-space: nowrap;
}
.copy-btn:hover {
  background: rgba(74,222,128,0.14);
  border-color: var(--green);
}
.copy-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.copy-btn .addr {
  max-width: 120px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; color: var(--text-2);
}

/* Mobile bottom bar — hidden on desktop */
.row-mobile-bottom { display: none; }

/* State messages */
.state-msg {
  padding: 3rem 1.5rem; text-align: center;
  color: var(--text-3); font-size: 0.9rem; display: flex;
  flex-direction: column; align-items: center; gap: 0.75rem;
}
.state-icon { font-size: 2.5rem; }

/* ── Pagination ── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; margin-top: 1rem;
}
.page-btn {
  padding: 0.55rem 1.25rem; background: var(--bg-card);
  border: 1px solid var(--border); color: var(--text-2);
  font-family: var(--sans); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; border-radius: var(--radius);
  transition: var(--transition);
}
.page-btn:hover:not(:disabled) { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-info {
  font-size: 0.8rem; color: var(--text-3);
  font-family: var(--mono); white-space: nowrap;
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--bg-elevated); border: 1px solid var(--border-2);
  color: var(--green); font-family: var(--mono); font-size: 0.8rem;
  padding: 0.6rem 1.2rem; border-radius: var(--radius-lg);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
  z-index: 999; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Mobile filter FAB ── */
.mobile-filter-btn {
  display: none; position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--green); color: var(--bg);
  border: none; padding: 0.65rem 1.2rem;
  font-family: var(--pixel); font-size: 0.48rem; letter-spacing: 0.06em;
  border-radius: 999px; cursor: pointer; z-index: 80;
  box-shadow: 0 4px 16px rgba(74,222,128,0.35);
  transition: var(--transition);
}
.mobile-filter-btn:hover { background: var(--green-dim); }


/* ============================================================
   FOOTER — identical to homepage style.css
   ============================================================ */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.footer-inner-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 3rem;
  padding: 3.5rem 0 3rem;
}
.footer-brand { display: flex; flex-direction: column; gap: 1rem; }
.footer-logo {
  font-family: var(--pixel); font-size: 0.7rem;
  color: var(--green); letter-spacing: 0.1em;
  text-shadow: 0 0 12px rgba(74,222,128,0.4);
}
.footer-brand p {
  font-size: 0.85rem; color: var(--text-3);
  line-height: 1.7; max-width: 280px;
}
.footer-col h4 {
  font-family: var(--pixel); font-size: 0.5rem;
  color: var(--text-2); letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 1rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.footer-col a {
  font-size: 0.85rem; color: var(--text-3);
  text-decoration: none; transition: color var(--dur-base) var(--ease);
}
.footer-col a:hover { color: var(--green); }

.footer-bottom-bar {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  background: rgba(6,11,6,0.6);
}
.footer-bottom-inner {
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}
.footer-bottom-inner small { font-size: 0.78rem; color: var(--text-3); }


/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── Tablet ≤ 900px ── */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 150; transform: translateX(-100%);
    transition: transform var(--dur-base) var(--ease);
    height: 100vh; box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 1.25rem 1rem 5rem; }
  
  /* Hide FAB, Show Sort-bar Filter Button */
  .mobile-filter-btn { display: none; } 
  .filter-sort-btn { display: inline-flex; }
  
  /* Show close button inside sidebar */
  .close-mobile-btn { display: block; width: 100%; }

  .table-header { display: none; }

  .server-row {
    display: flex; flex-direction: column;
    padding: 0; gap: 0; align-items: stretch; min-height: unset;
    border-radius: var(--radius-lg);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }
  .server-row:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.35); }

  /* Hide desktop-only cells */
  .row-rank    { display: none; }
  .row-players { display: none; }
  .row-ip      { display: none; }

  /* Info section */
  .row-info {
    flex-direction: row; align-items: flex-start; gap: 0.75rem;
    padding: 0.85rem 0.9rem 0.75rem; width: 100%; min-width: 0;
  }
  .row-icon { width: 46px; height: 46px; font-size: 1.2rem; border-radius: 8px; flex-shrink: 0; margin-top: 2px; }
  .row-text { flex: 1; min-width: 0; }
  .row-name-line { display: flex; align-items: center; flex-wrap: nowrap; gap: 0.5rem; margin-bottom: 0.3rem; overflow: hidden; }
  .row-name { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
  .row-desc { font-size: 0.75rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; margin-bottom: 0.4rem; }
  .row-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
  .row-tag  { font-size: 0.6rem; padding: 0.12rem 0.42rem; }

  /* Mobile bottom action bar */
  .row-mobile-bottom {
    display: flex; align-items: center;
    justify-content: space-between; gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.18); width: 100%;
  }
  .row-mobile-bottom > div {
    font-size: 0.72rem; font-family: var(--mono);
    display: flex; align-items: center; gap: 0.35rem;
  }
  .row-mobile-bottom .copy-btn {
    padding: 0.38rem 0.7rem; font-size: 0.68rem;
    max-width: 160px; border-radius: 6px;
    background: rgba(74,222,128,0.08); border: 1px solid var(--green);
    color: var(--green);
  }
  .row-mobile-bottom .copy-btn .addr { display: inline; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Footer */
  .footer-inner-grid   { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .footer-brand        { align-items: center; }
  .footer-brand p      { max-width: 100%; margin: 0 auto; }
  .footer-col ul       { align-items: center; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}

/* ── Mobile nav ≤ 768px ── */
@media (max-width: 768px) {
  .mobile-menu-toggle { display: flex; }
  .main-nav {
    position: fixed; top: 68px; left: 0; right: 0;
    background: rgba(6, 11, 6, 0.98); backdrop-filter: blur(20px);
    padding: 1.5rem; visibility: hidden; opacity: 0; pointer-events: none;
    transition: opacity var(--dur-base) var(--ease), visibility var(--dur-base) var(--ease);
    border-bottom: 1px solid var(--border); z-index: 199;
  }
  .main-nav.open { visibility: visible; opacity: 1; pointer-events: auto; }
  .main-nav ul { flex-direction: column; gap: 1.2rem; align-items: stretch; }
  .main-nav a  { display: block; text-align: center; padding: 0.5rem 0; }
  .nav-cta     { text-align: center; }
  .edition-explain { display: none; }
}

/* ── Small mobile ≤ 640px ── */
@media (max-width: 640px) {
  .server-list { gap: 0.5rem; }
  .server-row  { border-radius: 8px; }
  .row-info    { padding: 0.75rem 0.8rem 0.6rem; gap: 0.6rem; }
  .row-icon    { width: 40px; height: 40px; font-size: 1.05rem; border-radius: 6px; }
  .row-name    { font-size: 0.82rem; }
  .row-desc    { font-size: 0.7rem; }
  .row-tag     { font-size: 0.56rem; padding: 0.1rem 0.38rem; }
  .row-mobile-bottom { padding: 0.5rem 0.8rem; }
  .pagination  { gap: 0.6rem; margin-top: 1.25rem; }
  .page-btn    { padding: 0.4rem 0.8rem; font-size: 0.78rem; }
  .page-info   { font-size: 0.72rem; }
  .toast       { white-space: normal; max-width: 90%; text-align: center; bottom: 1rem; }
}

/* ── Extra small ≤ 480px ── */
@media (max-width: 480px) {
  .container        { padding: 0 0.875rem; }
  .main             { padding: 0.875rem 0.875rem 5rem; }
  .sidebar          { padding: 1rem; }
  .sidebar-title    { font-size: 0.4rem; }
  .filter-section-label { font-size: 0.42rem; }
  .edition-btn, .filter-label { font-size: 0.78rem; padding: 0.4rem 0.6rem; }
  .row-info         { padding: 0.65rem 0.75rem 0.55rem; gap: 0.5rem; }
  .row-icon         { width: 36px; height: 36px; font-size: 0.95rem; border-radius: 5px; }
  .row-name         { font-size: 0.78rem; }
  .row-desc         { font-size: 0.66rem; }
  .page-title       { font-size: 0.55rem; }
  .page-subtitle    { font-size: 0.82rem; }
  .footer-col h4    { font-size: 0.4rem; }
  .footer-col a     { font-size: 0.78rem; }
  .footer-bottom-inner small { font-size: 0.68rem; }
}

/* ── Touch devices ── */
@media (hover: none) and (pointer: coarse) {
  .copy-btn, .edition-tab, .edition-btn { min-height: 40px; }
  .filter-label { min-height: 38px; }
  .server-row:hover { transform: none; box-shadow: none; }
  .server-row:hover .row-icon { transform: none; }
  .server-row:active { opacity: 0.86; transform: scale(0.993); transition: transform 0.1s, opacity 0.1s; }
}

/* ── Wide desktop ≥ 1400px ── */
@media (min-width: 1400px) {
  .container { max-width: 1320px; }
  .sidebar   { width: 280px; min-width: 280px; }
}

/* Prevent body scroll when mobile menu is open */
body.menu-open { overflow: hidden; }

/* ═══════════════════════════════════════════════════
   MOBILE OVERFLOW — FINAL GUARD
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  img, video, iframe, canvas {
    max-width: 100% !important;
  }
}
