/* =============================================
   Best-Minecraft-Servers — Light Theme (v2)
   Warm stone palette · grass-green accents
   ============================================= */

/* Google Fonts: loaded via <link> in layout templates (non-blocking). */

@font-face {
  font-family: 'Minecraft Ten';
  src: url('../assets/MinecraftTen-VGORe.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Minecraft Ten';
  src: url('../assets/MinecraftTen-VGORe.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-page: #f3f1ec;
  --bg-surface: #ffffff;
  --bg-elevated: #faf9f6;
  --bg-header: #ffffff;
  --header-bg: #1a1814;
  --header-bg-elevated: #262219;
  --header-text: #f4f1ea;
  --header-text-muted: #9c9488;
  --header-border: rgba(255, 255, 255, 0.1);
  --bg-table-head: #ebe8e1;
  --border: #b7ae9c;
  --border-light: #d5cebe;
  --border-strong: #948a76;
  --text-primary: #2c2824;
  --text-secondary: #5c574f;
  --text-muted: #8a847a;
  --accent: #4a9c4e;
  --accent-dark: #3d8340;
  --accent-soft: #e8f3e9;
  --accent-glow: rgba(74, 156, 78, 0.15);
  --link: #3b7dd8;
  --link-hover: #2a6bc4;
  --gold: #c9971a;
  --silver: #8a9199;
  --bronze: #b87333;
  --success: #3d9a56;
  --success-soft: #e6f4ea;
  --danger: #c94444;
  --danger-soft: #fceaea;
  --shadow-sm: 0 1px 2px rgba(44, 40, 36, 0.05);
  --shadow-md: 0 4px 20px rgba(44, 40, 36, 0.07);
  --shadow-lg: 0 12px 40px rgba(44, 40, 36, 0.12);
  --radius: 6px;
  --radius-lg: 10px;
  --header-height: 72px;
  --header-control-height: 44px;
  --max-width: 1280px;
  --banner-w: 468px;
  --banner-h: 60px;
  --row-pad: 20px;
  --font: 'Inter', system-ui, sans-serif;
  --font-minecraft: 'Minecraft Ten', monospace;
  --font-mono: 'JetBrains Mono', monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --hover-shadow: 0 10px 28px rgba(44, 40, 36, 0.12);
  --hover-glow: 0 0 0 3px rgba(74, 156, 78, 0.22);
  --grass-mid: #7ecf5a;
  --grass-bright: #a8e86a;
  --grass-stripe: repeating-linear-gradient(
    90deg,
    var(--accent) 0px, var(--accent) 16px,
    var(--grass-mid) 16px, var(--grass-mid) 32px
  );
  --grass-stripe-height: 4px;
  --rail-stripe: var(--grass-stripe);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  overflow-x: hidden;
  overflow-y: scroll;
  /* Match the footer so short pages / overscroll never flash the cream page bg */
  background-color: var(--header-bg);
}

body {
  font-family: var(--font);
  background-color: var(--bg-page);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(44, 40, 36, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--link-hover); }

img { max-width: 100%; display: block; }

/* ---- Header ---- */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  overflow: visible;
}

.site-header.is-mobile-open {
  z-index: 500;
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
  max-height: 100vh;
  overflow: hidden;
}

.site-header.is-mobile-open .header-inner {
  flex-shrink: 0;
}

body.mobile-menu-open {
  overflow: hidden;
  touch-action: none;
}

body.mobile-menu-open .mobile-menu.open {
  touch-action: pan-y;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr minmax(220px, 420px) 1fr;
  align-items: center;
  gap: 22px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  grid-column: 1;
  justify-self: start;
  align-self: center;
  color: var(--header-text);
  line-height: 0;
  transform: none;
}

.logo:hover {
  color: #8fd892;
}

.logo img {
  width: 220px;
  height: auto;
  max-height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  transition: transform 0.28s var(--ease-spring), filter 0.28s;
}

.logo:hover img {
  transform: scale(1.08) rotate(-3deg);
  filter: drop-shadow(0 4px 10px rgba(143, 216, 146, 0.35));
}

.logo-text {
  display: block;
  position: relative;
  white-space: nowrap;
}

.cell-rank-icon { display: none; }

.header-search {
  grid-column: 2;
  justify-self: center;
  align-self: center;
  width: 100%;
  max-width: 420px;
  position: relative;
}

.header-search input {
  width: 100%;
  height: var(--header-control-height);
  padding: 0 16px 0 42px;
  border: 1px solid var(--header-border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.98rem;
  line-height: 1;
  background: var(--header-bg-elevated);
  color: var(--header-text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.header-search input:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: #2e2a24;
}

.header-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 156, 78, 0.25);
  background: #2e2a24;
}

.header-search input::placeholder { color: var(--header-text-muted); }

.header-search input[type="search"]::-webkit-search-cancel-button,
.mobile-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 14px;
  width: 14px;
  margin-right: 2px;
  cursor: pointer;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e53935' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
}

.header-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--header-text-muted);
  pointer-events: none;
  width: 17px;
  height: 17px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  grid-column: 3;
  justify-self: end;
  align-self: center;
}

.nav-add-server-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--header-control-height);
  padding: 0 16px;
  background: var(--accent-dark);
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--accent-glow);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.nav-add-server-btn:hover {
  background: #368039;
  border-color: #368039;
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.nav-add-server-btn:active {
  background: #368039;
  border-color: #368039;
  color: #fff;
}
@media (max-width: 680px) {
  .nav-add-server-btn span { display: none; }
  .nav-add-server-btn { padding: 0 10px; }
}

.nav-dropdown { position: relative; }

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--header-control-height);
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--header-border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1;
  color: var(--header-text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

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

.nav-dropdown-btn:hover,
.nav-dropdown.open .nav-dropdown-btn {
  background: rgba(74, 156, 78, 0.16);
  border-color: rgba(143, 216, 146, 0.45);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.nav-dropdown.open .nav-dropdown-btn svg { transform: rotate(180deg); }
.nav-dropdown-btn svg { transition: transform 0.2s; }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(720px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 50;
}

.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-account-btn {
  gap: 6px;
  padding: 6px 10px 6px 6px;
  max-width: 160px;
}

.nav-account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(145deg, #5bb35f 0%, #3d8340 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: box-shadow 0.2s;
}

.nav-dropdown.open .nav-account-avatar,
.nav-account-btn:hover .nav-account-avatar {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 0 2px rgba(91, 179, 95, 0.5);
}

.nav-account-avatar--lg {
  width: 44px;
  height: 44px;
  font-size: 1rem;
}

.nav-dropdown-menu--account {
  width: min(280px, calc(100vw - 32px));
  padding: 0;
  gap: 0;
  overflow: visible;
  border-radius: 12px;
}

.nav-dropdown-menu--account::before {
  right: 14px;
  background: var(--bg-elevated);
  z-index: 1;
}

.nav-dropdown-menu--account > * {
  position: relative;
  z-index: 2;
}

.nav-account-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
  border-radius: 12px 12px 0 0;
}

.nav-account-head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nav-account-head-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-account-head-email {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-account-credits {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 10px 0;
  padding: 8px 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(74, 156, 78, 0.18);
  border-radius: 8px;
}

.nav-account-credits-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-account-credits-row svg {
  color: var(--gold);
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}

.nav-account-credits-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-dark);
  line-height: 1;
}

.nav-account-credits-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1;
}

.nav-account-credits-buy {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(74, 156, 78, 0.13);
  transition: background 0.15s, color 0.15s;
}

.nav-account-credits-buy:hover {
  background: var(--accent-dark);
  color: #fff;
}

.nav-account-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
}

.nav-dropdown-menu--account .nav-account-list a[role="menuitem"],
.nav-dropdown-menu--account .nav-account-logout button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 550;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transform: none;
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-menu--account .nav-account-list a[role="menuitem"] svg,
.nav-dropdown-menu--account .nav-account-logout button svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.15s;
}

.nav-dropdown-menu--account .nav-account-list a[role="menuitem"]:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
  transform: none;
  padding-left: 10px;
}

.nav-dropdown-menu--account .nav-account-list a[role="menuitem"]:hover svg {
  color: var(--accent-dark);
}

.nav-dropdown-menu--account .nav-account-list a.nav-account-admin-link {
  margin-top: 5px;
  padding-top: 10px;
  position: relative;
}

.nav-dropdown-menu--account .nav-account-list a.nav-account-admin-link::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 6px;
  right: 6px;
  height: 1px;
  background: var(--border-light);
}

.nav-account-footer {
  padding: 6px 10px 10px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface);
  border-radius: 0 0 12px 12px;
}

