/* minecraftserve.rs — design system. Dark only; there is no light theme. */

/* ---------------------------------------------------------------- tokens */

:root {
  --bg:            #0b0f17;
  --bg-elevated:   #0a0e18;
  --surface:       #12161f;
  --surface-2:     #171c26;
  --surface-3:     #1d2330;
  --border:        #1e2532;
  --border-strong: #2a3242;

  --text:          #ffffff;
  --text-muted:    #a6a7b2;
  --text-dim:      #757885;

  --accent:        #f2615a;
  --accent-hover:  #e34f48;
  --accent-soft:   rgba(242, 97, 90, 0.12);
  --accent-text:   #f67472;

  --green:         #22c55e;
  --amber:         #f59e0b;

  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;
  --radius-xl: 12px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-pop:  0 12px 32px -8px rgba(0, 0, 0, .65), 0 0 0 1px var(--border);

  --header-h: 74px;
  --container: 1284px;
  --gutter: 24px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: dark;
}


/* ------------------------------------------------------------------ base */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-text); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

hr { border: 0; border-top: 1px solid var(--border); margin: 0; }

.icon { width: 20px; height: 20px; flex: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: var(--radius); font-weight: 600; transition: top .15s;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ------------------------------------------------------------- container */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 8px; }

.brand { display: flex; align-items: center; gap: 12px; flex: none; margin-right: 26px; }
.brand:hover { color: inherit; }
.brand img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.brand-name { font-size: 27px; font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.brand-name span { color: var(--accent-text); }

.nav { display: flex; align-items: center; gap: 4px; height: 100%; }
.nav-item { position: relative; height: 100%; display: flex; align-items: center; }

.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 15.5px; font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color .12s, background-color .12s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link .icon { width: 16px; height: 16px; opacity: .85; }

.nav-link.is-active {
  color: var(--text);
  font-weight: 600;
  background: var(--surface-2);
}
/* The coral rule under the active section sits on the header's bottom edge. */
.nav-item.is-active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: color .12s, background-color .12s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn .icon { width: 20px; height: 20px; }

.header-divider { width: 1px; height: 24px; background: var(--border-strong); }

.header-user { display: flex; align-items: center; gap: 10px; }
.header-avatar-btn { width: auto; padding: 0 4px; }
.header-user img, .header-user .avatar { width: 34px; height: 34px; border-radius: 50%; }

/* Dropdown menus (Community, More, account) — click-toggled, no hover traps. */
.menu { position: relative; }
.menu-panel {
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 208px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  z-index: 60;
}
.menu-panel[hidden] { display: none; }
.menu-panel.align-right { left: auto; right: 0; }
.menu-panel a, .menu-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 14.5px; color: var(--text-muted); text-align: left;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); color: var(--text); }
.menu-panel .icon { width: 16px; height: 16px; }
.menu-panel hr { margin: 6px 0; }

