:root {
  color-scheme: dark;
  --bg: #081019;
  --surface: #0e1a27;
  --surface-soft: #111f2e;
  --border: rgba(172, 205, 235, .14);
  --text: #eef7ff;
  --muted: #8da2b5;
  --cyan: #54dff1;
  --green: #58df96;
  --amber: #ffc86b;
  --red: #ff7886;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 80% 8%, rgba(84, 223, 241, .08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
.ambient { display: none; }
.topbar, main, footer { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.topbar {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(84, 223, 241, .45);
  border-radius: 11px;
  color: var(--cyan);
  font-weight: 900;
}
.brand strong, .brand small { display: block; line-height: 1.2; }
.brand strong { letter-spacing: .13em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: .62rem; letter-spacing: .18em; }
.site-nav { display: flex; align-items: center; gap: 5px; }
.site-nav a {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
  transition: 150ms ease;
}
.site-nav a:hover { border-color: var(--border); color: var(--text); }
.site-nav a.active { background: rgba(84, 223, 241, .09); color: var(--cyan); }
.site-nav .admin-entry { border-color: rgba(169,129,255,.26); background: rgba(169,129,255,.07); color: #c7afff; }
.site-nav .admin-entry:hover { border-color: rgba(169,129,255,.52); background: rgba(169,129,255,.12); color: #dbcfff; }
.site-nav .admin-entry.signed-in { border-color: rgba(88,223,150,.34); background: rgba(88,223,150,.08); color: var(--green); }
.admin-lock { margin-right: 5px; font-size: .88rem; }
.server-state { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .82rem; }
.server-state time { padding-left: 10px; border-left: 1px solid var(--border); color: var(--text); }
.pulse, .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.pulse { box-shadow: 0 0 0 0 rgba(88, 223, 150, .55); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(88, 223, 150, 0); } }
.hero { max-width: 790px; padding: 86px 0 54px; }
.eyebrow { margin: 0 0 12px; color: var(--cyan); font-size: .7rem; font-weight: 800; letter-spacing: .18em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 24px; font-size: clamp(3.1rem, 7vw, 6rem); letter-spacing: -.06em; line-height: .98; }
h1 span { color: var(--cyan); }
.server-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(84, 223, 241, .055), transparent 35%), var(--surface);
  box-shadow: 0 26px 90px rgba(0, 0, 0, .25);
}
.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 32px;
  border-bottom: 1px solid var(--border);
}
.server-identity { min-width: 0; flex: 1; }
.server-select-wrap {
  position: relative;
  display: inline-block;
  width: auto;
  max-width: 100%;
}
.server-select-wrap::after {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--cyan);
  border-bottom: 2px solid var(--cyan);
  content: "";
  pointer-events: none;
  transform: translate(-8px, -70%) rotate(45deg);
}
#server-select {
  width: auto;
  max-width: 100%;
  padding: 0 44px 3px 0;
  appearance: none;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.2;
}
#server-select:hover { border-bottom-color: var(--border); }
#server-select option { background: var(--surface); color: var(--text); font-size: 1rem; }
.server-pack-summary { margin: 6px 0 0; color: var(--cyan); font-size: .92rem; font-weight: 700; }
.motd { margin-bottom: 0; color: var(--muted); }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 6px 10px;
  border: 1px solid rgba(88, 223, 150, .24);
  border-radius: 999px;
  background: rgba(88, 223, 150, .07);
  color: var(--green);
  font-size: .72rem;
  font-weight: 800;
}
.status-pill.loading { border-color: var(--border); background: rgba(255,255,255,.03); color: var(--muted); }
.status-pill.loading .status-dot { background: var(--muted); }
.status-pill.offline { border-color: rgba(255,120,134,.28); background: rgba(255,120,134,.07); color: var(--red); }
.status-pill.offline .status-dot { background: var(--red); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  padding: 12px 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  transition: 160ms ease;
}
.button.primary { background: var(--cyan); color: #05242c; font-weight: 800; }
.button.ghost { border-color: var(--border); background: rgba(255,255,255,.025); color: var(--text); }
.button:hover { transform: translateY(-2px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.server-main {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(480px, 1.15fr);
  gap: 18px;
  padding: 24px 32px;
}
.connection-card {
  display: flex;
  min-height: 226px;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(5, 13, 21, .48);
}
.connection-card > span { color: var(--muted); font-size: .92rem; }
.player-roster-card { justify-content: flex-start; }
.player-count-row { margin-top: 12px; }
.player-total { font-size: clamp(2.8rem, 5vw, 3.8rem); line-height: 1; }
.player-total small { color: var(--muted); font-size: .95rem; font-weight: 600; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.metrics article {
  display: flex;
  min-height: 107px;
  flex-direction: column;
  justify-content: space-between;
  padding: 19px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}
.metrics article > span { color: var(--muted); font-size: .84rem; }
.metrics strong { font-size: 2rem; line-height: 1; }
.metrics strong small { color: var(--muted); font-size: .85rem; font-weight: 600; }
.metrics .text-value { font-size: 1.15rem; line-height: 1.2; }
.server-address-value code { color: var(--cyan); font: inherit; overflow-wrap: anywhere; }
.player-avatars { display: flex; min-width: 0; flex-wrap: wrap; gap: 14px; margin-top: 20px; }
.player-entry { width: 58px; min-width: 0; text-align: center; }
.player-avatar {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  place-items: center;
  overflow: hidden;
  border: 2px solid #15283a;
  border-radius: 9px;
  background: #173047;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .22);
  transition: 150ms ease;
}
.player-entry:hover .player-avatar { z-index: 2; transform: translateY(-3px); }
.player-avatar img,
.avatar-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.player-avatar img { z-index: 1; object-fit: cover; image-rendering: pixelated; opacity: 0; transition: opacity 120ms ease; }
.avatar-fallback { display: grid; place-items: center; color: var(--cyan); font-size: .8rem; font-weight: 800; }
.player-avatar.loaded img { opacity: 1; }
.player-avatar.loaded .avatar-fallback { opacity: 0; }
.player-avatar.failed img { display: none; }
.player-avatar.more { color: var(--muted); font-size: .68rem; font-weight: 800; }
.player-name {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  color: var(--muted);
  font-size: .66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-empty { margin: 0; color: var(--muted); font-size: .88rem; }
.playtime-panel {
  margin: 0 32px 24px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(84,223,241,.045), rgba(5,13,21,.6));
}
.playtime-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.playtime-heading h3 { margin-bottom: 0; font-size: 1.35rem; }
.playtime-heading > p { max-width: 430px; margin: 0; color: var(--muted); font-size: .78rem; text-align: right; }
.playtime-chart {
  display: flex;
  min-height: 292px;
  align-items: flex-end;
  gap: 12px;
  overflow-x: auto;
  margin-top: 18px;
  padding: 12px 4px 4px;
  scrollbar-color: rgba(141,162,181,.3) transparent;
}
.playtime-chart.is-empty { min-height: 128px; }
.playtime-entry { min-width: 86px; flex: 1 0 86px; text-align: center; }
.playtime-duration { display: grid; min-height: 34px; place-items: end center; color: var(--cyan); font-size: .67rem; line-height: 1.25; }
.playtime-column { display: flex; height: 166px; align-items: flex-end; justify-content: center; margin-top: 6px; border-bottom: 1px solid var(--border); }
.playtime-bar {
  display: block;
  width: min(48px, 64%);
  min-height: 34px;
  border: 1px solid rgba(84,223,241,.34);
  border-bottom: 0;
  border-radius: 9px 9px 2px 2px;
  background: linear-gradient(180deg, rgba(84,223,241,.96), rgba(84,223,241,.24));
  box-shadow: 0 -8px 26px rgba(84,223,241,.12);
}
.playtime-identity { min-width: 0; padding-top: 14px; }
.playtime-avatar-wrap { position: relative; display: block; width: 48px; margin: 0 auto; }
.playtime-avatar { width: 48px; height: 48px; }
.playtime-identity b, .playtime-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playtime-identity b { margin-top: 7px; font-size: .72rem; }
.playtime-identity small { margin-top: 1px; color: var(--muted); font-size: .62rem; }
.playtime-crown { position: absolute; z-index: 3; top: -20px; left: 50%; color: var(--amber); font-size: 23px; line-height: 1; filter: drop-shadow(0 3px 7px rgba(255,200,107,.42)); transform: translateX(-50%); }
.playtime-entry.rank-1 .playtime-bar { border-color: rgba(255,200,107,.55); background: linear-gradient(180deg, #ffd77f, rgba(255,200,107,.28)); box-shadow: 0 -8px 28px rgba(255,200,107,.18); }
.playtime-entry.rank-1 .playtime-avatar { border-color: rgba(255,200,107,.75); box-shadow: 0 0 0 3px rgba(255,200,107,.09), 0 8px 20px rgba(0,0,0,.3); }
.playtime-entry.rank-1 .playtime-duration { color: var(--amber); }
.playtime-empty { width: 100%; margin: auto; color: var(--muted); text-align: center; }
.backup-panel {
  margin: 24px 32px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(88, 223, 150, .055), rgba(101, 217, 239, .025));
}
.backup-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.backup-heading h3 { margin-bottom: 5px; font-size: 1.35rem; }
.backup-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; border: 1px solid var(--border); border-radius: 14px; }
.backup-metrics article { min-width: 0; padding: 15px 17px; }
.backup-metrics article + article { border-left: 1px solid var(--border); }
.backup-metrics span, .backup-metrics strong { display: block; }
.backup-metrics span { color: var(--muted); font-size: .8rem; }
.backup-metrics strong { margin-top: 5px; overflow-wrap: anywhere; font-size: .9rem; }
.backup-metrics small { color: var(--muted); font-size: .7rem; }
.backup-enabled.enabled { color: var(--green); }
.backup-enabled.waiting { color: var(--cyan); }
.backup-enabled.warning { color: var(--amber); }
.backup-enabled.disabled { color: var(--muted); }
.download-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px) auto;
  gap: 28px;
  align-items: center;
  margin-top: 0;
  padding: 28px 32px;
  border-top: 1px solid var(--border);
  background: rgba(5, 13, 21, .38);
}
.download-panel h3 { margin-bottom: 5px; font-size: 1.35rem; }
.download-panel p:last-child { margin-bottom: 0; color: var(--muted); font-size: .82rem; }
.download-controls label { display: block; color: var(--muted); font-size: .8rem; }
.download-controls select, .pack-choice {
  width: 100%;
  margin: 7px 0 5px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
}
.pack-choice { min-height: 48px; }
.download-button {
  min-width: 128px;
  padding: 13px 17px;
  border-radius: 11px;
  background: var(--cyan);
  color: #05242c;
  font-weight: 800;
  text-align: center;
}
.download-button.disabled { opacity: .45; pointer-events: none; }
.game-page .server-panel { margin-top: 58px; margin-bottom: 80px; }
.hub-main { min-height: calc(100vh - 150px); }
.hub-hero { max-width: 960px; padding: 96px 0 48px; }
.hub-hero h1 {
  margin-bottom: 0;
  font-size: clamp(3.1rem, 6vw, 5rem);
  letter-spacing: -.045em;
  white-space: nowrap;
}
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-bottom: 86px; }
.service-card {
  --service-accent: var(--cyan);
  position: relative;
  display: flex;
  min-height: 340px;
  flex-direction: column;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--service-accent) 8%, transparent), transparent 45%),
    var(--surface);
  box-shadow: 0 24px 75px rgba(0, 0, 0, .22);
  transition: 180ms ease;
}
.service-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--service-accent);
  content: "";
  opacity: .7;
}
.service-card:hover { border-color: color-mix(in srgb, var(--service-accent) 42%, transparent); transform: translateY(-5px); }
.library-service { --service-accent: #d8b36a; }
.service-card-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.service-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--service-accent) 38%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--service-accent) 8%, transparent);
  color: var(--service-accent);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
}
.service-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--service-accent) 28%, transparent);
  border-radius: 999px;
  color: var(--service-accent);
  font-size: .68rem;
  font-weight: 700;
}
.service-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.service-card-copy { margin-top: 38px; }
.service-card-copy .eyebrow { color: var(--service-accent); }
.service-card-copy h2 { margin-bottom: 12px; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.04em; line-height: 1.05; }
.service-card-copy > p:last-child { max-width: 480px; margin-bottom: 0; color: var(--muted); font-size: .9rem; }
.service-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; padding-right: 95px; }
.service-meta span { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; color: #b5c5d3; font-size: .66rem; }
.service-arrow {
  position: absolute;
  right: 28px;
  bottom: 28px;
  color: var(--service-accent);
  font-size: .78rem;
  font-weight: 800;
}
.service-arrow b { margin-left: 7px; font-size: 1.1rem; }
.assistant-panel {
  margin: 24px 0 80px;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
}
.assistant-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.assistant-head h2 { margin-bottom: 0; font-size: 1.65rem; }
.visitor-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(88, 223, 150, .25);
  border-radius: 999px;
  color: var(--green);
  font-size: .72rem;
}
.visitor-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.chat-log {
  display: flex;
  height: 380px;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(5, 13, 21, .52);
  scrollbar-color: rgba(141,162,181,.35) transparent;
}
.chat-message {
  max-width: min(78%, 700px);
  padding: 11px 14px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .9rem;
}
.chat-message.bot { align-self: flex-start; border: 1px solid var(--border); background: var(--surface-soft); }
.chat-message.user { align-self: flex-end; background: var(--cyan); color: #05242c; }
.chat-message.error { align-self: center; color: var(--red); font-size: .8rem; }
.chat-message.typing { color: var(--muted); }
.chat-form {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(5, 13, 21, .52);
}
.chat-form textarea {
  display: block;
  width: 100%;
  min-height: 58px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  line-height: 1.55;
}
.chat-form textarea::placeholder { color: #667b8f; }
.chat-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chat-form-footer span { color: var(--muted); font-size: .7rem; }
.chat-form-footer b { font-weight: 600; }
.chat-form-footer button {
  min-width: 82px;
  padding: 9px 15px;
  border: 0;
  border-radius: 9px;
  background: var(--cyan);
  color: #05242c;
  cursor: pointer;
  font-weight: 800;
}
.chat-form-footer button:disabled { cursor: wait; opacity: .55; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
footer { display: flex; justify-content: space-between; padding: 28px 0 38px; border-top: 1px solid var(--border); color: var(--muted); font-size: .72rem; }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 10px 15px;
  border: 1px solid rgba(88, 223, 150, .32);
  border-radius: 10px;
  background: #102b24;
  color: var(--green);
  opacity: 0;
  transform: translateY(10px);
  transition: 160ms ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
@media (max-width: 900px) {
  .server-main { grid-template-columns: 1fr; }
  .download-panel { grid-template-columns: 1fr 1fr; }
  .download-panel > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .service-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar, main, footer { width: min(100% - 24px, 1120px); }
  .topbar { min-height: 0; flex-wrap: wrap; gap: 13px; padding: 14px 0; }
  .site-nav { display: grid; width: 100%; grid-template-columns: repeat(2, 1fr); }
  .site-nav a { padding: 8px 5px; text-align: center; }
  .server-state > span:nth-child(2) { display: none; }
  .hero { padding: 64px 0 42px; }
  .hub-hero { padding: 66px 0 42px; }
  .hub-hero h1 { font-size: clamp(2.75rem, 14vw, 4rem); white-space: normal; }
  .game-page .server-panel { margin-top: 42px; }
  .panel-head, .server-main, .download-panel { padding-inline: 20px; }
  .panel-head { display: block; }
  .panel-actions { margin-top: 24px; }
  .panel-actions .button { flex: 1; }
  .metrics { grid-template-columns: 1fr; }
  .playtime-panel { margin-inline: 20px; padding: 20px; }
  .playtime-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .playtime-heading > p { text-align: left; }
  .playtime-chart { margin-right: -20px; padding-right: 20px; }
  .backup-panel { margin-inline: 20px; padding: 20px; }
  .backup-heading { align-items: flex-start; flex-direction: column; }
  .backup-metrics { grid-template-columns: 1fr; }
  .backup-metrics article + article { border-top: 1px solid var(--border); border-left: 0; }
  .download-panel { grid-template-columns: 1fr; }
  .download-panel > div:first-child { grid-column: auto; }
  .service-grid { gap: 14px; padding-bottom: 62px; }
  .service-card { min-height: 320px; padding: 22px; }
  .service-card-copy { margin-top: 30px; }
  .service-meta { padding-right: 0; }
  .service-arrow { right: 22px; bottom: 22px; }
  .assistant-panel { padding: 20px; }
  .assistant-head { align-items: flex-start; }
  .visitor-badge { margin-top: 2px; }
  .chat-log { height: 340px; padding: 14px; }
  .chat-message { max-width: 90%; }
  footer { display: block; }
  footer span { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