.nav-account-logout {
  margin: 0;
  padding: 0;
  border: 0;
}

.nav-dropdown-menu--account .nav-account-logout button:hover {
  background: var(--danger-soft);
  color: var(--danger);
  transform: none;
  padding-left: 10px;
}

.nav-dropdown-menu--account .nav-account-logout button:hover svg {
  color: var(--danger);
}

.mega-menu-head {
  margin: 0;
  padding: 14px 18px 12px;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
}

.mega-menu-body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 10px 6px 12px;
}

.mega-menu-body--games {
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 2px 6px;
  padding: 8px 10px 12px;
}

.mega-col {
  padding: 0 10px;
  border-right: 1px solid var(--border-light);
}

.mega-col:last-child { border-right: none; }

.mega-col-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 2px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}

.nav-dropdown-menu a[role="menuitem"] {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.18s var(--ease-out), color 0.18s, transform 0.18s var(--ease-out), padding-left 0.18s;
}

.nav-dropdown-menu a[role="menuitem"]:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
  transform: translateX(4px);
  padding-left: 14px;
}

.mega-menu-all {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 18px;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-top: 1px solid var(--border-light);
  border-radius: 0;
  transition: background 0.2s, transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.mega-menu-all:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}

@media (max-width: 1100px) {
  .mega-menu-body {
    grid-template-columns: repeat(2, 1fr);
  }

  .mega-menu-body--games {
    grid-template-columns: repeat(3, 1fr);
  }

  .mega-col:nth-child(2n) { border-right: none; }

  .mega-col:nth-child(n+3) {
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
    padding-top: 8px;
  }
}

.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--header-control-height);
  padding: 0 22px;
  background: var(--accent-dark);
  color: #fff !important;
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-login:hover {
  background: #368039;
  border-color: #368039;
  color: #fff !important;
  transform: none;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.header-nav .btn-logout {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--header-border);
  color: var(--header-text) !important;
  box-shadow: none;
}

.header-nav .btn-logout:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff !important;
  box-shadow: none;
}

/* ---- Mobile menu ---- */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  grid-column: 3;
  justify-self: end;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--header-border);
  border-radius: var(--radius);
  color: var(--header-text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.mobile-menu-btn:hover {
  background: rgba(74, 156, 78, 0.18);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 10px;
  background: var(--header-bg);
  border-top: 1px solid var(--header-border);
  border-bottom: 2px solid var(--accent);
  padding: 16px 20px 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 2;
}

.mobile-menu.open {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100dvh - var(--header-height));
  max-height: calc(100vh - var(--header-height));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
}

.mobile-search { position: relative; margin-bottom: 6px; }

.mobile-search input {
  width: 100%;
  padding: 11px 14px 11px 36px;
  border: 1px solid var(--header-border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  background: var(--header-bg-elevated);
  color: var(--header-text);
}

.mobile-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 156, 78, 0.25);
}

.mobile-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--header-text-muted);
  pointer-events: none;
}

.mobile-menu-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--header-text-muted);
  margin: 8px 0 4px;
}

.mobile-menu-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
  margin-bottom: 10px;
}

.mobile-menu-links a {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 8px;
  border-radius: 5px;
  color: var(--header-text);
  font-size: 0.87rem;
  font-weight: 500;
  transition: background 0.18s, color 0.18s, transform 0.18s var(--ease-out);
}

.mobile-menu-links a:hover {
  background: rgba(74, 156, 78, 0.16);
  color: #fff;
  transform: translateX(3px);
}

.mobile-menu .btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  min-height: 44px;
  padding: 12px 16px;
  text-align: center;
  line-height: 1.2;
  box-sizing: border-box;
}

.mobile-menu-links + .mobile-menu-title,
.mobile-menu-links + .btn-login {
  margin-top: 6px;
}

.mobile-menu-logout {
  margin: 0;
  width: 100%;
}

.mobile-menu-logout .btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  min-height: 44px;
  padding: 12px 16px;
  line-height: 1.2;
  box-sizing: border-box;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  max-width: 100%;
  margin-left: calc(50% - 50vw);
  margin-top: calc(-1 * var(--header-height));
  height: calc(200px + var(--header-height));
  overflow: hidden;
  background: #000;
}

/*
 * Any hero with breadcrumbs: same top offset under the sticky header so
 * Home / … always starts at one consistent height (game, server, settings…).
 */
.hero:has(.breadcrumb) {
  height: auto;
  min-height: calc(168px + var(--header-height));
  padding-bottom: 22px;
  align-items: flex-start;
}

/* Server heroes grow with title + banner — don't force the tall listing min-height. */
.hero--server:has(.breadcrumb) {
  min-height: 0;
}

/* Compact dashboard / auth / docs heroes: breadcrumb + title, balanced padding.
   Must beat .hero:has(.breadcrumb) min-height specificity. */
.hero.hero--page:has(.breadcrumb),
.hero--page {
  height: auto;
  min-height: calc(120px + var(--header-height));
  padding-bottom: 28px;
  align-items: flex-start;
}

.hero--page .hero-inner,
.hero.hero--page:has(.breadcrumb) .hero-inner {
  padding-top: calc(var(--header-height) + 28px);
  padding-bottom: 10px;
  gap: 14px;
}

.hero--page h1 {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.2;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #000;
}

.hero-media::after {
  content: none;
}

.hero-media img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 72%;
  display: block;
  opacity: 0.4;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgb(0 0 0 / 42%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--header-height) + 8px) 20px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero:has(.breadcrumb) .hero-inner {
  padding-top: calc(var(--header-height) + 14px);
  padding-bottom: 4px;
  gap: 10px;
}

.hero h1 {
  font-family: var(--font-minecraft);
  font-size: 2.1rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: 10px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.hero:has(.breadcrumb) h1 {
  margin-bottom: 0;
}

.hero .intro {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.98rem;
  max-width: 560px;
  line-height: 1.6;
  margin: 0 auto;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.hero .breadcrumb {
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 0;
}

.hero .breadcrumb a {
  color: rgba(255, 255, 255, 0.9);
}

.hero .breadcrumb a:hover {
  color: #fff;
}

/* Homepage hero — McServ-style split: logo + content / CTA / live stats */
.hero--home {
  height: auto;
  min-height: calc(340px + var(--header-height));
  align-items: center;
  padding: 0 0 36px;
}

.hero-inner--home {
  max-width: 1280px;
  text-align: left;
  align-items: stretch;
  padding-top: calc(var(--header-height) + 48px);
  padding-bottom: 12px;
}

.head-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 50px;
}

.head-logo {
  position: relative;
  flex: 0 0 auto;
  width: min(420px, 38vw);
  max-width: 100%;
  display: block;
  line-height: 0;
  text-decoration: none;
}

.head-logo img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}

.badge-new-version {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  background: #c94444;
  color: #fff;
  padding: 4px 10px;
  border: 2px solid #000;
  white-space: nowrap;
  z-index: 2;
  font-size: 1.05rem;
  text-transform: uppercase;
  box-shadow: 2px 2px #500;
  font-family: var(--font-minecraft);
  font-weight: normal;
  letter-spacing: 0.02em;
  line-height: 1.1;
  pointer-events: none;
}

.head-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  flex: 1 1 360px;
}