.nav-toggle { display: none; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 56px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand { max-width: 320px; }
.footer-brand p { color: var(--text-muted); font-size: 14.5px; margin-top: 14px; }
.footer-col h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--text-muted); font-size: 14.5px; }
.footer-bottom {
  margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  color: var(--text-dim); font-size: 13.5px; flex-wrap: wrap;
}
.footer-bottom nav { display: flex; gap: 20px; }
.footer-legal { display: grid; gap: 4px; }
.footer-credit { font-size: 12px; color: var(--text-dim); }
.footer-credit a { text-decoration: underline; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color .12s, border-color .12s, color .12s, opacity .12s;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn .icon { width: 17px; height: 17px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }

.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-sm { height: 34px; padding: 0 13px; font-size: 14px; border-radius: 5px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 22px 24px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px 0;
}
.card-head h2, .card-head h3 { font-size: 18px; }
.card-link { color: var(--accent-text); font-size: 13px; font-weight: 500; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 10px; flex-wrap: wrap;
}
.section-head h2 { font-size: 22px; }
.section-head .btn { height: 38px; padding: 0 16px; font-size: 13.5px; }
.section-head p { color: var(--text-muted); font-size: 13.5px; margin-top: 4px; }

/* ----------------------------------------------------------------- chips */

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 12px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap;
  transition: background-color .12s, color .12s;
}
a.chip:hover { background: var(--surface-3); color: var(--text); }
.chip.is-active { background: var(--accent); color: #fff; border-color: transparent; }
.chip.is-active:hover { background: var(--accent-hover); color: #fff; }
.chip-sm { height: 26px; padding: 0 8px; font-size: 11px; border-radius: 5px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }

/* ---------------------------------------------------------------- inputs */

.field { display: grid; gap: 7px; }
.field label, .label { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.field .hint { font-size: 13px; color: var(--text-dim); }
.field .error { font-size: 13px; color: #f87171; }

.input, .select, .textarea {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 120px; padding: 11px 14px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a6a7b2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--text-muted); }
.checkbox input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

/* --------------------------------------------------------------- notices */

.notice {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 14.5px;
  color: var(--text-muted);
}
.notice .icon { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.notice-success { border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.09); color: #86efac; }
.notice-error   { border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.09); color: #fca5a5; }
.notice-warn    { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.09); color: #fcd34d; }

/* ------------------------------------------------------- status & rating */

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex: none; }
.status-dot.is-online { background: var(--green); }
.status-dot.is-offline { background: #6b7280; }

.player-count { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); }
.player-count b { color: var(--text); font-weight: 600; }

.stars { display: inline-flex; gap: 2px; }
.stars .star { position: relative; display: block; width: 17px; height: 17px; }
.stars .star svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.stars .star-bg { color: var(--surface-3); }
/* Foreground copy clipped to this star's earned fraction. */
.stars .star-fg {
  position: absolute; top: 0; left: 0;
  height: 100%; width: 0;
  overflow: hidden;
  color: var(--accent);
}
.stars .star.is-half .star-fg { width: 50%; }
.stars .star.is-full .star-fg { width: 100%; }
.stars-lg .star, .stars-lg .star svg { width: 22px; height: 22px; }

.badge-verified { width: 17px; height: 17px; color: var(--accent); flex: none; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px;
  border-radius: 5px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.badge-featured { background: var(--accent); color: #fff; }
.badge-new { background: rgba(242,97,90,.15); color: var(--accent-text); }
.badge-progress { background: rgba(245,158,11,.15); color: var(--amber); }
.badge-muted { background: var(--surface-3); color: var(--text-muted); }

/* ---------------------------------------------------------------- avatar */

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-3);
  object-fit: cover; flex: none;
  image-rendering: pixelated;
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 56px; height: 56px; }

/* --------------------------------------------------------------- utility */

.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.accent { color: var(--accent-text); }
.green { color: var(--green); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stack { display: grid; gap: 16px; }
.mt-auto { margin-top: auto; }

/* ------------------------------------------------------------ pagination */

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 32px; }
.pagination a, .pagination span {
  display: grid; place-items: center;
  min-width: 38px; height: 38px; padding: 0 10px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14.5px; color: var(--text-muted);
}
.pagination a:hover { background: var(--surface-2); color: var(--text); }
.pagination .is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pagination .is-gap { background: none; border: 0; }

/* --------------------------------------------------------------- empty */

.empty {
  display: grid; place-items: center; gap: 12px;
  padding: 60px 24px; text-align: center;
  color: var(--text-muted);
}
.empty .icon { width: 34px; height: 34px; color: var(--text-dim); }
.empty h3 { font-size: 17px; color: var(--text); }

/* -------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; --gutter: 18px; }
  .brand img { width: 38px; height: 38px; border-radius: 9px; }
  .brand-name { font-size: 21px; }
  .brand { margin-right: 0; }
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto;
    flex-direction: column; align-items: stretch; gap: 2px;
    height: auto; padding: 12px var(--gutter) 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 32px -16px rgba(0,0,0,.7);
  }
  .nav[hidden] { display: none; }
  .nav-item { height: auto; display: block; }
  .nav-item.is-active::after { display: none; }
  .nav-link { padding: 12px 14px; font-size: 16px; }
  .menu-panel { position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; background: none; }
  .header-right { gap: 8px; }
  .header-divider { display: none; }
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .section-head h2 { font-size: 21px; }
  .btn { height: 38px; padding: 0 15px; }
}
