/* FAK LABS — Swiss theme. Inter, hairline grid, #E30613. */

:root {
  --red: #e30613;
  --red-dark: #b3050f;
  --ink: #111;
  --muted: #6f6f6f;
  --paper: #fff;
  --wash: #fafafa;
  --hair: #e5e5e5;
  --green: #15803d;
  --amber: #b45309;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* Never let an author display rule override the hidden attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ---------- top bar ---------- */
.topbar { border-bottom: 1px solid var(--hair); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark { width: 14px; height: 14px; background: var(--red); display: inline-block; }
.brand-name { font-weight: 800; letter-spacing: 0.08em; font-size: 15px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.pill {
  display: inline-flex; align-items: center;
  border: 1px solid var(--hair); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; color: var(--muted);
  background: var(--wash); white-space: nowrap;
}
.pill b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 7px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- hero ---------- */
.hero { padding: 72px 24px 8px; }
.hero h1 {
  font-size: clamp(44px, 7vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 18px 0 16px;
}
.lede { font-size: 18px; color: var(--muted); max-width: 560px; margin: 0 0 36px; }

/* ---------- controls ---------- */
.controls {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 0.7fr;
  border: 1px solid var(--hair);
  background: var(--paper);
}
.field { display: flex; flex-direction: column; padding: 10px 14px 12px; border-right: 1px solid var(--hair); min-width: 0; }
.field:last-child { border-right: 0; }
.field-search { grid-column: span 1; }
.flabel { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.field input, .field select {
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--ink);
  padding: 0; width: 100%; appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236f6f6f' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center; padding-right: 16px; cursor: pointer;
}
.field:focus-within { box-shadow: inset 0 -2px 0 var(--red); }

.meta { font-size: 13px; color: var(--muted); margin: 14px 0 0; font-variant-numeric: tabular-nums; }
.meta .sep { margin: 0 8px; }

/* ---------- list ---------- */
.listsec { padding: 40px 24px 8px; }

.rows-head, .prow {
  display: grid;
  grid-template-columns: 1.6fr 2fr 0.6fr 0.7fr 0.6fr 0.8fr 1.1fr;
  gap: 12px; align-items: center;
}
.rows-head {
  font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); padding: 0 4px 10px; border-bottom: 1px solid var(--ink);
}
.rows-head .num { text-align: right; }

.prow {
  padding: 14px 4px;
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
}
.prow:hover { background: var(--wash); }

.p-loc { display: flex; align-items: center; gap: 10px; min-width: 0; }
.p-flag { font-size: 20px; line-height: 1; }
.p-country { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-city { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.p-type { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 3px; padding: 2px 6px; white-space: nowrap; }

.p-server { display: flex; align-items: center; gap: 8px; min-width: 0; }
.p-server code {
  font-family: var(--mono); font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--wash); border: 1px solid var(--hair);
  padding: 5px 8px; border-radius: 4px; min-width: 0;
}
.iconbtn {
  border: 1px solid var(--hair); background: var(--paper); border-radius: 4px;
  width: 30px; height: 30px; flex: 0 0 auto; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
}
.iconbtn:hover { border-color: var(--ink); color: var(--ink); }
.iconbtn svg { width: 14px; height: 14px; }

.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.p-stats { display: none; }
.stat-l { display: none; }
.ping-good { color: var(--green); }
.ping-ok { color: var(--amber); }
.ping-bad { color: var(--red); }
.ping-na { color: var(--muted); font-weight: 400; }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status.st-inactive i { background: var(--amber); }

.p-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--red); color: #fff; border: 0; border-radius: 4px;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 16px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--red-dark); }
.btn-ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--hair); }
.btn-ghost:hover { border-color: var(--ink); background: var(--paper); }

/* skeleton */
.skel-row { display: grid; grid-template-columns: 1.6fr 2fr 0.6fr 0.7fr 0.6fr 0.8fr 1.1fr; gap: 12px; padding: 18px 4px; border-bottom: 1px solid var(--hair); }
.skel-row span { height: 14px; border-radius: 3px; background: linear-gradient(90deg, #eee 25%, #f7f7f7 50%, #eee 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 64px 0; border-bottom: 1px solid var(--hair); }
.empty strong { font-size: 20px; letter-spacing: -0.01em; }
.empty p { color: var(--muted); }

.error {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid var(--red); background: #fff5f5;
  padding: 18px 20px; margin-bottom: 24px;
}
.error strong { font-size: 16px; }
.error p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* pager */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 32px 0 8px; flex-wrap: wrap; }
.pgbtn {
  min-width: 38px; height: 38px; padding: 0 12px;
  border: 1px solid var(--hair); background: var(--paper); border-radius: 4px;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.pgbtn:hover:not(:disabled) { border-color: var(--ink); }
.pgbtn:disabled { opacity: 0.35; cursor: default; }
.pgbtn.cur { background: var(--ink); color: #fff; border-color: var(--ink); }
.pg-ellipsis { color: var(--muted); padding: 0 4px; }

/* ---------- how ---------- */
.how { padding: 72px 24px; }
.how h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.02em; margin: 0 0 32px; font-weight: 800; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.steps li { padding: 24px 24px 8px 0; border-right: 1px solid var(--hair); margin-right: 24px; }
.steps li:last-child { border-right: 0; margin-right: 0; }
.step-n { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: var(--red); margin-bottom: 12px; }
.steps strong { font-size: 17px; }
.steps p { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.fine { font-size: 13px; color: var(--muted); margin-top: 28px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--hair); margin-top: 40px; }
.footer-in { padding: 40px 24px 48px; display: grid; gap: 10px; }
.fbrand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.08em; font-size: 14px; }
.fnote, .fmore, .fcopy { font-size: 13px; color: var(--muted); margin: 0; }
.fmore a { color: var(--red); font-weight: 600; text-decoration: none; }
.fmore a:hover { text-decoration: underline; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 4px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .rows-head { display: none; }
  .controls { grid-template-columns: 1fr 1fr; }
  .field { border-bottom: 1px solid var(--hair); }
  .field-search { grid-column: span 2; }
  .field:nth-child(odd) { border-right: 1px solid var(--hair); }
  .field:nth-child(even) { border-right: 0; }

  .prow {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "loc status"
      "server server"
      "stats actions";
    row-gap: 12px;
    padding: 18px 2px;
  }
  .p-loc { grid-area: loc; }
  .p-server { grid-area: server; }
  .p-server code { flex: 1; }
  .p-stats { grid-area: stats; display: flex; gap: 14px; align-items: baseline; }
  .p-stats .num { text-align: left; }
  .p-stats .stat-l { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  .d-col-ping, .d-col-uptime, .d-col-votes { display: none; }
  .status { grid-area: status; justify-self: end; }
  .p-actions { grid-area: actions; }
  .d-hide { display: none; }
  .skel-row { grid-template-columns: 1fr 1fr; }
  .skel-row span:nth-child(n+3) { display: none; }
  .steps { grid-template-columns: 1fr; }
  .steps li { border-right: 0; border-bottom: 1px solid var(--hair); margin-right: 0; padding: 20px 0; }
  .hide-sm { display: none; }
}
