@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/IBMPlexSans-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/IBMPlexSans-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/IBMPlexSans-SemiBold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/IBMPlexSans-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/IBMPlexMono-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/IBMPlexMono-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #131417;
  --bg2: #191b20;
  --card: #1e2026;
  --card2: #24272e;
  --line: #2e313a;
  --line2: #3b3f4a;
  --text: #eceef2;
  --muted: #a3a8b3;
  --amber: #f2a93b;
  --amber-hi: #f7b955;
  --amber-press: #d48f22;
  --ink: #1b1306;
  --green: #5fb37a;
  --red: #d9634f;
  --ease-out: cubic-bezier(.165, .84, .44, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --spring-soft: cubic-bezier(.3, 1.3, .5, 1);
  --warm: rgba(224, 179, 90, .20);
  --warm-strong: rgba(255, 236, 196, .38);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px; line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
b { font-weight: 600; }
kbd, code, .mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
kbd { background: var(--card2); border: 1px solid var(--line2); border-radius: 6px; padding: 1px 8px; font-size: 16px; }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgba(19, 20, 23, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { font-weight: 700; font-size: 20px; letter-spacing: .01em; display: inline-block; transition: transform .45s var(--spring); }
.brand:hover { transform: translateY(-2px); }
.pool { margin-left: auto; color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 9px; }
.pool .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); animation: breathe 1.8s ease-in-out infinite; }
.pool.down .dot { background: var(--red); animation: none; }
.who { display: flex; align-items: center; gap: 12px; }
.pool[hidden] + .who { margin-left: auto; }
.who img { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line2); }
.who .name { font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate; -webkit-tap-highlight-color: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-weight: 600; font-size: 16px; line-height: 1.2; cursor: pointer;
  padding: 12px 22px; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--card2); color: var(--text);
  transition: transform .5s var(--spring), background-color .35s var(--ease-out), border-color .35s var(--ease-out), box-shadow .45s var(--ease-out), color .25s;
}
.btn::before { content: ""; position: absolute; left: var(--mx, 50%); top: var(--my, 50%); width: 8px; height: 8px; border-radius: 50%; background: var(--warm); transform: translate(-50%, -50%) scale(0); transition: transform .65s var(--ease-out); z-index: -1; pointer-events: none; }
.btn:hover::before { transform: translate(-50%, -50%) scale(var(--bloom, 60)); }
.btn:hover { transform: translateY(-3px) scale(1.03); border-color: #4a4f5c; box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .7); }
.btn:active { transform: translateY(0) scale(.95); transition-duration: .09s; box-shadow: none; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn.primary::before { background: var(--warm-strong); }
.btn.primary:hover { background: var(--amber-hi); border-color: var(--amber-hi); }
.btn.primary:active { background: var(--amber-press); }
.btn.danger { border-color: #6b3a32; color: #f1b3a7; }
.btn.danger:hover { background: #3a2420; border-color: #8a4a3f; }
.btn.steam { background: #2a2f38; border-color: #48505e; }
.btn.small { padding: 9px 15px; font-size: 15px; }
.btn.wide { --bloom: 120; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled::before { display: none; }
.ripple { position: absolute; left: var(--rx); top: var(--ry); width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 244, 220, .32); transform: translate(-50%, -50%) scale(0); animation: ripple .6s var(--ease-out) forwards; pointer-events: none; z-index: -1; }

/* ---------- hero ---------- */
.hero { padding: 54px 0 26px; }
.hero h1 { font-size: clamp(32px, 5vw, 50px); line-height: 1.1; margin: 0 0 14px; font-weight: 700; letter-spacing: -.01em; }
.lede { font-size: 19px; color: #cfd3da; max-width: 680px; margin: 0 0 8px; }
.lede-note { color: var(--muted); margin: 0; }

/* ---------- panels ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; margin: 26px 0; }
.panel h2, .cat h2 { font-size: 26px; margin: 0 0 6px; font-weight: 600; }
.notice { background: #2b2216; border: 1px solid #5a4422; color: #f2d7a8; border-radius: 12px; padding: 14px 18px; margin: 10px 0 0; animation: rise .5s var(--ease-out) backwards; }
.notice.bad { background: #2c1c19; border-color: #6b3a32; color: #f4c0b5; }

/* ---------- catalog ---------- */
.cat { margin: 38px 0 0; animation: rise .7s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
.cat > p { color: var(--muted); margin: 0 0 16px; max-width: 760px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 8px; min-height: 172px;
  transition: transform .55s var(--spring-soft), border-color .4s var(--ease-out), background-color .4s var(--ease-out), box-shadow .5s var(--ease-out);
  animation: pop .5s var(--spring-soft) backwards; animation-delay: calc(var(--n, 0) * 30ms + 120ms);
}
.card:hover { transform: translateY(-4px); border-color: rgba(224, 179, 90, .4); background: var(--card2); box-shadow: 0 18px 30px -22px rgba(0, 0, 0, .9); }
.card h3 { font-size: 19px; margin: 0; font-weight: 600; line-height: 1.3; }
.card .meta { color: var(--muted); font-size: 15px; margin: 0; }
.card .desc { font-size: 16px; color: #d2d6dd; margin: 0; flex: 1; }
.card .warn { font-size: 15px; color: #e9c58a; margin: 0; }
.card .actions { margin-top: 6px; }
.card .actions .btn { width: 100%; }
.card.off { background: var(--bg2); border-style: dashed; }
.card.off:hover { transform: none; box-shadow: none; border-color: var(--line); background: var(--bg2); }
.card.off h3 { color: #b9bdc6; }
.tag { align-self: flex-start; font-size: 15px; font-weight: 500; color: #c6cad2; background: var(--card2); border: 1px solid var(--line2); border-radius: 999px; padding: 2px 12px; }

/* ---------- my server ---------- */
.mine { margin: 26px 0 0; }
.mine .panel { margin: 0; border-color: #4c3d22; background: linear-gradient(180deg, #221f19, var(--card)); animation: rise .55s var(--ease-out) backwards; }
.mine-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.mine-head h2 { margin: 0; }
.state { font-weight: 600; font-size: 15px; border-radius: 999px; padding: 3px 13px; border: 1px solid var(--line2); background: var(--card2); color: #d6dae1; }
.state.live { border-color: #2f5c3e; background: #1b2b20; color: #9fdcb2; }
.state.live::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: 1px; animation: breathe 1.6s ease-in-out infinite; }
.state.wait { border-color: #5a4422; background: #2b2216; color: #f2d7a8; }
.mine p.sub { color: var(--muted); margin: 4px 0 18px; }
.connect { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin: 6px 0 18px; }
.connect code { flex: 1 1 360px; display: block; background: #111215; border: 1px solid var(--line2); border-radius: 10px; padding: 13px 16px; color: var(--amber-hi); font-size: 17px; overflow-x: auto; white-space: nowrap; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 20px 0 4px; }
.fact { background: rgba(0, 0, 0, .18); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; }
.fact .k { color: var(--muted); font-size: 15px; }
.fact .v { font-weight: 600; font-size: 18px; }
.help { color: var(--muted); font-size: 15px; margin: 10px 0 0; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(242, 169, 59, .25); border-top-color: var(--amber); animation: spin .9s linear infinite; display: inline-block; vertical-align: -3px; margin-right: 10px; }

/* ---------- live ---------- */
.live { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.live h3 { margin: 0 0 10px; font-size: 19px; }
.live .line { color: #d2d6dd; margin: 0 0 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: 16px; }
table.t th { text-align: left; color: var(--muted); font-weight: 500; font-size: 15px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 8px 10px; border-bottom: 1px solid rgba(46, 49, 58, .6); }
table.t tr.out td { color: #8d929c; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }

/* ---------- setup ---------- */
.steps { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.steps li { counter-increment: s; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.steps h3 { margin: 0 0 6px; font-size: 18px; }
.steps h3::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 10px; border-radius: 8px; background: var(--card2); border: 1px solid var(--line2); font-size: 15px; }
.steps p { margin: 0 0 14px; color: #cfd3da; font-size: 16px; }
.mapdl { display: flex; flex-direction: column; gap: 8px; }
.mapdl p { font-size: 15px; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.mapdl .btn { overflow-wrap: anywhere; text-align: center; }

/* ---------- admin ---------- */
.admin h2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.admin h3 { margin: 22px 0 8px; font-size: 18px; }
.admin .scroll { overflow-x: auto; }

/* ---------- footer, toast ---------- */
.foot { color: var(--muted); font-size: 15px; padding: 26px 22px 60px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #24272e; border: 1px solid var(--line2); color: var(--text); padding: 13px 20px; border-radius: 12px; box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .9); z-index: 50; max-width: min(560px, 92vw); animation: toast-in .5s var(--spring) backwards; }
.toast.bad { border-color: #6b3a32; background: #2c1c19; }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(22px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.9); opacity: 0; } 60% { transform: scale(1.02); opacity: 1; } 100% { transform: none; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 18px) scale(.96); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 640px) {
  .top-row { flex-wrap: wrap; gap: 10px; padding: 10px 0; }
  .pool { order: 3; margin-left: 0; width: 100%; }
  .who .name { display: none; }
  .panel { padding: 20px; }
}
