@font-face {
  font-family: "Adventure Club";
  src: url("../fonts/AdventureClub.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "Open Sans", ui-sans-serif, system-ui, sans-serif;
  background: url(../ac/background.webp);
  color: #f4f6f8;
  --surface: #666;
  --muted: #aeb3b8;
  --accent: #89b4ff;
  --online: #63e582;
  --offline: #b1b5b9;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; min-height: 100%; }
body { margin: 0; overflow: hidden; background: #111; cursor: default; -webkit-user-select: none; user-select: none; }
button { font: inherit; }
h1, h2, p { margin-top: 0; }
.loading-screen { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; background: #000; opacity: 1; transition: opacity .5s ease; }
.loading-screen.is-complete { opacity: 0; pointer-events: none; }
.loading-content { display: flex; width: min(280px, calc(100vw - 64px)); flex-direction: column; align-items: center; gap: 24px; }
.loading-badge { display: block; width: min(190px, 52vw); aspect-ratio: 400 / 243; object-fit: contain; opacity: 0; transition: opacity .7s ease; }
.loading-badge.is-loaded { opacity: 1; }
.loading-track { width: 100%; height: 1px; overflow: hidden; background: #292929; }
.loading-fill { display: block; width: 0; height: 1px; background: #bcbcbc; transition: width 80ms linear; }
.app-frame {
  position: fixed; z-index: 0; top: 50%; left: 50%; width: 1920px; height: 1080px; aspect-ratio: 16 / 9;
  overflow: hidden; background: #000;
  transform:
    translate(-50%, -50%)
    scale(min(var(--frame-scale, 1), 1.5));
  transform-origin: center center;
  border-radius: 15px; box-shadow: 0 10px 24px rgb(0,0,0);
  border: 1px solid rgb(255 255 255 / 26%);
}

.scene-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center center; pointer-events: none; user-select: none; }
.scene-background { z-index: 0; }
.scene-foreground { z-index: 3; }
.ac-tag { position: absolute; z-index: 4; bottom: 1%; left: 1%; height: auto; pointer-events: none; user-select: none; }
.page-shell {
  position: absolute; z-index: 2; top: 34px; right: 34px; bottom: 34px; display: flex; flex-direction: column;
  width: 60%; margin: 0; padding: 26px 18px 22px;
  overflow: hidden; border: 1px solid rgb(255 255 255 / 26%);
  background: rgb(0 0 0 / 50%); backdrop-filter: blur(16px); border-radius: 10px;
}
.page-header { position: relative; display: block; flex: 0 0 auto; margin-bottom: 24px; text-align: center; }
.page-titles { width: 78%; margin: 0 auto; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; padding-bottom: 7px; border-bottom: 1px solid rgb(255 255 255 / 22%); font-family: "Adventure Club", sans-serif; font-size: 5rem; font-weight: 700; letter-spacing: -.045em; line-height: 1; text-transform: uppercase; }
.page-subtitle { margin: 3px 0 0; color: #aaa; font-size: 2rem; font-weight: 300; letter-spacing: .48em; line-height: 1.4; text-transform: uppercase; }
.page-error { flex: 0 0 auto; padding: 16px; border: 1px solid #733d43; border-radius: 5px; background: #2b1d20; color: #ffb4b4; }

.server-scroll {
  flex: 1 1 0; width: 100%; height: 0; min-height: 0; padding: 12px 24px 46px 22px;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgb(255 255 255 / 28%) transparent; scrollbar-width: thin;
}
.server-scroll::-webkit-scrollbar { width: 7px; }
.server-scroll::-webkit-scrollbar-track { background: transparent; }
.server-scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: rgb(255 255 255 / 28%); }
.server-list {
  display: grid; width: 1054px; max-width: 100%;
  grid-template-columns: repeat(2, 502px); align-content: start; gap: 42px 50px;
  margin: 0 auto; padding: 0; overflow: visible;
}
.server-card {
  position: relative; isolation: isolate; display: grid; width: 502px; max-width: 100%; height: 70px; min-width: 0;
  grid-template-columns: minmax(0, 1fr) 150px; grid-template-rows: 35px 35px;
  padding: 0 11px 0 97px; overflow: visible; border: 0; border-radius: 5px;
  background: var(--surface); box-shadow: 0 10px 24px rgb(0 0 0 / 24%);
  border: 1px solid #666;
}
.server-card.has-banner {
  background: var(--surface);
}
.server-card.has-banner::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background-image: linear-gradient(90deg, rgb(0 0 0 / 75%), rgb(0 0 0 / 50%)), var(--banner);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  content: "";
  pointer-events: none;
  transition: filter 180ms ease;
}
.game-icon {
  position: absolute; z-index: 2; top: -10px; left: -10px; display: grid; width: 90px; height: 90px;
  place-items: center; overflow: visible; border: 0; border-radius: 0;
  background: transparent; color: var(--accent); box-shadow: none; font-size: 1.35rem; font-weight: 800;
}
.game-icon img { width: 100%; height: 100%; object-fit: contain; transition: filter 180ms ease; }
.card-heading { position: relative; z-index: 1; display: flex; min-width: 0; align-items: end; grid-column: 1; grid-row: 1; }
.game-title { display: flex; min-width: 0; align-items: end; }
.game-title h2 { margin: 0; color: #fff; font-size: 1.45rem; font-weight: 500; line-height: 1.15; white-space: nowrap; text-shadow: 0 0 5px rgba(0, 0, 0, 1);}
.server-health { position: relative; z-index: 1; display: flex; min-width: 0; align-items: start; gap: 4px; grid-column: 1; grid-row: 2; padding-top: 3px; font-size: .88rem; white-space: nowrap; text-shadow: 0 0 5px rgba(0, 0, 0, 1); }
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; text-transform: capitalize; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.status-online { color: var(--online); }
.status-offline, .status-pending { color: var(--offline); }
.status-error { color: var(--error); }
.server-actions { position: relative; z-index: 1; display: flex; min-width: 0; flex-direction: column; align-items: end; justify-content: center; gap: 6px; grid-column: 2; grid-row: 1 / 3; }
.server-card.is-offline .address-block,
.server-card.is-offline .connect-button { display: none; }
.server-card.is-offline .game-icon img {
  filter: grayscale(.92) saturate(.12) brightness(.62);
}
.server-card.is-offline.has-banner::before {
  filter: grayscale(.94) saturate(.08) brightness(.58);
}
.address-block { display: flex; align-items: center; padding: 0; border: 0; background: transparent; color: #c6c6c6; cursor: pointer; font-size: .88rem; text-align: right; white-space: nowrap; transform: translateY(-3px); text-shadow: 0 0 5px rgba(0, 0, 0, 1); }
.address-block:hover, .address-block:focus-visible { color: #fff; outline: none; }
.address-port { color: inherit; font-weight: inherit; }
.address-block.is-copied { color: #fff; font-weight: 400; letter-spacing: .08em; }
.copy-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.action-buttons { display: flex; width: max-content; align-items: center; justify-content: end; gap: 6px; }
.connect-button, .download-button { display: inline-flex; width: 93px; height: 20px; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--online); border-radius: 5px; background: rgba(0,0,0,0.5); color: var(--online); cursor: pointer; font-size: .72rem; letter-spacing: .14em; line-height: 18px; text-decoration: none; text-transform: uppercase; box-shadow: 0 0 5px rgba(0, 0, 0, 1); }
.connect-button { gap: 3px; padding-inline: 7px; }
.connect-icon { display: block; width: 13px; height: 13px; flex: 0 0 13px; background-color: currentColor; -webkit-mask: url("/assets/svg/connect.svg") center / contain no-repeat; mask: url("/assets/svg/connect.svg") center / contain no-repeat; }
.connect-button:hover, .connect-button:focus-visible { border-color: #9af0ad; color: #9af0ad; outline: none; }
.download-button { width: 108px; gap: 3px; padding: 0 9px; border-color: #1a9fff; color: #1a9fff; letter-spacing: .08em; }
.download-icon { display: block; width: 13px; height: 13px; flex: 0 0 13px; background-color: currentColor; }
.download-button.is-steam .download-icon { -webkit-mask: url("/assets/svg/steam.svg") center / contain no-repeat; mask: url("/assets/svg/steam.svg") center / contain no-repeat; }
.download-button.is-custom .download-icon { -webkit-mask: url("/assets/svg/other.svg") center / contain no-repeat; mask: url("/assets/svg/other.svg") center / contain no-repeat; }
.download-button:hover, .download-button:focus-visible { border-color: #70c3ff; color: #70c3ff; outline: none; }

.modal[hidden] { display: none; }
.modal { position: absolute; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgb(4 7 10 / 78%); backdrop-filter: blur(5px); }
.modal-dialog { position: relative; width: min(680px, 100%); max-height: min(720px, calc(100% - 40px)); overflow: auto; padding: 30px; border: 1px solid #414b56; border-radius: 14px; background: #1a2028; box-shadow: 0 24px 80px rgb(0 0 0 / 55%); }
.modal-dialog h2 { margin-bottom: 20px; }
.modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: var(--muted); cursor: default; font-size: 1.8rem; line-height: 1; }
.modal-close:hover, .modal-close:focus-visible { color: #fff; outline: none; }
.modal-content { color: #d7dde4; line-height: 1.65; }
body.modal-open { overflow: hidden; }

@media (max-width: 900px) {
  body { overflow: hidden; }
  .app-frame {
    top: 50%; right: auto; bottom: auto; left: 50%;
    width: calc(100vw - 24px);
    width: min(calc(100vw - 24px), calc((100vh - 24px) * 16 / 9));
    height: min(calc(100vh - 24px));
    transform: translate(-50%, -50%); transform-origin: center center;
  }

  .scene-background { object-position: left center; }
  .scene-foreground, .ac-tag { display: none; }
  .page-shell {
    top: 0; right: 0; bottom: 0; left: 0; width: 100%; max-width: none;
    padding: 34px 24px 64px; border: 0; background: rgb(0 0 0 / 50%);
  }
  .page-header { margin-bottom: 24px; }
  .server-list { width: 502px; max-width: 100%; grid-template-columns: minmax(0, 502px); justify-content: center; }
  .game-title h2 { font-size: 1rem; }
  .page-subtitle { font-size: clamp(.82rem, 4vw, 1.1rem); letter-spacing: .32em; }
  h1 { font-size: clamp(2rem, 10vw, 3rem); }
}

@media (max-width: 620px) {
  .page-shell { width: 100%; max-width: none; padding: 30px 10px 56px; }
  .server-scroll { padding: 12px 10px 40px 12px; }
  h1 { font-size: clamp(2rem, 10vw, 3rem); }
  .page-subtitle { font-size: clamp(.82rem, 4vw, 1.1rem); letter-spacing: .32em; }
  .game-title h2 { font-size: 1rem; }
  .server-health { font-size: .86rem; }
  .address-block { font-size: .78rem; }
  .modal-dialog { padding: 24px 20px; }
}

@media (max-width: 430px) {
  .game-title h2 { font-size: 1rem; }
  .server-health { overflow: hidden; font-size: .75rem; }
  .address-block { font-size: .67rem; }
  .connect-button { width: 88px; }
  .download-button { width: 103px; padding-inline: 7px; }
}
