/*******************************
  Mopar-Scape.com – styles.css
  Consolidated working version:
  - Sponsored table scroll works
  - Hover banner: true 728x90 on desktop, never clipped
  - Hover banner disabled on mobile/tablet and small screens
  - Keeps classic Moparscape table look
  - Keeps profile activity styles
  - Restores form/register + sponsored page styling
  - Fixes vote icon underline/border behavior in BOTH tables
********************************/

:root {
  --blue: #1f66b3;
  --deep-blue: #0c4c99;
  --light-blue: #2c7bd8;
  --steel: #bdbdbd;
  --panel: #d9d9d9;
  --shadow: #7b7b7b;

  /* Golds (classic, not neon) */
  --gold: #e7bf3a;
  --gold-dark: #c99507;
  --gold-light: #f3dd86;

  /* Table layout vars */
  --server-banner-col: 300px;
  --server-meta-col: clamp(70px, 7vw, 110px);
  --server-banner-width: 300px;
  --server-banner-height: 37px;

  /* IMPORTANT: keep same for name col + footer left label col */
  --server-name-col: 300px;

  /* Sponsored hover banner positioning (set by JS) */
  --sb-left: 10px;
  --sb-top: 10px;
  --sb-scale: 1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  background: #bfbfbf;
  color: #2c2c2c;
}

.seo-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ================= DARK MODE ================= */
body.dark-mode,
html.dark-mode body {
  background: #2b2b2b;
  color: #e0e0e0;
}

body.dark-mode::before,
html.dark-mode body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 5;
}

body.dark-mode .page,
html.dark-mode .page {
  background: #3a3a3a;
  border-color: #555;
  box-shadow: 0 0 0 2px #4a4a4a;
}