.head-content h1 {
  font-family: var(--font);
  font-size: clamp(1.85rem, 3.2vw, 3rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.head-content .subtitle {
  font-size: 1.15rem;
  color: rgba(226, 232, 240, 0.92);
  max-width: 550px;
  line-height: 1.6;
  margin: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.quick-actions {
  display: flex;
  align-items: center;
  gap: 25px;
  margin-top: 6px;
  flex-direction: row;
  flex-wrap: wrap;
}

.btn.primary {
  padding: 10px 28px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.46);
  color: #fff !important;
  box-shadow: inset 0 0 0 2px rgba(74, 156, 78, 0.55), 0 0 0 4px rgba(255, 255, 255, 0.88);
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.btn.primary span {
  display: inline-block;
  font-size: 32px;
  line-height: 24px;
  font-weight: 900;
  margin: 0 10px 0 0;
  animation: pulse-plus 2s infinite ease-in-out;
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px var(--accent);
  color: #fff !important;
}

.btn.primary:hover span {
  color: #b7f0b5;
}

@keyframes pulse-plus {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3) rotate(90deg); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.server-cw {
  display: flex;
  gap: 25px;
}

.server-count {
  display: flex;
  flex-direction: column;
  border-left: 2px solid rgba(255, 255, 255, 0.14);
  padding-left: 20px;
}

.count-number {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.count-label {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.95);
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: 0.05em;
}

@media (max-width: 1240px) {
  .head-logo {
    width: min(340px, 34vw);
  }

  .head-content {
    gap: 12px;
  }

  .head-content .subtitle {
    font-size: 1rem;
  }
}

@media (max-width: 850px) {
  .hero--home {
    min-height: 0;
    padding-bottom: 28px;
  }

  .head-container {
    flex-direction: column;
    text-align: center;
    gap: 0;
    padding-bottom: 12px;
  }

  .head-logo {
    width: min(280px, 70vw);
    margin: -12px auto -8px;
  }

  .head-content {
    align-items: center;
    z-index: 4;
  }

  .head-content .subtitle {
    font-size: 1.05rem;
  }

  .quick-actions {
    flex-direction: column;
    gap: 48px;
    justify-content: center;
    margin-top: 16px;
  }

  .quick-actions > .btn.primary {
    margin-bottom: 4px;
  }

  .server-cw {
    padding-top: 8px;
  }

  .server-count {
    border-left: none;
    border-top: 2px solid rgba(255, 255, 255, 0.14);
    padding: 20px 0 0;
  }
}

@media (max-width: 650px) {
  .hero-inner--home {
    padding-top: calc(var(--header-height) + 36px);
    padding-bottom: 20px;
  }

  .head-logo {
    display: none;
  }

  .head-content {
    gap: 16px;
  }

  .head-content h1 {
    font-size: 1.8rem;
    line-height: 1.25;
    margin-top: 12px;
  }

  .head-content .subtitle {
    font-size: 1rem;
  }

  .quick-actions {
    gap: 56px;
    margin-top: 28px;
    padding: 8px 0 4px;
  }

  .server-cw {
    width: 100%;
    justify-content: center;
    gap: 36px;
  }

  .btn.primary {
    padding: 12px 24px;
  }
}

/* Server page hero — creeper pattern on black */
.hero--server {
  height: auto;
  min-height: 0;
  padding-bottom: 24px;
  align-items: flex-start;
}

.hero-media--creeper {
  background-color: #0c0c0c;
  background-image: url('../assets/hero-creeper-decor.svg');
  background-repeat: repeat;
  background-position: 0 0;
  background-size: 640px 360px;
}

.hero-overlay--server {
  background:
    radial-gradient(ellipse 70% 75% at 50% 40%, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.55) 100%),
    rgb(0 0 0 / 18%);
}

.server-hero-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 20px 28px;
  width: 100%;
  min-height: var(--banner-h);
}

.server-hero-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: var(--banner-h);
  margin: 0;
  min-width: 0;
  max-width: 100%;
}

.server-hero-title .server-favicon {
  display: block;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  image-rendering: pixelated;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.server-hero-title h1 {
  font-family: var(--font-minecraft);
  font-size: 2rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  line-height: 1;
  margin: 0;
  padding: 0;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(-1px);
}

.server-hero-banner {
  width: min(var(--banner-w), 100%);
  max-width: 100%;
  height: var(--banner-h);
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  line-height: 0;
  flex-shrink: 1;
  align-self: center;
}

.server-hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hero--server + .main-content {
  padding-top: 20px;
}

/* ---- Main ---- */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 52px;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
}

.breadcrumb > :last-child {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s, transform 0.2s var(--ease-out);
}

.breadcrumb a:hover {
  color: var(--accent-dark);
  transform: translateX(2px);
}
.breadcrumb-sep { opacity: 0.4; }

.page-heading h1 {
  font-family: var(--font-minecraft);
  font-size: 1.45rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  line-height: 1.3;
  margin-bottom: 8px;
}

.page-heading .intro {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 680px;
  margin-bottom: 22px;
  line-height: 1.65;
}

/* ---- Tag filters (mcserv-style pills, no icons) ---- */
.filterm {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 10px;
  padding: 8px 0;
  background: var(--header-bg);
  position: sticky;
  top: var(--header-height);
  z-index: 90;
}

.hero + .filterm {
  padding-top: 8px;
}

.filterm + .main-content {
  padding-top: 12px;
}

.filters {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

.filter-left-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.filter-group-main {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: stretch;
  width: 100%;
}

.extra-animated-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  pointer-events: none;
  transition:
    max-height 0.35s ease,
    opacity 0.22s ease,
    padding-top 0.22s ease;
}

.extra-animated-wrapper.is-open {
  max-height: 520px;
  opacity: 1;
  padding-top: 2px;
  pointer-events: auto;
}

.filter,
.filterp {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  appearance: none;
  background: #131211;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: none;
  padding: 6px 10px;
  border: 2px solid #3c3c3c;
  border-radius: 6px;
  color: #9ca3af;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: 0.1s;
  white-space: nowrap;
}

.filter {
  flex: 1 1 auto;
  min-width: max-content;
}

.filter:visited {
  color: #9ca3af;
}

.filterp {
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  height: auto;
  min-height: 32px;
  padding: 5px;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.filter:hover:not(.active) {
  color: #fff;
  border-color: #fff;
  background: #3c3c3c;
  box-shadow: inset 0 0 0 2px #111827, 0 0 0 2px #fff;
  z-index: 2;
}

.filter.active {
  background: #3c3c3c;
  color: #fff;
  border-color: var(--grass-mid);
  box-shadow: inset 0 0 0 2px #111827, 0 0 0 2px var(--grass-mid);
}

.filter.active:visited {
  color: #fff;
}

.filter:active {
  transform: scale(0.95);
}

.filterp:hover {
  border-color: var(--grass-mid);
  color: var(--grass-mid);
  background: #1a1918;
}

.filterp.is-open {
  border-color: var(--grass-mid);
  color: var(--grass-mid);
  background: rgba(126, 207, 90, 0.12);
}

.filterp svg {
  display: block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filterp.is-open svg {
  transform: rotate(180deg);
}

.filter-premium {
  border-color: #853bc9;
  color: #fff;
  background: #1f0043;
}

.filter-premium:hover:not(.active) {
  background: rgba(250, 204, 21, 0.1);
  border-color: #fff;
  color: #fff;
}

.filter-new {
  color: #d5d5d5;
}

.filter-premium.active,
.filter-new.active {
  background: #312300;
  color: #fff;
  border-color: var(--grass-mid);
  box-shadow: inset 0 0 0 2px #111827, 0 0 0 2px var(--grass-mid);
}

.ftmr {
  display: inline-flex;
}

/* ---- Section heading ---- */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.section-heading h2 {
  font-family: var(--font-minecraft);
  font-size: 1.1rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--text-primary);
}

.section-heading .server-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.section-heading--actions {
  justify-content: flex-end;
  margin-bottom: 16px;
  gap: 10px;
}

/* ---- Server table ---- */
.server-table-wrap {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow-x: auto;
  margin-top: 14px;
  -webkit-overflow-scrolling: touch;
}

.server-table {
  width: 100%;
  min-width: 1080px;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
}

.server-table thead th {
  padding: 12px 16px;
  font-family: var(--font-minecraft);
  font-size: 0.95rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--header-text);
  text-align: left;
  white-space: nowrap;
  background: var(--header-bg);
  border-top: 1px solid var(--header-border);
  border-bottom: 1px solid var(--header-border);
}

.server-table thead th:first-child {
  border-left: 1px solid var(--header-border);
  border-radius: var(--radius-lg) 0 0 0;
}

.server-table thead th:last-child {
  border-right: 1px solid var(--header-border);
  border-radius: 0 var(--radius-lg) 0 0;
}

.server-table th.col-rank { width: 70px; text-align: center; }
.server-table th.col-server,
.server-table col.col-banner { width: calc(var(--banner-w) + 28px); }
.server-table th.col-name,
.server-table th.col-info { width: 99%; }
.server-table th.col-ip { width: 220px; }

.server-entry td {
  padding: 16px 18px;
  vertical-align: middle;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  transition:
    background 0.22s var(--ease-out),
    border-color 0.22s var(--ease-out);
}

.server-entry td:first-child {
  border-left: 1px solid var(--border);
  border-radius: 0;
}

.server-entry td:last-child {
  border-right: 1px solid var(--border);
  border-radius: 0;
}

.server-entry:last-child td:first-child {
  border-radius: 0 0 0 var(--radius-lg);
}

.server-entry:last-child td:last-child {
  border-radius: 0 0 var(--radius-lg) 0;
}

.server-entry:hover td {
  background: var(--bg-elevated);
  border-color: #c9c0ad;
  box-shadow: none;
}

.server-entry:hover td:first-child {
  box-shadow: inset 4px 0 0 var(--accent);
}

.cell-rank {
  text-align: center;
  width: 70px;
  vertical-align: middle;
}

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 42px;
  padding: 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-secondary);
  background: var(--bg-table-head);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(44, 40, 36, 0.08);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-out);
}

