/* MCVote — modern minimal theme
   Clean dark surfaces, one accent, no heavy glows/shadows, system fonts.
   All class names match the Go templates — do not rename selectors. */

:root {
  --bg: #0a0c10;
  --surface: #11141a;
  --surface-2: #161a22;
  --border: #1f2530;
  --border-strong: #2a3140;
  --text: #e6eaf0;
  --text-2: #98a1b2;
  --text-3: #5b6577;
  --accent: #22c55e;
  --accent-strong: #16a34a;
  --on-accent: #052e16;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.08);
  --gold: #d4a017;
  --gold-bg: rgba(212, 160, 23, 0.1);
  --radius: 10px;
  --radius-lg: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

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

html { background: var(--bg); }
body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--on-accent); }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); }

main {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 60px;
  padding: 0 max(20px, calc((100vw - 1080px) / 2 + 20px));
  background: rgba(10, 12, 16, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.brand-mark svg { width: 16px; height: 16px; }
.brand-accent { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 2px; }

.nav a, .footer-links a {
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav a:hover, .footer-links a:hover { color: var(--text); background: var(--surface); }

.nav-actions { display: flex; align-items: center; gap: 8px; }

.locale-link {
  padding: 5px 9px;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 7px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.locale-link:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- Footer ---------- */

.site-footer {
  width: min(1080px, calc(100% - 40px));
  margin: 64px auto 0;
  padding: 24px 0 32px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.85rem;
}

.site-footer strong { color: var(--text); font-size: 0.95rem; }
.site-footer p { margin-top: 2px; color: var(--text-3); max-width: 360px; }
.footer-links { display: flex; gap: 4px; flex-wrap: wrap; }
.footer-links a { padding: 5px 9px; color: var(--text-2); font-size: 0.82rem; }

/* ---------- Typography ---------- */

h1, h2, h3, h4 { letter-spacing: -0.02em; line-height: 1.2; }

h1 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  max-width: 720px;
}

h2 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }

.accent { color: var(--accent); }
.text-muted { color: var(--text-2); }

/* ---------- Hero / page intro ---------- */

.hero, .page-hero, .profile-hero { padding: 48px 0 28px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 40px;
}

.hero-content { display: flex; flex-direction: column; gap: 16px; }

.hero-lead, .page-hero p {
  max-width: 600px;
  color: var(--text-2);
  font-size: 1rem;
}

.eyebrow, .eyebrow-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.eyebrow-text { margin-bottom: 12px; }

.eyebrow-dot, .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.hero-panel {
  position: relative;
  min-height: 320px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.hero-panel__stats, .stats-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.stat, .stat-box {
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat b, .stat-box b, .server-row__stats b {
  display: block;
  font-family: var(--mono);
  font-size: 1.1rem;
  line-height: 1.2;
}

.stat span, .stat-box span, .server-row__stats span {
  display: block;
  margin-top: 3px;
  color: var(--text-3);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Buttons / controls ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.button:hover { background: var(--surface); border-color: var(--border-strong); }
.button:active { transform: translateY(1px); }

.button--primary {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
  font-weight: 600;
}

.button--primary:hover { background: var(--accent-strong); }

.search-bar, .filter-panel, .address-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

.search-bar:focus-within, .filter-panel:focus-within { border-color: var(--border-strong); }

.search-bar svg { width: 16px; height: 16px; margin-left: 6px; color: var(--text-3); }

.search-bar input, .filter-panel input, .filter-panel select, .address-copy code {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.92rem;
}

.filter-panel { flex-wrap: wrap; }
.filter-panel input { min-width: 220px; }

.filter-panel select {
  flex: 0 0 auto;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 7px;
  background: var(--surface-2);
}

::placeholder { color: var(--text-3); }

/* ---------- Cards / sections ---------- */

.section { padding: 32px 0; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading > a { color: var(--accent); font-weight: 500; font-size: 0.88rem; }

.content-card, .notice, .empty-state, .server-row, .tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.content-card { padding: 24px; }
.content-card h2 { margin-bottom: 10px; }
.content-card p { color: var(--text-2); }

.server-list { display: flex; flex-direction: column; gap: 8px; }

.server-row {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr) minmax(110px, 140px);
  gap: 14px;
  align-items: center;
  padding: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.server-row:hover { border-color: var(--border-strong); background: var(--surface-2); }

.server-row__banner {
  position: relative;
  width: 100%;
  aspect-ratio: 468 / 60;
  min-height: 52px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}

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

.server-row__banner-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
  font-size: 0.9rem;
}

.server-row__main { min-width: 0; }

.server-row__identity, .profile-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.server-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.server-icon img { width: 100%; height: 100%; object-fit: cover; }

.server-icon--large {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  font-size: 1.3rem;
}

.server-row__title { min-width: 0; }
.server-row__topline { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 3px; }
.server-row__main h3 a:hover { color: var(--accent); }

.server-row__main p {
  max-width: 680px;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.server-row__address { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.server-row__address code, .address-copy code {
  padding: 4px 8px;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
}

.text-link { color: var(--accent); font-weight: 500; font-size: 0.85rem; }

.server-row__stats { display: grid; gap: 8px; text-align: right; }

/* ---------- Tags / pills ---------- */

.category-strip, .tag-row { gap: 6px; }

.category-strip a, .tag, .mini-badge, .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.category-strip a:hover { color: var(--text); border-color: var(--border-strong); }

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.status-pill.is-online {
  color: var(--accent);
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
}

.status-pill.is-offline { color: var(--text-3); }

.mini-badge.is-gold { color: var(--gold); background: var(--gold-bg); border-color: rgba(212, 160, 23, 0.25); }

/* ---------- Profile / detail ---------- */

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: end;
}

.profile-hero__main { display: flex; flex-direction: column; gap: 14px; }
.profile-identity { align-items: flex-end; }

.detail-banner {
  height: 180px;
  max-width: 720px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.stats-panel {
  grid-template-columns: repeat(2, 1fr);
  padding: 16px;
  margin: 0;
  background: var(--surface);
}

.address-copy { width: fit-content; max-width: 100%; }

.copy-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.copy-btn:hover { color: var(--accent); border-color: var(--border-strong); }
.copy-btn svg { width: 15px; height: 15px; }

.profile-content, .dashboard-grid, .article-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.fact-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.fact-list dt { color: var(--text-3); font-weight: 500; font-size: 0.85rem; }
.fact-list dd { min-width: 0; overflow-wrap: anywhere; font-size: 0.9rem; }

/* ---------- Tools ---------- */

.tool-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

.tool-card {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tool-card:hover { border-color: var(--border-strong); background: var(--surface-2); }

.tool-result-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

.tool-server-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.tool-facts code {
  display: inline-flex;
  margin: 0 4px 4px 0;
  padding: 3px 6px;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.8rem;
}

.tool-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; }

/* ---------- Forms ---------- */

.stack-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 500;
}

.form-group input, .form-group textarea, .form-group select, textarea[name="admin_note"], textarea[name="message"] {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  transition: border-color 0.15s ease;
}

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

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

.field-hint { color: var(--text-3); font-size: 0.8rem; }

.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; }

.category-check { position: relative; display: block; cursor: pointer; }
.category-check input { position: absolute; inset: 0; opacity: 0; }

.category-check span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.category-check input:checked + span {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
  font-weight: 600;
}

.category-check input:disabled + span { opacity: 0.4; cursor: not-allowed; }

.notice, .empty-state {
  padding: 16px;
  text-align: center;
  color: var(--text-2);
}

.notice--error { color: var(--danger); background: var(--danger-bg); border-color: rgba(239, 68, 68, 0.25); }

.upload-box {
  position: relative;
  min-height: 110px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 20px;
  text-align: center;
  color: var(--text-2);
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.upload-box strong { font-weight: 500; }
.upload-box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.token-box {
  display: block;
  padding: 10px 12px;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* ---------- Vote flow ---------- */

.vote-flow { max-width: 480px; margin: 0 auto; padding-top: 8px; }
.vote-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }

/* ---------- Utilities ---------- */

.button.is-loading { opacity: 0.65; pointer-events: none; }

.page-hero--compact { padding: 36px 0 20px; }

@media (max-width: 1024px) {
  .hero, .profile-hero, .profile-content, .dashboard-grid, .article-grid { grid-template-columns: 1fr; }
  .hero { gap: 24px; }
  .hero-panel { min-height: 240px; }
  .server-row { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
  .server-row__banner { max-width: 360px; }
  .server-row__stats { grid-column: 2; text-align: left; display: flex; gap: 20px; }
}

@media (max-width: 720px) {
  main, .site-footer { width: calc(100% - 28px); }
  .site-header { position: relative; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 16px; min-height: auto; }
  .brand { justify-content: center; }
  .nav { justify-content: center; flex-wrap: wrap; }
  .nav-actions { justify-content: center; }
  .hero, .page-hero, .profile-hero { padding: 32px 0 20px; }
  .search-bar, .filter-panel { flex-direction: column; align-items: stretch; }
  .filter-panel input, .filter-panel select { width: 100%; min-width: 0; }
  .hero-actions, .tool-hero { flex-direction: column; align-items: stretch; }
  .hero-actions .button, .search-bar .button { width: 100%; }
  .hero-panel__stats, .stats-panel { grid-template-columns: 1fr 1fr; }
  .server-row { grid-template-columns: 1fr; padding: 12px; }
  .server-row__banner { max-width: 360px; justify-self: center; }
  .server-row__stats { grid-column: 1; justify-content: space-between; }
  .server-row__identity, .profile-identity { align-items: flex-start; }
  .section-heading, .site-footer { flex-direction: column; align-items: flex-start; }
}