body.dark-mode .top-bar,
html.dark-mode .top-bar {
  background: linear-gradient(#4b4b4b, #3a3a3a 40%, #333);
  border-bottom: 1px solid #555;
}

body.dark-mode .brand-title,
body.dark-mode .brand-sub,
html.dark-mode .brand-title,
html.dark-mode .brand-sub {
  color: #8fb8ff;
  text-shadow: 0 2px 0 #0a2342, 0 4px 6px rgba(0, 0, 0, 0.5);
}

body.dark-mode .brand-slogan,
html.dark-mode .brand-slogan { color: #d0d0d0; }

body.dark-mode .tab-bar,
html.dark-mode .tab-bar {
  background: #4a4a4a;
  border-bottom: 1px solid #555;
}

body.dark-mode .tab,
html.dark-mode .tab {
  background: linear-gradient(#606a77, #4b545e);
  border-color: #3f3f3f;
  color: #f0f0f0;
}

body.dark-mode .tab.active,
html.dark-mode .tab.active {
  background: linear-gradient(#3f4c5a, #2d353e);
}

body.dark-mode .nav-icon-link,
body.dark-mode .nav-icon-button,
html.dark-mode .nav-icon-link,
html.dark-mode .nav-icon-button {
  border-color: #3f3f3f;
  background: linear-gradient(#606a77, #4b545e);
}

/* keep “dark mode content” readable */
body.dark-mode .notice,
body.dark-mode .footer,
body.dark-mode .form-panel,
body.dark-mode .form-section,
body.dark-mode .profile-card,
body.dark-mode .profile-activity-card,
body.dark-mode .profile-description,
body.dark-mode .profile-stat,
body.dark-mode .vote-gateway-page,
body.dark-mode .vote-gateway,
body.dark-mode .vote-gateway-captcha,
body.dark-mode .other-servers,
body.dark-mode .sponsored,
body.dark-mode .server-table,
html.dark-mode .notice,
html.dark-mode .footer,
html.dark-mode .form-panel,
html.dark-mode .form-section,
html.dark-mode .profile-card,
html.dark-mode .profile-activity-card,
html.dark-mode .profile-description,
html.dark-mode .profile-stat,
html.dark-mode .vote-gateway-page,
html.dark-mode .vote-gateway,
html.dark-mode .vote-gateway-captcha,
html.dark-mode .other-servers,
html.dark-mode .sponsored,
html.dark-mode .server-table {
  color: #2c2c2c;
}

body.dark-mode .notice a,
body.dark-mode .page-links a,
body.dark-mode .server-table a,
body.dark-mode .profile-stat-value a,
body.dark-mode .profile-value a,
body.dark-mode .sponsored-link,
body.dark-mode .vote-gateway-links a,
html.dark-mode .notice a,
html.dark-mode .page-links a,
html.dark-mode .server-table a,
html.dark-mode .profile-stat-value a,
html.dark-mode .profile-value a,
html.dark-mode .sponsored-link,
html.dark-mode .vote-gateway-links a {
  color: #1d4bb8;
}

body.dark-mode .profile-back,
html.dark-mode .profile-back { color: #8fb8ff; }

body.dark-mode .page-title,
html.dark-mode .page-title { color: #c9dcff; }

body.dark-mode .page-subtitle,
html.dark-mode .page-subtitle { color: #b8b8b8; }

body.dark-mode .page-links a,
html.dark-mode .page-links a { color: #9fc2ff; }

body.dark-mode .sponsored .section-title,
body.dark-mode .other-servers .section-title,
body.dark-mode .form-panel .form-title,
body.dark-mode .form-panel .form-section-title,
body.dark-mode .form-section .form-section-title,
html.dark-mode .sponsored .section-title,
html.dark-mode .other-servers .section-title,
html.dark-mode .form-panel .form-title,
html.dark-mode .form-panel .form-section-title,
html.dark-mode .form-section .form-section-title {
  color: #1f4e96;
}

body.dark-mode .form-panel .form-help,
html.dark-mode .form-panel .form-help { color: #4d4d4d; }

/* ================= PAGE WRAPPER ================= */
.page {
  width: 94%;
  max-width: 1600px;
  margin: 20px auto;
  background: #d0d0d0;
  border: 1px solid #9a9a9a;
  box-shadow: 0 0 0 2px #b5b5b5;
  overflow: visible;
}

/* ================= HEADER ================= */
.top-bar {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  padding: 10px 16px 16px;
  background: linear-gradient(#bdbdbd, #e2e2e2 40%, #d2d2d2);
  border-bottom: 1px solid #9f9f9f;
}

.top-left,
.top-right {
  display: flex;
  align-items: center;
}

.top-left { justify-content: flex-start; }
.top-right { justify-content: flex-end; gap: 12px; }

.top-link-image img {
  display: block;
  height: 80px;
  width: auto;
  cursor: pointer;
  transition: filter 0.15s ease-in-out;
}

.top-link-image img:hover { filter: brightness(1.15); }

.brand { text-align: center; }

.brand-title {
  font-size: 40px;
  font-weight: 700;
  color: var(--blue);
  text-shadow: 0 2px 0 #0a3c70, 0 4px 6px rgba(0,0,0,0.2);
}

.brand-sub {
  font-size: 26px;
  font-weight: 700;
  color: var(--blue);
  margin-top: -4px;
}

.brand-slogan {
  margin-top: 4px;
  font-size: 12px;
  color: #333;
}

/* ================= TABS ================= */
.tab-bar {
  display: flex;
  padding: 8px 10px;
  background: #dcdcdc;
  border-bottom: 1px solid #a6a6a6;
  align-items: center;
  gap: 8px;
}

.tab-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
}

.tab {
  background: linear-gradient(#9aa2ad, #7c8490);
  color: #f5f5f5;
  border: 1px solid #7a7a7a;
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.tab:hover,
.tab:focus {
  text-decoration: none;
  filter: brightness(1.08);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.tab.active { background: linear-gradient(#5f6f80, #424e5b); }

.nav-icon-link,
.nav-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 2px;
  border-radius: 2px;
  border: 1px solid #7a7a7a;
  background: linear-gradient(#9aa2ad, #7c8490);
  cursor: pointer;
  text-decoration: none;
}

.nav-icon-link img,
.nav-icon-button img {
  width: 20px;
  height: 20px;
  display: block;
}

.nav-icon-link:hover,
.nav-icon-link:focus,
.nav-icon-button:hover,
.nav-icon-button:focus { filter: brightness(1.08); }

.nav-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: #215b21;
}

.tab-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(#6fd56f, #1f9a1f);
  border: 1px solid #0f6f0f;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.35);
}

/* ================= CONTENT ================= */
.content {
  padding: 8px 12px 20px;
  overflow: visible;
}

.page-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #1f4e96;
}

.page-subtitle {
  margin: 0 0 12px;
  font-size: 12px;
  color: #4d4d4d;
}

.section-title {
  margin: 14px 0 6px;
  font-size: 16px;
  color: #1f4e96;
}

/* ================= NOTICES ================= */
.notice {
  background: #d9d9d9;
  border: 1px solid #b2b2b2;
  padding: 6px 10px;
  font-size: 11px;
  margin-bottom: 12px;
}

.notice a { color: #1a4aa3; }

.notice-success { background: #d9f2d9; border-color: #7fbf7f; color: #1f6b1f; }
.notice-error   { background: #f6d6d6; border-color: #d08a8a; color: #8a1f1f; }

.notice.notice-success {
  border: 1px solid rgba(0, 128, 0, 0.35);
  background: rgba(0, 128, 0, 0.10);
  color: #0a5a0a;
}

.notice.notice-error {
  border: 1px solid rgba(160, 0, 0, 0.35);
  background: rgba(160, 0, 0, 0.10);
  color: #7a0000;
}

/* ================= TABLE SCROLLERS ================= */
.table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.table-scroll-outer,
.table-scroll-inner { position: relative; }

/* ================= TABLES ================= */
.section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin: 1px 0 1px;
  text-align: center;
}

.section-header .section-title { margin: 0; }

.section-banner {
  display: block;
  flex: 0 0 100%;
  width: auto;
  max-width: 300px;
  height: auto;
  margin: 0 auto;
}

.server-table {
  width: 100%;
  min-width: calc(var(--server-name-col) + var(--server-banner-col) + (var(--server-meta-col) * 7));
  border-collapse: collapse;
  font-size: 11px;
  background: #e6e6e6;
  table-layout: fixed;
}

/* Colgroup widths */
.server-table colgroup col:first-child { width: var(--server-name-col) !important; }
.server-table col.server-name-col { width: var(--server-name-col); }
.server-table col.server-banner-col { width: var(--server-banner-col); }
.server-table col.server-meta-col { width: var(--server-meta-col); }

/* Fallback widths if colgroup is missing */
.server-table th:nth-child(1),
.server-table td:nth-child(1) { width: var(--server-name-col); }
.server-table th:nth-child(2),
.server-table td:nth-child(2) { width: var(--server-banner-col); }
.server-table th:nth-child(n+3):nth-child(-n+9),
.server-table td:nth-child(n+3):nth-child(-n+9) { width: var(--server-meta-col); }

.server-table th,
.server-table td {
  border-bottom: 1px solid #cfcfcf;
  padding: 6px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.server-table th {
  background: linear-gradient(#e9e9e9, #cfcfcf);
  font-weight: 700;
  color: #4d4d4d;
  white-space: normal;
  line-height: 1.2;
}

body.dark-mode .server-table td,
html.dark-mode .server-table td { color: #2c2c2c; }

.server-name {
  text-align: left;
  padding-left: 14px;
  font-weight: 700;
  color: #2434b3;
  white-space: normal;
  position: relative;
}

.server-banner-cell {
  text-align: center;
  padding: 2px 0 !important;
  height: calc(var(--server-banner-height) + 4px);
  line-height: 0;
}

.server-banner-img {
  display: block;
  margin: 0 auto;
  width: min(var(--server-banner-width), 100%);
  height: var(--server-banner-height);
  object-fit: cover;
  object-position: center;
  border-radius: 3px;
}

.server-table a {
  color: #1d4bb8;
  text-decoration: none;
  font-weight: 700;
}

.server-table .table-link { display: inline-block; width: 100%; }

/* ================= SPONSORED (HOME LIST) ================= */
.sponsored {
  background: #dcdcdc;
  border: 1px solid #b7b7b7;
  margin-bottom: 1px;
  padding: 1px;
  position: relative;
  z-index: 20;
  overflow: visible;
}

.sponsored-table { background: var(--gold); }

.sponsored-table th {
  background: linear-gradient(var(--gold-light), var(--gold-dark));
  color: #6b4f00;
}

.sponsored-table tbody tr:nth-child(odd) { background: #f6dc7a; }
.sponsored-table tbody tr:nth-child(even) { background: #edd06a; }

.sponsored-table tbody tr {
  transition: background-color 0.08s linear, box-shadow 0.08s linear;
  position: relative;
  z-index: 1;
}

.sponsored-table tbody tr:hover {
  background-color: #ffeaa0;
  box-shadow:
    inset 0 1px 0 rgba(150, 110, 0, 0.35),
    inset 0 -1px 0 rgba(150, 110, 0, 0.35);
  z-index: 5;
}

/* IMPORTANT: Sponsored cells must NOT clip anything */
.sponsored .server-table td,
.sponsored .server-table th,
.sponsored-table td,
.sponsored-table th {
  overflow: visible !important;
}

.sponsored-table td {
  border-bottom: 1px solid rgba(160, 120, 0, 0.35);
  position: relative;
}

/* ===== Hover banner wrapper ===== */
.sponsored-name-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  z-index: 1;
}

.sponsored-banner {
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sponsored-banner img {
  display: block;
  background: transparent;
  border: 1px solid #b7b7b7;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.sponsored .table-scroll.table-scroll-outer {
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.sponsored .table-scroll-inner {
  overflow: visible !important;
}

/* =============================================================================
   SPONSORED HOVER BANNER – DESKTOP ONLY
============================================================================= */
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
  .sponsored-banner {
    display: block !important;
    position: fixed !important;
    left: var(--sb-left) !important;
    top: var(--sb-top) !important;
    width: 728px !important;
    height: 90px !important;
    overflow: hidden !important;
    transform: scale(var(--sb-scale, 1));
    transform-origin: top left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 2147483647 !important;
  }

  .sponsored-banner img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    object-position: center;
    display: block;
  }

  .server-banner-cell:hover .sponsored-banner,
  .server-banner-cell:focus-within .sponsored-banner {
    opacity: 1;
    visibility: visible;
  }
}

@media (hover: none), (pointer: coarse) {
  .sponsored-banner { display: none !important; }
}

@media (max-width: 1024px) {
  .sponsored-banner { display: none !important; }
}

/* ===== Sponsored footer ===== */
.table-footer-bar {
  background: #e6c84d;
  border-left: 1px solid #b7b7b7;
  border-right: 1px solid #b7b7b7;
  border-bottom: 1px solid #b7b7b7;
  border-top: 1px solid #cfa200;
  overflow: visible;
}

.table-footer-row { padding: 0; }

.footer-grid {
  display: grid;
  grid-template-columns: var(--server-name-col) 1fr;
  align-items: center;
  min-height: 26px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.footer-total-row { border-top: none; }

.footer-label {
  padding-left: 14px;
  font-size: 11px;
  font-weight: 600;
  color: #6b4f00;
}

.footer-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #6b4f00;
}

.sponsored-link {
  display: inline-block;
  white-space: nowrap;
  color: #1d4bb8;
  font-weight: 700;
  text-decoration: none;
  visibility: visible;
  opacity: 1;
}

.sponsored-link:hover { text-decoration: underline; }

.table-footer-bar .footer-grid {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 26px;
  padding: 6px 12px;
  text-align: center;
}

.table-footer-bar .footer-label {
  padding-left: 0 !important;
  text-align: center !important;
}

.table-footer-bar .footer-center {
  justify-content: center !important;
  min-width: 0;
}

/* ================= VOTES ================= */
.vote-icons { text-align: center; }
.vote { width: 12px; height: 12px; border-radius: 3px; }

.vote.green {
  background: linear-gradient(#6fd56f, #1f9a1f);
  border: 1px solid #0f6f0f;
}

.vote.red {
  background: linear-gradient(#f17979, #b92323);
  border: 1px solid #8d1a1a;
}

/* ================= OTHER SERVERS ================= */
.other-servers {
  padding: 1px;
  border: 1px solid #b7b7b7;
  background: #dcdcdc;
}

.other-servers .server-table tbody tr:nth-child(odd)  { background-color: #ededed; }
.other-servers .server-table tbody tr:nth-child(even) { background-color: #ffffff; }

.other-servers .server-table tbody tr {
  transition: background-color 0.08s linear, box-shadow 0.08s linear;
}

.other-servers .server-table tbody tr:hover {
  background-color: #d4e2ff;
  box-shadow: inset 0 1px 0 #a9bfff, inset 0 -1px 0 #a9bfff;
  cursor: pointer;
}

/* ================= HOVER LINK UNDERLINE ================= */
.sponsored-table tbody tr:hover a.table-link {
  color: #0b3fa5;
  text-decoration: underline;
}

.other-servers .server-table tbody tr:hover a.table-link {
  color: #0b3fa5;
  text-decoration: underline;
}

/* ================= VOTE ICON / BORDER FIX ================= */
/* Keep vote icon clean, but preserve each table's own row divider */
.other-servers .server-table td.vote-icons {
  border-bottom: 1px solid #cfcfcf !important;
}

.sponsored-table td.vote-icons {
  border-bottom: 1px solid rgba(160, 120, 0, 0.35) !important;
}

.server-table td.vote-icons {
  padding: 0 !important;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap;
  text-decoration: none !important;
}

.server-table td.vote-icons a,
.server-table td.vote-icons a:hover,
.server-table td.vote-icons a:focus,
.server-table td.vote-icons a:active,
.server-table td.vote-icons img {
  text-decoration: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}

.server-table td.vote-icons a.vote-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px;
  height: 24px;
  line-height: 0 !important;
  font-size: 0 !important;
  border: 0 !important;
}

.server-table td.vote-icons a.vote-button img {
  display: block !important;
}

/* ================= PAGINATION ================= */
.pages {
  margin-top: 12px;
  text-align: center;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.page-summary { display: inline-flex; gap: 6px; }
.page-links { display: inline-flex; gap: 6px; }

.page-links a {
  color: #1a4aa3;
  font-weight: 700;
  text-decoration: none;
}

/* ================= FOOTER ================= */
.footer {
  background: #d2d2d2;
  border-top: 1px solid #a6a6a6;
  padding: 10px;
  text-align: center;
  font-size: 11px;
}

/* ================= REGISTER / FORMS ================= */
.form-panel {
  background: #dcdcdc;
  border: 1px solid #b7b7b7;
  padding: 16px;
}

.form-panel + .form-panel { margin-top: 14px; }
.form-panel.locked { opacity: 0.75; }

.form-title {
  margin: 0 0 6px;
  font-size: 18px;
  color: #1f4e96;
}

.form-help {
  margin: 0 0 12px;
  font-size: 11px;
  color: #4d4d4d;
}

.register-form { display: grid; gap: 10px; }

.form-section {
  border: 1px solid #b3b3b3;
  background: #e5e5e5;
  padding: 12px;
}

.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.form-section-title {
  margin: 0 0 10px;
  font-size: 13px;
  color: #1f4e96;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-section-header .form-section-title { margin: 0; }

.form-section-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: 11px;
  color: #f5f5f5;
  border: 1px solid #7a7a7a;
  border-radius: 2px;
  background: linear-gradient(#5f6f80, #424e5b);
  text-decoration: none;
}

.form-section-action:hover,
.form-section-action:focus {
  background: linear-gradient(#6f8194, #4a5766);
}

.form-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: center;
}

.form-row label {
  font-size: 11px;
  font-weight: 700;
  color: #3b3b3b;
  text-align: right;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  border: 1px solid #9a9a9a;
  background: #efefef;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  margin-bottom: 6px;
}

.form-row textarea { min-height: 90px; resize: vertical; }

.form-row small {
  display: block;
  font-size: 10px;
  color: #666;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.form-note {
  margin: 6px 0 0;
  font-size: 10px;
  color: #5b5b5b;
  text-align: right;
}

.form-actions button {
  background: linear-gradient(#5f6f80, #424e5b);
  border: 1px solid #7a7a7a;
  color: #f5f5f5;
  padding: 6px 14px;
  font-size: 11px;
  cursor: pointer;
}

.form-actions button.secondary {
  background: linear-gradient(#9aa2ad, #7c8490);
}

.form-actions .form-action-link {
  display: inline-block;
  background: linear-gradient(#5f6f80, #424e5b);
  border: 1px solid #7a7a7a;
  color: #f5f5f5;
  padding: 6px 14px;
  font-size: 11px;
  text-decoration: none;
}

.form-actions .form-action-link.secondary {
  background: linear-gradient(#9aa2ad, #7c8490);
}

.form-row.checkbox-row {
  grid-template-columns: 180px auto;
  align-items: center;
}

.form-row.checkbox-row input { width: auto; }

/* ================= SPONSORED PAGE ================= */
.sponsored-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sponsored-account-card { margin-bottom: 0; }

.sponsored-account-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
  margin: 0;
}

.sponsored-account-details div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sponsored-account-details dt {
  font-size: 11px;
  font-weight: 700;
  color: #1f4e96;
}

.sponsored-account-details dd {
  margin: 0;
  font-size: 12px;
  color: #2f2f2f;
}

.sponsored-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.sponsored-plan {
  background: #e5e5e5;
  border: 1px solid #b7b7b7;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 0 0 1px #f0f0f0;
}

.sponsored-plan h2 {
  margin: 0;
  font-size: 18px;
  color: #1f4e96;
}

.sponsored-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sponsored-price-value {
  font-size: 24px;
  font-weight: 700;
  color: #1f4e96;
}

.sponsored-price-duration {
  font-size: 12px;
  color: #4d4d4d;
}

.sponsored-description {
  margin: 0;
  font-size: 11px;
  color: #4d4d4d;
}

.sponsored-benefits {
  margin: 0;
  padding-left: 18px;
  font-size: 11px;
  color: #3b3b3b;
  display: grid;
  gap: 4px;
}

.paypal-form { margin-top: auto; }

.paypal-button {
  width: 100%;
  border: 1px solid #1f4e96;
  background: linear-gradient(#2e6cc3, #1b4d98);
  color: #fdfdfd;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.paypal-button:hover { filter: brightness(1.08); }

/* ================= EDIT PAGE ================= */
.edit-panel {
  background: #dcdcdc;
  border: 1px solid #b7b7b7;
  padding: 16px;
}

.edit-panel .editor-wrap {
  border: 1px solid #b3b3b3;
  background: #e5e5e5;
  padding: 12px;
}

.edit-panel textarea {
  width: 100%;
  min-height: 220px;
  border: 1px solid #9a9a9a;
  background: #efefef;
  padding: 8px;
  font-family: inherit;
  font-size: 12px;
  resize: vertical;
}

/* ================= PROFILE ================= */
.profile-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.profile-back {
  font-size: 11px;
  color: #1a4aa3;
  text-decoration: none;
  font-weight: 700;
}

.profile-back:hover { text-decoration: underline; }

.profile-title {
  font-size: 22px;
  font-weight: 700;
  color: #1f4e96;
}

.profile-subtitle {
  font-size: 12px;
  color: #4d4d4d;
}

.profile-card {
  background: #dcdcdc;
  border: 1px solid #b7b7b7;
  padding: 16px;
  margin-bottom: 16px;
}

.profile-card h2 {
  margin: 0 0 12px;
  font-size: 16px;
  color: #1f4e96;
}

/* Activity chart */
.profile-activity-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e3e3e3;
  padding: 18px 20px 20px;
}

.profile-activity-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-activity-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  color: #1f1f1f;
}

.activity-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1f1f1f;
}

.activity-icon svg { width: 100%; height: 100%; }

.profile-activity-tabs {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #b9b9b9;
}

.activity-tab {
  border: none;
  background: #ffffff;
  padding: 6px 16px;
  font-size: 14px;
  color: #1f1f1f;
  cursor: pointer;
}

.activity-tab + .activity-tab { border-left: 1px solid #b9b9b9; }

.activity-tab.is-active {
  background: linear-gradient(#eaeaea, #cfcfcf);
  font-weight: 700;
}

.profile-activity-card[data-mode="votes"] .profile-line.clicks,
.profile-activity-card[data-mode="votes"] .profile-point.clicks {
  opacity: 0;
  pointer-events: none;
}

.profile-activity-card[data-mode="views"] .profile-area.votes,
.profile-activity-card[data-mode="views"] .profile-line.votes,
.profile-activity-card[data-mode="views"] .profile-point.votes {
  opacity: 0;
  pointer-events: none;
}

.profile-activity-chart {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  align-items: stretch;
}

.profile-activity-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 12px;
  color: #6b6b6b;
}

.profile-activity-plot { position: relative; }

.profile-activity-tooltip {
  position: absolute;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
  font-size: 12px;
  border-radius: 6px;
  transform: translate(-50%, -110%);
  opacity: 0;
  transition: opacity 0.12s ease-in-out;
  z-index: 2;
}

.profile-activity-tooltip strong { font-size: 12px; }
.profile-activity-tooltip.is-visible { opacity: 1; }

.profile-chart-svg {
  width: 100%;
  height: 220px;
  background-color: #ffffff;
  border: 1px solid #dedede;
  border-radius: 6px;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 1px, transparent 1px);
  background-size: 9.09% 20%;
}

.profile-area.votes { fill: rgba(255, 84, 131, 0.35); }
.profile-line { stroke-width: 0.3; }
.profile-line.votes { stroke: #ff5a89; }
.profile-line.clicks { stroke: #2fa0ff; }

.profile-point { stroke: #ffffff; stroke-width: 0.5; }
.profile-point.votes { fill: #ff5a89; }
.profile-point.clicks { fill: #2fa0ff; }

.profile-activity-x-axis {
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 0;
  margin-left: 44px;
  margin-top: 8px;
}

.profile-activity-x-axis span {
  font-size: 11px;
  color: #6b6b6b;
  transform: rotate(-45deg);
  transform-origin: top left;
  white-space: nowrap;
}

/* Profile meta blocks */
.profile-description {
  background: #f1f1f1;
  border: 1px solid #c7c7c7;
  padding: 12px 14px;
  font-size: 12px;
  color: #2d2d2d;
  line-height: 1.5;
}

.profile-description ul,
.profile-description ol {
  margin: 10px 0;
  padding-left: 22px;
}

.profile-description li {
  margin: 4px 0;
}

.profile-description hr {
  border: 0;
  border-top: 1px solid rgba(0,0,0,.15);
  margin: 12px 0;
}

.profile-description img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
}

.profile-description blockquote {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 4px solid rgba(0,0,0,.15);
  background: rgba(0,0,0,.03);
  border-radius: 4px;
}

.profile-description pre {
  margin: 10px 0;
}

.profile-description br + br {
  line-height: 0;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 20px;
}

.profile-stat {
  background: #f8f8f8;
  border: 1px solid #c8c8c8;
  padding: 10px 12px;
}

.profile-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #6b6b6b;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-stat-value {
  font-size: 13px;
  font-weight: 700;
  color: #2b2b2b;
  word-break: break-word;
}

.profile-stat-value a { color: #1d4bb8; text-decoration: none; }
.profile-stat-value a:hover { text-decoration: underline; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 20px;
}

.profile-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #666;
  margin-bottom: 4px;
  font-weight: 700;
}

.profile-value { font-size: 13px; font-weight: 700; color: #2b2b2b; }
.profile-value a { color: #1d4bb8; text-decoration: none; }
.profile-value a:hover { text-decoration: underline; }

.profile-owner { margin-bottom: 12px; }
.profile-table-wrapper { overflow-x: auto; }

/* ================= VOTE GATEWAY ================= */
.vote-gateway-page { background: #f6f6f6; padding: 18px; }

.vote-gateway {
  border: 1px solid #c9c9c9;
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.vote-gateway-header {
  background: #3e6f8f;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 3px solid #2f5c78;
}

.vote-gateway-body {
  padding: 28px 20px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vote-gateway-status { font-size: 13px; color: #2f2f2f; }
.vote-gateway-status.error { color: #b00020; font-weight: 700; }

.vote-gateway-title {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.vote-gateway-intro {
  margin: 0 auto;
  font-size: 14px;
  color: #444;
  max-width: 720px;
  white-space: nowrap;
}

.vote-gateway-intro-line { display: inline; }
.vote-gateway-intro-line + .vote-gateway-intro-line { margin-left: 4px; }

.vote-gateway-banner {
  margin: 0 auto;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #c3c3c3;
  max-width: 520px;
}

.vote-gateway-banner img { width: 100%; height: auto; display: block; object-fit: cover; }

.vote-gateway-captcha {
  margin: 0 auto;
  max-width: 420px;
  border: 1px solid #d3d3d3;
  border-radius: 4px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vote-gateway-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vote-gateway-turnstile {
  flex-basis: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.vote-gateway-button {
  text-decoration: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}

.vote-gateway-button-primary { background: #5cb85c; border-color: #4cae4c; color: #fff; }
.vote-gateway-button-secondary { background: #d9534f; border-color: #c9302c; color: #fff; }

.vote-gateway-links { font-size: 12px; }
.vote-gateway-links a { color: #2f5c78; text-decoration: none; font-weight: 700; }
.vote-gateway-links a:hover { text-decoration: underline; }

/* ================= PROFILE – HERO / BANNER / BUTTONS ================= */
.profile-hero {
  padding: 0;
  overflow: hidden;
}

.profile-banner {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: #0f2b57;
}

.profile-banner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.profile-hero-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-hero-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-hero-title {
  font-size: 24px;
  font-weight: 700;
  color: #163b78;
}

.profile-hero-meta {
  font-size: 12px;
  color: #4d4d4d;
  margin-top: 6px;
}

.profile-hero-owner a {
  color: #1d4bb8;
  text-decoration: none;
  font-weight: 700;
}

.profile-hero-owner a:hover { text-decoration: underline; }

.profile-hero-dot { margin: 0 6px; }

.profile-hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: #1d4bb8;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid #153a8e;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.profile-button:hover { background: #163b78; }

.profile-button.ghost {
  background: #eef2fb;
  color: #1d4bb8;
  border-color: #b7c4ef;
  box-shadow: none;
}

.profile-button.ghost:hover { background: #dfe7fb; }

/* ================= PROFILE – VOTE CARD UI ================= */
.vote-card { margin-bottom: 16px; }

.vote-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vote-title {
  font-size: 22px;
  font-weight: 700;
  color: #163b78;
}

.vote-help {
  font-size: 12px;
  color: #4d4d4d;
}

.vote-actions {
  display: flex;
  justify-content: flex-start;
}

.vote-submit {
  background: linear-gradient(#5f6f80, #424e5b);
  border: 1px solid #7a7a7a;
  color: #f5f5f5;
  padding: 8px 18px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.vote-submit:hover { filter: brightness(1.05); }

.vote-banner-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #f5f5f5;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ================= LOGOUT OVERRIDE ================= */
.logout-form { display: inline; margin: 0; padding: 0; }
.logout-link {
  background: none;
  border: 0;
  padding: 0;
  margin-left: 10px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: underline;
}

/* ================= PREMIUM FOOTER LINK ================= */
.sponsored .table-footer-bar a.premium,
.sponsored .table-footer-bar a.premium:visited {
  color: #1d4bb8;
  text-decoration: none;
  font-weight: 700;
}

.sponsored .table-footer-bar a.premium:hover,
.sponsored .table-footer-bar a.premium:focus {
  color: #0b3fa5;
  text-decoration: underline;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1000px) {
  .page { width: 98%; }

  .top-bar {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }

  .top-left,
  .top-right { justify-content: center; }

  .tab-bar { flex-wrap: wrap; }
}

@media (max-width: 850px) {
  :root {
    --server-name-col: 220px;
    --server-banner-col: 210px;
    --server-meta-col: clamp(70px, 9vw, 100px);
  }

  .top-link-image img { height: 64px; }
  .tab-bar { gap: 6px; }
  .tab { padding: 8px 10px; }

  .profile-activity-chart { grid-template-columns: 28px 1fr; }
  .profile-chart-svg { height: 200px; }
  .profile-activity-x-axis { margin-left: 32px; }
}

@media (max-width: 700px) {
  .vote-gateway-intro { white-space: normal; }
  .vote-gateway-intro-line { display: block; }
  .vote-gateway-intro-line + .vote-gateway-intro-line { margin-left: 0; }
}

@media (max-width: 640px) {
  .brand-title { font-size: 28px; }
  .brand-sub { font-size: 18px; }

  .top-bar { padding: 12px; }
  .top-link-image img { height: 56px; }

  .tab-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .tab-actions { width: 100%; justify-content: center; }

  .nav-icon-link,
  .nav-icon-button {
    width: 34px;
    height: 34px;
  }

  .form-row {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .form-row label { text-align: left; }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions button { width: 100%; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    text-align: center;
    padding: 6px 10px;
  }

  .footer-label { padding-left: 0; }
  .footer-center { justify-content: center; }

  .vote-gateway-body { padding: 20px 14px 22px; }
  .vote-gateway-title { font-size: 22px; }

  .vote-gateway-captcha {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 520px) {
  :root {
    --server-name-col: 160px;
    --server-banner-col: 180px;
    --server-meta-col: 90px;
  }

  .page { margin: 12px auto; }
  .content { padding: 6px 10px 16px; }

  .brand-title { font-size: 24px; }
  .brand-sub { font-size: 16px; }
  .brand-slogan { font-size: 11px; }

  .notice { font-size: 10px; }

  .profile-activity-card { padding: 14px 12px 16px; }
  .profile-activity-x-axis span { font-size: 9px; }
  .profile-chart-svg { height: 180px; }

  .server-table th,
  .server-table td { padding: 6px 4px; }

  .vote-gateway-title { font-size: 20px; }
  .vote-gateway-banner { max-width: 100%; }
}