.server-entry:hover .rank-num {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(44, 40, 36, 0.14);
}

.server-entry:hover .rank-num.rank-1 {
  box-shadow: 0 6px 18px rgba(201, 151, 26, 0.28);
}

.server-entry:hover .rank-num.rank-2 {
  box-shadow: 0 6px 18px rgba(138, 145, 153, 0.22);
}

.server-entry:hover .rank-num.rank-3 {
  box-shadow: 0 6px 18px rgba(184, 115, 51, 0.24);
}

.server-entry.is-premium td {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.12), rgba(255, 248, 220, 0.35));
}

.server-entry.is-premium td:first-child {
  box-shadow: inset 3px 0 0 #c9a227;
}

.server-entry.is-premium .server-name-link span,
.server-entry.is-premium .info-section .server-name {
  font-weight: 800;
}

.rank-num.rank-1 {
  color: #9a7209;
  background: linear-gradient(180deg, #fff8df 0%, #fdf6e3 100%);
  border-color: #e8c96a;
  box-shadow: 0 2px 8px rgba(201, 151, 26, 0.18);
}

.rank-num.rank-2 {
  color: #5c6570;
  background: linear-gradient(180deg, #f8f9fa 0%, #eef0f2 100%);
  border-color: #c8cdd3;
  box-shadow: 0 2px 8px rgba(138, 145, 153, 0.15);
}

.rank-num.rank-3 {
  color: #8f5520;
  background: linear-gradient(180deg, #fdf0e4 0%, #faf0e8 100%);
  border-color: #ddb892;
  box-shadow: 0 2px 8px rgba(184, 115, 51, 0.15);
}

.cell-name {
  width: 260px;
  vertical-align: middle;
  padding-right: 16px !important;
}

.server-name-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-minecraft);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: 0.02em;
  max-width: 100%;
  min-width: 0;
  transition: color 0.2s, transform 0.22s var(--ease-out);
}

.server-name-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-name-link:hover {
  color: var(--accent-dark);
  transform: translateX(5px);
}

.server-name-link .server-favicon {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  flex-shrink: 0;
  border: none;
  object-fit: cover;
  box-shadow: none;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
}

.server-name-link:hover .server-favicon {
  transform: scale(1.12);
  box-shadow: 0 4px 14px rgba(74, 156, 78, 0.35);
}

.server-favicon {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  flex-shrink: 0;
  border: none;
  object-fit: cover;
  display: block;
}

svg.server-favicon,
svg.game-switcher-icon,
svg.search-card-icon {
  object-fit: contain;
  overflow: visible;
}

.cell-server {
  width: calc(var(--banner-w) + 28px);
  max-width: calc(var(--banner-w) + 28px);
  vertical-align: middle;
  padding-right: 8px !important;
}

.center-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: var(--banner-w);
  max-width: 100%;
}

.banner-container {
  display: block;
  line-height: 0;
  width: 100%;
  border: none;
}

.banner-container:hover .server-banner {
  transform: scale(1.05);
  filter: brightness(1.08);
}

.banner-container:hover .server-banner--placeholder {
  transform: scale(1.03);
  filter: brightness(1.12);
}

.tags-under-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
  max-width: var(--banner-w);
}

.row-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.row-tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.row-tag-text.uppercase {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.row-tag--flag {
  background: #fff;
  color: var(--text-primary);
}

.flag-img,
.row-tag-flag {
  display: inline-block;
  width: 18px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(44, 40, 36, 0.18);
  flex-shrink: 0;
  vertical-align: -1px;
}

.flag-img--inline {
  margin-right: 2px;
}

.cell-server,
.cell-ip {
  vertical-align: middle;
}

.server-block {
  width: var(--banner-w);
  height: var(--banner-h);
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: #141414;
  box-sizing: border-box;
  transition: border-color 0.22s, box-shadow 0.28s var(--ease-out);
}

.server-entry:hover .server-block {
  border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(44, 40, 36, 0.16);
}

.server-block .banner {
  line-height: 0;
  font-size: 0;
  height: 100%;
}

.banner-link {
  display: block;
  line-height: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

.server-banner {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  vertical-align: bottom;
  transition: transform 0.4s var(--ease-out), filter 0.3s;
}

/* FiveM uploaded banners fill the frame; placeholders keep contain. */
.server-banner.server-banner--cover:not(.server-banner--placeholder) {
  object-fit: cover;
}

.server-banner video,
video.server-banner {
  background: #141414;
  pointer-events: none;
}

.banner-link:hover .server-banner {
  transform: scale(1.05);
  filter: brightness(1.08);
}

.server-banner--placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background-color: #141414;
  object-fit: contain;
}

.banner-link:hover .server-banner--placeholder {
  transform: scale(1.03);
  filter: brightness(1.12);
}

.server-hero-banner .server-banner--placeholder {
  width: 100%;
  height: 100%;
}

.cell-ip {
  width: 220px;
  vertical-align: middle;
  padding-left: 8px !important;
}

.server-table td.cell-ip {
  height: auto;
}

.row-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 210px;
}

.row-actions .ipcopy {
  height: 38px;
  max-width: 100%;
}

.row-actions .ipcopy-action {
  flex-basis: 16px;
  height: 16px;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

.btn-vote {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 2px solid #50b310;
  border-radius: 4px;
  background: #191919;
  color: #cbdfe4;
  font-family: system-ui, -apple-system, sans-serif;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s ease;
}

.btn-vote:visited {
  color: #cbdfe4;
}

.btn-vote:hover,
.btn-vote:focus-visible {
  color: #cbdfe4;
  border-color: #84cc16;
  box-shadow: inset 0 0 0 2px #111827, 0 0 0 2px #84cc16;
}

.btn-vote:focus {
  outline: none;
}

.btn-vote:active {
  transform: scale(0.96);
}

.btn-vote .text-container {
  position: relative;
  overflow: hidden;
  height: 1.25em;
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.btn-vote .text-default,
.btn-vote .text-hover,
.btn-vote .text-success {
  display: block;
  position: absolute;
  white-space: nowrap;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25em;
  transition: opacity 0.3s, transform 0.3s;
}

.btn-vote .text-default {
  font-size: 15px;
}

.btn-vote .text-hover,
.btn-vote .text-success {
  opacity: 0;
  transform: translateY(10px);
}

.btn-vote .text-hover span {
  color: #84cc16;
}

@media (hover: hover) and (pointer: fine) {
  .btn-vote:hover .text-default {
    opacity: 0;
    transform: translateY(-10px);
  }

  .btn-vote:hover .text-hover {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-vote.voted {
  background: #002a0b;
  border-color: #84cc16;
  color: #8dd71d;
  box-shadow: inset 0 0 0 2px #111827, 0 0 0 2px #84cc16;
  pointer-events: none;
}

.btn-vote.voted .text-default,
.btn-vote.voted .text-hover {
  opacity: 0 !important;
}

.btn-vote.voted .text-success {
  opacity: 1;
  transform: translateY(0);
  color: #8dd71d;
}

/* IP box — same height as banner, clean card + hover/copied effect */
.ipcopy {
  --ip-w: 200px;
  width: 100%;
  max-width: var(--ip-w);
  height: var(--banner-h);
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #2c2824;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: center;
  font-family: var(--font);
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(44, 40, 36, 0.1);
  transition: border-color 0.2s, box-shadow 0.2s;
  align-self: center;
}

@media (min-width: 1180px) {
  .ipcopy {
    --ip-w: 210px;
  }
}

.ipcopy:focus {
  outline: none;
}

.ipcopy:focus-visible {
  box-shadow: 0 0 0 3px var(--hover-glow);
}

.server-entry:hover .ipcopy {
  border-color: var(--accent);
}

/* Website / detail link — same card + hover overlay, different label */
a.ipcopy.ipcopy--link {
  text-decoration: none;
  color: inherit;
}

a.ipcopy.ipcopy--link::after {
  content: 'Open';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  background: var(--accent-dark);
  color: #fff;
  opacity: 0;
  transition: opacity 0.16s ease;
  pointer-events: none;
  z-index: 2;
}

a.ipcopy.ipcopy--join::after {
  content: 'Join';
}

@media (hover: hover) and (pointer: fine) {
  a.ipcopy.ipcopy--link:hover::after {
    opacity: 1;
  }
}

a.ipcopy.ipcopy--link:hover {
  border-color: var(--accent);
}

.ipcopy-host {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 0 10px;
  background: #2c2824;
  color: #f5f2eb;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ipcopy-action {
  flex: 0 0 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 26px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

button.ipcopy::after {
  content: 'Click to copy';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  background: var(--accent-dark);
  color: #fff;
  opacity: 0;
  transition: opacity 0.16s ease;
  pointer-events: none;
  z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
  button.ipcopy:hover::after {
    opacity: 1;
  }
}

button.ipcopy.copied::after {
  content: '\2713 Copied!';
  opacity: 1;
  background: linear-gradient(135deg, #2ec972, #1fa85c);
  color: #fff;
  animation: ipReveal 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

button.ipcopy.copied {
  animation: ipBounce 0.5s ease;
}

@keyframes ipReveal {
  0% { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

@keyframes ipBounce {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.03); }
  70% { transform: scale(0.99); }
}

.server-table td.cell-info {
  vertical-align: middle;
  padding-left: 4px !important;
  padding-right: 12px !important;
}

.cell-info {
  width: auto;
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.server-header {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s, transform 0.22s var(--ease-out);
}

.server-header:hover {
  color: var(--accent-dark);
  transform: translateX(4px);
}

.server-header .server-icon,
.server-header .server-favicon {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.info-section .server-name {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-minecraft);
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.player-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.player-count .signal-icon {
  display: inline-flex;
  color: #84cc16;
}

.player-count--offline .signal-icon {
  color: var(--text-muted);
}

.player-count--unknown .signal-icon {
  color: var(--text-muted);
}

.player-count .count-text strong {
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.player-count--votes .count-text {
  font-size: 0.84rem;
  font-weight: 650;
}

.info-block {
  width: 100%;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.server-table .info-block {
  height: auto;
  min-height: var(--banner-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  margin-bottom: 0;
  background: transparent;
  border: none;
}

.server-table .info-row {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1px;
  line-height: 1.15;
}

.info-row + .info-row {
  margin-top: 6px;
}

.server-table .info-row + .info-row {
  margin-top: 0;
}

.info-row .info-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.server-table .info-row .info-label {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  line-height: 1.2;
}

.info-row .info-value {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.server-table .info-row .info-value {
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-row .info-value.players-offline {
  color: var(--text-muted);
  font-weight: 500;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
  width: fit-content;
}

.server-table .status-pill {
  gap: 5px;
  padding: 3px 8px;
  font-size: 0.68rem;
}

.server-table .status-pill::before {
  width: 6px;
  height: 6px;
}

.status-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pill.online {
  background: #b9edc8;
  color: var(--success);
}

.status-pill.online::before { background: var(--success); }

.status-pill.offline {
  background: #f5b8b8;
  color: var(--danger);
}

.status-pill.offline::before { background: var(--danger); }

.status-pill.unknown {
  background: #e8e4de;
  color: var(--text-muted, #6b6560);
}

.status-pill.unknown::before { background: var(--text-muted, #6b6560); }

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.pagination a:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(74, 156, 78, 0.22);
}

.pagination .active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pagination .disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ---- Shared panel (grass stripe + dark header) ---- */
.panel {
  width: 100%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.panel::before {
  content: '';
  display: block;
  height: var(--grass-stripe-height);
  background: var(--grass-stripe);
}

.panel-header {
  padding: 13px 28px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

.panel-header h1,
.panel-header h2 {
  margin: 0;
  font-family: var(--font-minecraft);
  font-size: 0.95rem;
  font-weight: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--header-text);
  line-height: 1.35;
}

.panel-body {
  padding: 28px 30px 32px;
}

/* ---- Page prose (bottom content) ---- */
.page-prose {
  margin-top: 36px;
}

.page-prose .panel-body h3 {
  margin: 0 0 12px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.35;
}

.page-prose .panel-body h3:not(:first-child) {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border-light);
}

.page-prose .panel-body p {
  margin: 0 0 14px;
  max-width: none;
  width: 100%;
  font-size: 0.94rem;
  line-height: 1.8;
  color: #36322d;
}

.page-prose .panel-body a {
  color: #1f5424;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.page-prose .panel-body a:hover {
  color: #173d1a;
}

.page-prose .panel-body p:last-child {
  margin-bottom: 0;
}

.page-prose .panel-body .page-prose-q {
  margin: 18px 0 8px;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.4;
}

.page-prose .panel-body h3 + .page-prose-q {
  margin-top: 8px;
}

.page-prose .panel-body .page-prose-q + p {
  margin-bottom: 4px;
}

/* ---- Server detail ---- */
.server-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 20px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.server-detail-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.server-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.server-detail-sidebar .btn-vote-large {
  width: 100%;
  max-width: 100%;
}

.server-detail-main {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out), border-color 0.28s;
}

.server-detail-main:hover {
  transform: translateY(-3px);
  box-shadow: var(--hover-shadow);
  border-color: var(--border-strong);
}

.info-panel {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out);
}

.info-panel:hover {
  transform: translateY(-3px);
  box-shadow: var(--hover-shadow);
}

.server-detail-banner-wrap {
  position: relative;
  height: var(--banner-h);
  background-color: #1a1a1a;
  padding: 0;
  line-height: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
}

.server-detail-banner-wrap::before,
.server-detail-banner-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  width: max(0px, calc((100% - var(--banner-w)) / 2 - 10px));
  background-image: url('../assets/banner-decor.svg');
  background-repeat: repeat-x;
  background-position: center;
  background-size: auto 100%;
  pointer-events: none;
}

.server-detail-banner-wrap::before {
  left: 0;
}

.server-detail-banner-wrap::after {
  right: 0;
  transform: scaleX(-1);
}

.server-detail-banner {
  position: relative;
  z-index: 1;
  width: var(--banner-w);
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
  vertical-align: top;
}

.server-detail-body { padding: 24px 26px 28px; }

.server-detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.server-detail-title h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.server-detail-title .server-favicon {
  width: 36px;
  height: 36px;
}

.server-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.server-description p { margin-bottom: 10px; }

.server-motd-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light, var(--border));
}

.server-motd-heading {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.server-motd.mc-motd {
  font-family: Consolas, "Courier New", ui-monospace, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #1a1a1a;
  color: #aaaaaa;
  word-break: break-word;
}

.server-motd.ts-welcome {
  font-size: 0.92rem;
  line-height: 1.65;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fbfaf6, #f3f0e8);
  color: var(--text-secondary);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.server-motd-block--teamspeak .server-motd-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-motd-block--teamspeak .server-motd-heading::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4a9c4e;
  box-shadow: 0 0 0 3px rgba(74, 156, 78, 0.18);
  flex-shrink: 0;
}

/* TeamSpeak channel viewer */
.ts-viewer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light, var(--border));
}

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

.ts-viewer-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ts-viewer-refresh {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}

.ts-viewer-refresh:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.ts-viewer-captcha {
  margin: 0 0 12px;
}

.ts-viewer-captcha-msg {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.ts-viewer-captcha-widget {
  min-height: 65px;
}

.ts-viewer-meta--notice {
  color: var(--accent-dark, #3d7a40);
}

.ts-viewer.is-loading .ts-viewer-refresh {
  opacity: 0.55;
  pointer-events: none;
}

.ts-viewer-body {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #1b1d22, #14161a);
  color: #d7dbe3;
  padding: 12px 10px 14px;
  max-height: 520px;
  overflow: auto;
}

.ts-viewer-status {
  padding: 18px 12px;
  text-align: center;
  color: #9aa3b2;
  font-size: 0.9rem;
}

.ts-viewer-status--error {
  color: #f0b4b4;
}

.ts-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ts-tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding: 2px 8px 2px calc(8px + (var(--ts-depth, 0) * 16px));
  font-size: 0.86rem;
  line-height: 1.35;
  border-radius: 4px;
}

.ts-tree-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.ts-tree-item--spacer {
  color: #8b93a3;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.ts-tree-item--server .ts-tree-name {
  font-weight: 700;
  color: #fff;
}

.ts-tree-item--channel .ts-tree-name {
  color: #e8ecf4;
}

.ts-tree-item--client .ts-tree-name {
  color: #b9c3d4;
}

.ts-tree-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 3px;
  background: #5c6575;
  position: relative;
}

.ts-ico--server_open {
  background: #4a9c4e;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.ts-ico--channel_open,
.ts-ico--channel_password {
  background: #3d7ea6;
}

.ts-ico--channel_full {
  background: #a65b3d;
}

.ts-ico--channel_password::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.55);
}

.ts-ico--client_player,
.ts-ico--client_cc_idle,
.ts-ico--client_away {
  background: #c9a227;
  border-radius: 50%;
}

.ts-ico--client_mic_muted,
.ts-ico--client_snd_muted,
.ts-ico--client_snd_disabled {
  background: #8e6bb8;
  border-radius: 50%;
}

.ts-ico--spacer {
  width: 0;
  height: 0;
  background: transparent;
}

.ts-viewer-meta {
  margin: 10px 8px 0;
  font-size: 0.72rem;
  color: #7d8696;
}

/* Java Edition chat colors (MOTD parity with NameMC / NameSkins). */
.mc-motd .mc-black { color: #000000 !important; }
.mc-motd .mc-dark-blue { color: #0000aa !important; }
.mc-motd .mc-dark-green { color: #00aa00 !important; }
.mc-motd .mc-dark-aqua { color: #00aaaa !important; }
.mc-motd .mc-dark-red { color: #aa0000 !important; }
.mc-motd .mc-dark-purple { color: #aa00aa !important; }
.mc-motd .mc-gold { color: #ffaa00 !important; }
.mc-motd .mc-gray { color: #aaaaaa !important; }
.mc-motd .mc-dark-gray { color: #555555 !important; }
.mc-motd .mc-blue { color: #5555ff !important; }
.mc-motd .mc-green { color: #55ff55 !important; }
.mc-motd .mc-aqua { color: #55ffff !important; }
.mc-motd .mc-red { color: #ff5555 !important; }
.mc-motd .mc-light-purple { color: #ff55ff !important; }
.mc-motd .mc-yellow { color: #ffff55 !important; }
.mc-motd .mc-white { color: #ffffff !important; }

.mc-motd .mc-bold { font-weight: 700; }
.mc-motd .mc-italic { font-style: italic; }
.mc-motd .mc-underlined { text-decoration: underline; }
.mc-motd .mc-strikethrough { text-decoration: line-through; }
.mc-motd .mc-obfuscated {
  filter: blur(0.35px);
  letter-spacing: 0.04em;
}

.btn-vote-large {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 16px 16px 16px 14px;
  border: none;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--grass-bright) 0%, var(--grass-mid) 48%, var(--accent) 100%);
  color: #132016;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: left;
  text-decoration: none;
  font-family: var(--font);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 8px 22px rgba(74, 156, 78, 0.32);
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out), filter 0.2s;
}

.btn-vote-large::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.22) 40%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.55s var(--ease-out);
  pointer-events: none;
}

.btn-vote-large:hover {
  color: #0f1a12;
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 12px 28px rgba(74, 156, 78, 0.42);
}

.btn-vote-large:hover::before {
  transform: translateX(120%);
}

.btn-vote-large:active {
  transform: translateY(0) scale(0.99);
}

.btn-vote-large:focus {
  outline: none;
}

.btn-vote-large:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 0 3px var(--hover-glow),
    0 8px 22px rgba(74, 156, 78, 0.32);
}

.btn-vote-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(19, 32, 22, 0.18);
  color: #132016;
}

.btn-vote-icon svg {
  width: 24px;
  height: 24px;
}

.btn-vote-copy {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.btn-vote-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
  line-height: 1.1;
}

.btn-vote-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-family: var(--font-minecraft);
  font-size: 1.08rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  line-height: 1.2;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.btn-vote-arrow {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(19, 32, 22, 0.2);
  color: #132016;
  transition: transform 0.22s var(--ease-out), background 0.2s, box-shadow 0.22s;
}

.btn-vote-arrow svg {
  width: 22px;
  height: 22px;
  display: block;
}

.btn-vote-large:hover .btn-vote-arrow {
  transform: translateX(4px);
  background: rgba(19, 32, 22, 0.3);
  box-shadow: 0 2px 8px rgba(19, 32, 22, 0.18);
}

.btn-vote-large::after {
  content: 'Click to vote';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  background: rgba(20, 48, 28, 0.94);
  color: #e8ffe9;
  opacity: 0;
  transition: opacity 0.16s ease;
  pointer-events: none;
  z-index: 2;
}

.btn-vote-large:hover::after {
  opacity: 0;
}

.btn-vote-large.voted::after {
  content: "\2713 Voted!";
  opacity: 1;
  background: linear-gradient(135deg, #1c4a28, #2a7a3f);
  color: #fff;
  animation: ipReveal 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

a.btn-vote-large.voted::after {
  content: "Going to Vote Page";
}

.btn-vote-large.voted {
  animation: ipBounce 0.5s ease;
  pointer-events: none;
}

/* Info panel — card rows instead of plain table */
.info-panel-header {
  padding: 12px 16px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  color: var(--header-text);
  font-family: var(--font-minecraft);
  font-weight: normal;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.info-list { list-style: none; }

.info-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.84rem;
  transition: background 0.2s, padding-left 0.2s var(--ease-out);
}

.info-list li:hover {
  background: var(--bg-elevated);
  padding-left: 20px;
}

.info-list li:last-child { border-bottom: none; }

/* Live fields + static fields share one visual list on server detail. */
.info-list[data-server-live-fields]:not(:last-child) li:last-child {
  border-bottom: 1px solid var(--border-light);
}

.info-list[data-server-live-fields].is-live-updated .info-value {
  animation: live-status-flash 0.9s ease;
}

@keyframes live-status-flash {
  0% { background: rgba(56, 189, 248, 0.22); }
  100% { background: transparent; }
}

.info-list .info-label {
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.info-list .info-value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.info-list .mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.cs-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.cs-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-elevated, rgba(255,255,255,.06));
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
}
.cs-chip--player {
  font-weight: 500;
}
.info-list li.cs-online-players {
  align-items: flex-start;
}

/* FiveM resources — separate panel below server-detail-main */
.fivem-resources {
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.fivem-resources-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
}

.fivem-resources-head h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.fivem-resources-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.fivem-resources-body {
  padding: 14px 16px 16px;
}

.fivem-resource-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fivem-resource-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fivem-resources-more {
  margin-top: 12px;
}

.fivem-resources-more summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
}

.fivem-resources-more summary:hover {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.fivem-resources-more summary::-webkit-details-marker {
  display: none;
}

.fivem-resources-more[open] summary {
  margin-bottom: 10px;
}

.fivem-resources-note {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.copyable-ip {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 4px;
  word-break: break-all;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease-out);
}

.copyable-ip:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
  transform: scale(1.03);
}

/* ---- Vote page ---- */
.vote-card {
  max-width: 480px;
  margin: 12px auto 0;
}

.vote-card .panel-body {
  padding: 26px 28px 28px;
}

.vote-card .vote-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0 0 22px;
  line-height: 1.55;
}

.vote-server-preview {
  padding: 0;
  background: transparent;
  border-radius: var(--radius);
  margin-bottom: 22px;
  line-height: 0;
}

.vote-server-preview img,
.vote-server-preview .server-banner {
  width: 100%;
  height: auto;
  aspect-ratio: var(--banner-w) / var(--banner-h);
  object-fit: contain;
  display: block;
  border-radius: 2px;
}

.vote-server-preview .server-banner.server-banner--cover:not(.server-banner--placeholder) {
  object-fit: cover;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.4;
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  box-sizing: border-box;
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  min-height: 44px;
  cursor: pointer;
  background-color: var(--bg-elevated);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%236b6560' d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
}

.form-group select::-ms-expand {
  display: none;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: var(--border-strong, var(--border));
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background-color: var(--bg-surface);
}

.form-group input[type="file"] {
  padding: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  min-height: 42px;
  padding: 0 20px;
  margin: 0;
  background: var(--accent-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: 0 2px 8px var(--accent-glow);
  text-decoration: none;
  appearance: none;
  -webkit-appearance: none;
}

/* Full-width submit buttons in stacked auth / settings forms */
.login-card .btn-primary,
.panel-body > form > .btn-primary,
.admin-panel > form:not(.admin-inline-form) > .btn-primary {
  width: 100%;
}

.btn-primary:hover,
a.btn-primary:hover,
a.btn-primary:visited,
a.btn-primary:active {
  background: #368039;
  color: #fff;
  text-decoration: none;
  transform: none;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.vote-back-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s, transform 0.2s var(--ease-out);
}

.vote-back-link:hover {
  color: var(--accent-dark);
  transform: translateX(-3px);
}

.vote-voters {
  max-width: 920px;
  margin: 28px auto 0;
}

.vote-voters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.vote-voters-panel .panel-body {
  padding: 20px 22px 22px;
}

.vote-voters-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.vote-voters-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vote-voters-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 6px;
  border-radius: 6px;
}

.vote-voters-list li:nth-child(odd) {
  background: var(--bg-elevated, rgba(0, 0, 0, 0.03));
}

.vote-voters-rank {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.vote-voters-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vote-voters-name--anon {
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
}

.vote-voters-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.vote-voters-empty {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .vote-voters-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Login ---- */
.login-card {
  max-width: 420px;
  margin: 32px auto;
}

.login-card .panel-body {
  padding: 26px 28px 28px;
}

.login-card .login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0 0 24px;
  line-height: 1.55;
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.btn-oauth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.btn-oauth:hover {
  border-color: var(--text-muted);
  background: var(--bg-elevated, #faf9f6);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-oauth-icon {
  display: inline-flex;
  line-height: 0;
}

.btn-oauth--discord {
  background: #5865F2;
  border-color: #5865F2;
  color: #fff;
}

.btn-oauth--discord:hover {
  background: #4752c4;
  border-color: #4752c4;
  color: #fff;
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.oauth-linked-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 0 18px;
}

.oauth-linked-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated, #faf9f6);
}

.oauth-linked-row .form-hint {
  display: block;
  margin-top: 2px;
}

.login-card .form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 14px;
  text-align: center;
  line-height: 1.55;
}

/* ---- Privacy ---- */
.legal-content .panel-body {
  padding: 28px 32px 32px;
}

.legal-content .panel-header h2 {
  margin: 0;
  font-family: var(--font-minecraft);
  font-size: 0.95rem;
  font-weight: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--header-text);
  line-height: 1.35;
}

.legal-content .panel-body > h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--text-primary);
}

.legal-content .panel-body > h2:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 10px;
}

.legal-content ul {
  padding-left: 18px;
  margin-bottom: 14px;
}

.legal-content ol {
  padding-left: 18px;
  margin-bottom: 14px;
}

.legal-content h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 22px 0 8px;
  color: var(--text-primary);
}

.legal-content code {
  font-size: 0.82em;
  color: var(--accent-dark);
  word-break: break-all;
}

.legal-content a {
  color: var(--accent-dark);
  font-weight: 600;
}

.legal-content a:hover {
  text-decoration: underline;
}

.legal-content .panel-header + .panel-body > h3:first-child {
  margin-top: 0;
}

.legal-content h2[id] {
  scroll-margin-top: 96px;
}

.contact-email {
  font-size: 1.15rem;
  font-weight: 700;
}

.contact-cta {
  margin-top: 22px;
}

.contact-cta .btn-sm {
  display: inline-flex;
}

/* ---- Vote success modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 40, 36, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 100%;
  overflow: hidden;
  transform: scale(0.95) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
  border: 1px solid var(--border);
}

.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-top {
  background: var(--accent-soft);
  padding: 28px 24px 22px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.modal-top h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.modal-top .modal-server {
  font-size: 0.875rem;
  color: var(--accent-dark);
  font-weight: 600;
}

.modal-body {
  padding: 20px 24px 24px;
  text-align: center;
}

.modal-banner {
  border-radius: 6px;
  overflow: hidden;
  background: #1a1a1a;
  line-height: 0;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  aspect-ratio: var(--banner-w) / var(--banner-h);
}

.modal-banner img,
.modal-banner .server-banner,
.modal-banner video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.modal-banner .server-banner.server-banner--cover:not(.server-banner--placeholder) {
  object-fit: cover;
}

.modal-body p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 6px;
}

.modal-body .modal-timer {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  padding: 0 18px;
  margin: 0;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s;
  text-decoration: none;
  appearance: none;
  -webkit-appearance: none;
}

.btn-modal-primary {
  background: var(--accent);
  color: #fff;
  transition: background 0.2s, transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.btn-modal-primary:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(74, 156, 78, 0.35);
}

.btn-modal-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease-out), border-color 0.2s;
}

.btn-modal-secondary:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--text-primary);
  color: #fff;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ---- Footer ---- */
.site-footer {
  position: relative;
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  background: var(--header-bg);
  /* Fill any leftover viewport below the footer (short pages / mobile dvh quirks) */
  box-shadow: 0 100vh 0 100vh var(--header-bg);
}

.footer-content {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 20px 26px;
}

.footer-scene {
  position: relative;
  width: 100%;
  height: 100px;
  overflow: hidden;
}

.footer-scene::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--grass-stripe-height);
  background: var(--grass-stripe);
  z-index: 2;
}

.footer-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  display: block;
  opacity: 0.4;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
}

.footer-scene-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26, 24, 20, 0) 40%, rgba(26, 24, 20, 0.55) 78%, var(--header-bg) 100%);
  pointer-events: none;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--header-border);
  margin-bottom: 14px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--header-text);
  line-height: 0;
  transition: transform 0.2s var(--ease-out);
}

.footer-brand:hover {
  color: var(--header-text);
  transform: translateY(-1px);
}

.footer-brand img {
  width: 160px;
  height: auto;
  max-height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--header-text-muted);
  font-weight: 500;
  transition: color 0.2s, transform 0.2s var(--ease-out);
}

.footer-links a:hover {
  color: var(--grass-bright);
  transform: translateY(-1px);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--header-text-muted);
  text-align: center;
}

.footer-entity {
  margin: 6px 0 0;
  font-size: 0.74rem;
  color: var(--header-text-muted);
  text-align: center;
  line-height: 1.45;
  opacity: 0.9;
}

.footer-entity a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-entity a:hover {
  color: var(--header-text);
}

/* ---- Responsive ---- */
@media (prefers-reduced-motion: reduce) {
  .logo:hover img,
  .server-entry:hover .server-block,
  .server-entry:hover .rank-num,
  .server-name-link:hover,
  .banner-link:hover .server-banner,
  .banner-container:hover .server-banner,
  .server-header:hover,
  .btn-vote:hover,
  .login-card:hover,
  .server-detail-main:hover,
  .info-panel:hover,
  .filter:hover,
  .pagination a:hover,
  .btn-login:hover,
  .btn-primary:hover,
  .btn-vote-large:hover,
  .nav-dropdown-btn:hover {
    transform: none;
  }

  .ipcopy.copied,
  .ipcopy.copied::after,
  .btn-vote-large.voted,
  .btn-vote-large.voted::after,
  .btn-vote.voted,
  .btn.primary span {
    animation: none;
  }

  .btn.primary:hover {
    transform: none;
  }
}

@media (max-width: 1320px) and (min-width: 681px) {
  .server-table {
    min-width: 1180px;
  }
}

@media (max-width: 900px) {
  .server-detail-grid { grid-template-columns: 1fr; }
  .server-detail-sidebar { order: -1; }
  .footer-scene { height: 120px; }

  .server-hero-main {
    flex-direction: column;
    flex-wrap: wrap;
    gap: 14px;
    min-height: 0;
  }

  .server-hero-title {
    height: auto;
    min-height: 48px;
  }

  .server-hero-banner {
    width: min(var(--banner-w), 100%);
    height: auto;
    aspect-ratio: var(--banner-w) / var(--banner-h);
    flex-shrink: 1;
  }

  .server-hero-banner img {
    object-fit: contain;
  }

  .server-detail-banner-wrap {
    height: auto;
    aspect-ratio: var(--banner-w) / var(--banner-h);
    max-width: 100%;
  }

  .server-detail-banner {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

@media (max-width: 860px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .header-search,
  .header-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
    grid-column: 2;
    justify-self: end;
  }

  .logo img {
    width: min(180px, 52vw);
    max-height: 40px;
  }

  .main-content { padding: 22px 16px 40px; }
  .page-prose .panel-body,
  .legal-content .panel-body,
  .login-card .panel-body,
  .vote-card .panel-body { padding: 20px 18px 24px; }
  .panel-header { padding: 12px 18px; }
  .filterm { padding: 12px 0 14px; }
  .filters { padding: 0 16px; }
  .hero {
    height: calc(170px + var(--header-height));
  }

  /* Home hero is taller (CTA + stats); don't clamp it to the short page-hero height. */
  .hero--home {
    height: auto;
    min-height: 0;
    padding-bottom: 32px;
  }

  .hero--home .hero-inner--home {
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 16px;
  }

  .hero:has(.breadcrumb) {
    height: auto;
    min-height: calc(150px + var(--header-height));
  }

  .hero--server:has(.breadcrumb) {
    min-height: 0;
  }

  .hero--page {
    min-height: calc(108px + var(--header-height));
    padding-bottom: 24px;
  }

  .hero.hero--page:has(.breadcrumb) {
    min-height: calc(108px + var(--header-height));
  }

  .hero--page .hero-inner,
  .hero.hero--page:has(.breadcrumb) .hero-inner {
    padding-top: calc(var(--header-height) + 22px);
    padding-bottom: 8px;
    gap: 12px;
  }

  .hero--page h1 {
    font-size: 1.55rem;
  }

  .hero-inner {
    padding: calc(var(--header-height) + 8px) 16px 0;
  }

  .hero:has(.breadcrumb) .hero-inner {
    padding-top: calc(var(--header-height) + 12px);
  }

  .hero--page .hero-inner,
  .hero.hero--page:has(.breadcrumb) .hero-inner {
    padding-top: calc(var(--header-height) + 22px);
  }
}

@media (max-width: 680px) {
  .filterm {
    padding: 8px 0;
  }

  .filters {
    padding: 0 16px;
  }

  .filter-group-main {
    justify-content: stretch;
  }

  .filter {
    flex: 1 1 calc(25% - 6px);
    font-size: 0.7rem;
    padding: 6px 8px;
  }

  .filterp {
    flex: 0 0 32px;
    width: 32px;
    min-width: 32px;
    min-height: 30px;
    padding: 4px;
  }

  .server-table thead { display: none; }

  .server-table-wrap {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
    margin-top: 12px;
  }

  .server-table,
  .server-table tbody {
    min-width: 0;
  }

  .server-table tbody {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .server-table { table-layout: auto; display: block; border-spacing: 0; }

  .server-entry {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "rank info"
      "banner banner"
      "ip ip";
    gap: 12px 12px;
    align-items: center;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    box-sizing: border-box;
  }

  .server-entry:last-child {
    border-bottom: 1px solid var(--border);
  }

  .server-entry:hover {
    background: var(--bg-surface);
  }

  .server-entry td {
    display: block;
    width: auto !important;
    max-width: 100%;
    height: auto !important;
    min-height: 0;
    padding: 0 !important;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    margin: 0;
    overflow: visible;
  }

  .server-entry:hover td,
  .server-entry:hover td:first-child {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .server-entry td.cell-rank {
    grid-area: rank;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    text-align: left;
    border: none;
    box-shadow: none;
    width: auto !important;
  }

  .server-entry .cell-rank::after {
    display: none;
  }

  .server-entry .cell-name {
    grid-area: name;
    padding-right: 0 !important;
    min-width: 0;
  }

  .server-entry .cell-info {
    grid-area: info;
    width: auto !important;
    min-width: 0;
    padding: 0 !important;
  }

  .server-entry .server-header {
    max-width: 100%;
  }

  .server-entry .info-section .server-name {
    font-size: 1.12rem;
    white-space: nowrap;
  }

  .server-entry .cell-name .server-name-link {
    display: inline-flex;
    font-size: 1.15rem;
    max-width: 100%;
  }

  .server-entry .cell-server {
    grid-area: banner;
    width: 100% !important;
  }

  .server-entry .center-content {
    width: 100%;
  }

  .server-entry .server-block {
    width: 100%;
  }

  .server-entry .cell-server .banner-link {
    width: 100% !important;
    height: 100%;
  }

  /* Keep the banner frame to banner aspect ratio only.
     Square/tall uploads (e.g. 500x500 Arena scrapes) must not expand the card —
     percentage height + intrinsic image size previously blew past aspect-ratio. */
  .server-entry .cell-server .server-block {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: var(--banner-w) / var(--banner-h);
    overflow: hidden;
  }

  .server-entry .cell-server .server-banner {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    aspect-ratio: unset;
    object-fit: contain;
  }

  .server-entry .cell-server .server-banner.server-banner--cover:not(.server-banner--placeholder) {
    object-fit: cover;
  }

  .server-entry .cell-server .list-tag-badges:not(.list-tag-badges--meta) {
    display: flex !important;
  }

  .server-entry .tags-under-banner {
    max-width: 100%;
  }

  .server-entry .cell-ip,
  .server-table .server-entry td.cell-ip {
    grid-area: ip;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
  }

  .server-entry .row-actions {
    max-width: 100%;
  }

  .server-entry .cell-ip .ipcopy {
    width: 100%;
    max-width: 100%;
    height: 38px;
    align-self: stretch;
  }

  .server-entry .info-block,
  .server-table .server-entry .info-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    height: auto;
    min-height: 0;
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    flex-direction: unset;
    justify-content: unset;
  }

  .server-entry .info-row + .info-row,
  .server-table .server-entry .info-row + .info-row {
    margin-top: 0;
  }

  .server-table .server-entry .info-row {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
  }

  .server-table .server-entry .info-row .info-label {
    font-size: 0.75rem;
  }

  .server-table .server-entry .info-row .info-value {
    font-size: 0.92rem;
    text-align: left;
  }

  .server-table .server-entry .status-pill {
    gap: 6px;
    padding: 5px 12px;
    font-size: 0.75rem;
  }

  .server-table .server-entry .status-pill::before {
    width: 7px;
    height: 7px;
  }

  .server-entry .cell-info .info-row {
    margin-bottom: 0;
    margin-top: 0;
    border: none;
    border-radius: 0;
  }

  .server-entry .cell-info .info-row + .info-row {
    margin-top: 0;
  }

  .hero--server {
    padding-bottom: 18px;
  }
  .hero h1 { font-size: 1.5rem; }
  .server-hero-title h1 { font-size: 1.45rem; }
  .server-hero-title .server-favicon {
    width: 40px;
    height: 40px;
  }
  .server-hero-main {
    flex-direction: column;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 0;
  }

  .server-hero-title {
    height: auto;
    min-height: 48px;
  }
  .page-heading h1 { font-size: 1.35rem; }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .footer-scene { height: 95px; }

  .mobile-menu-links { grid-template-columns: 1fr; }

  .pagination {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .pagination a.pagination-hide-mobile,
  .pagination span.pagination-hide-mobile {
    display: none;
  }

  .pagination a,
  .pagination span {
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    font-size: 0.82rem;
  }

  .pagination-prev,
  .pagination-next {
    flex: 1;
    min-width: 0;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .pagination .active {
    flex: 0 0 40px;
    min-width: 40px;
  }
}

@media (max-width: 560px) {
  .vote-card, .login-card { margin: 20px auto; }

  .server-detail-body { padding: 20px 18px 24px; }
  .server-detail-title {
    flex-wrap: wrap;
  }

  .btn-vote-large {
    gap: 10px;
    padding: 14px 12px 14px 12px;
  }

  .btn-vote-label {
    font-size: 0.98rem;
  }

  .btn-vote-arrow {
    width: 38px;
    height: 38px;
  }

  .hero--server h1 {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
  }

  .info-list li {
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .info-list .info-value { text-align: right; }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn-sm { width: 100%; }

  .modal-top { padding: 24px 18px 18px; }
  .modal-body { padding: 18px 18px 22px; }
}

@media (max-width: 420px) {
  .logo-text { display: none; }
  .header-inner { gap: 10px; padding: 0 14px; }
  .hero {
    height: calc(150px + var(--header-height));
  }

  .hero--home {
    height: auto;
    min-height: 0;
    padding-bottom: 36px;
  }

  .hero--home .hero-inner--home {
    padding: calc(var(--header-height) + 40px) 14px 20px;
  }

  .hero--home .quick-actions {
    gap: 48px;
    margin-top: 32px;
    padding: 12px 0 8px;
  }

  .hero--home .btn.primary {
    padding: 14px 26px;
  }

  .hero:has(.breadcrumb) {
    height: auto;
    min-height: calc(140px + var(--header-height));
    padding-bottom: 18px;
  }

  .hero--server:has(.breadcrumb) {
    min-height: 0;
  }

  .hero--page {
    min-height: calc(100px + var(--header-height));
    padding-bottom: 22px;
  }

  .hero.hero--page:has(.breadcrumb) {
    min-height: calc(100px + var(--header-height));
  }

  .hero--page .hero-inner,
  .hero.hero--page:has(.breadcrumb) .hero-inner {
    padding-top: calc(var(--header-height) + 18px);
    gap: 10px;
  }

  .hero--page h1 {
    font-size: 1.35rem;
  }

  .hero-inner {
    padding: calc(var(--header-height) + 6px) 14px 0;
  }

  .hero:has(.breadcrumb) .hero-inner {
    padding-top: calc(var(--header-height) + 12px);
  }

  .hero--page .hero-inner,
  .hero.hero--page:has(.breadcrumb) .hero-inner {
    padding-top: calc(var(--header-height) + 18px);
  }

  .hero h1 { font-size: 1.3rem; }
  .server-hero-title h1 { font-size: 1.3rem; }
  .server-hero-title {
    gap: 10px;
  }
  .hero--server {
    padding-bottom: 16px;
  }
  .hero .intro { font-size: 0.88rem; }
  .main-content { padding: 18px 14px 36px; }
  .filters { padding: 0 14px; }
  .mobile-menu { padding: 14px 16px 18px; }

  .panel-header h1,
  .panel-header h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .similar-servers .panel-header h2,
  .similar-premium .panel-header h2 {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .btn-vote-arrow {
    display: none;
  }
}
