:root {
  color-scheme: dark;
  --bg: #08111d;
  --bg-2: #101a2a;
  --panel: rgba(16, 27, 43, .76);
  --panel-strong: rgba(20, 34, 53, .92);
  --line: rgba(180, 217, 255, .22);
  --line-strong: rgba(211, 236, 255, .44);
  --ink: #eff7ff;
  --muted: #9fb5c9;
  --rust: #ff7b35;
  --rust-soft: #ffb86c;
  --asa: #31e0c3;
  --asa-soft: #83f7df;
  --ase: #8fc7ff;
  --ase-soft: #c7e3ff;
  --green: #64f08f;
  --red: #ff6b7b;
  --shadow: rgba(0, 0, 0, .34);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "MiSans", "HarmonyOS Sans SC", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 6%, rgba(255, 123, 53, .24), transparent 32rem),
    radial-gradient(circle at 88% 8%, rgba(49, 224, 195, .20), transparent 30rem),
    radial-gradient(circle at 50% 115%, rgba(80, 112, 255, .22), transparent 34rem),
    linear-gradient(140deg, #060b13 0%, #0b1523 46%, #101724 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 20%, #000, transparent 78%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0 70%, rgba(0,0,0,.32));
}
body.modal-open { overflow: hidden; }

button, input { font: inherit; }
button {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, opacity .16s ease;
}
button:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(255,255,255,.68); box-shadow: 0 12px 30px rgba(0,0,0,.24); }
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { cursor: not-allowed; opacity: .55; }
code {
  padding: 2px 7px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #dffcff;
}

.particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.page-shell {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px) 0 62px;
}
.glass-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(17, 30, 48, .78), rgba(13, 22, 36, .66));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px var(--shadow), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
}
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,.13), transparent 28%, transparent 70%, rgba(255,255,255,.05));
  opacity: .72;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--asa-soft);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: clamp(20px, 5vw, 52px);
  align-items: center;
  min-height: 390px;
  padding: clamp(26px, 5vw, 56px);
}
.hero::after {
  content: "ARK / RUST";
  position: absolute;
  right: clamp(18px, 5vw, 50px);
  bottom: -18px;
  font-size: clamp(56px, 12vw, 150px);
  font-weight: 1000;
  letter-spacing: -.08em;
  color: rgba(255,255,255,.045);
  pointer-events: none;
}
.hero-main { position: relative; z-index: 1; }
h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(42px, 8vw, 96px);
  line-height: .9;
  letter-spacing: -.07em;
}
.hero-copy {
  margin: 22px 0 0;
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.75;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 28px; }
.hero-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 950;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.hero-actions a:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.7); box-shadow: 0 14px 36px rgba(0,0,0,.24); }
.hero-primary { background: linear-gradient(135deg, var(--rust), #ff4f72); }
.hero-secondary { background: linear-gradient(135deg, rgba(49,224,195,.22), rgba(255,255,255,.08)); }
.hero-status {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 24px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.055);
  text-align: center;
}
.status-orb {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff, var(--asa-soft) 28%, rgba(49,224,195,.2) 62%, transparent 70%);
  box-shadow: 0 0 30px rgba(49,224,195,.54);
}
.hero-status span:not(.status-orb) { color: var(--muted); font-size: 13px; font-weight: 850; }
.hero-status strong { font-size: 38px; }
.hero-status small { color: var(--muted); }

.gate-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, .95fr);
  gap: 24px;
  align-items: center;
  margin-top: 20px;
  padding: clamp(20px, 3vw, 30px);
  border-color: rgba(49, 224, 195, .24);
}
.gate-panel.is-authenticated { border-color: rgba(100, 240, 143, .45); box-shadow: 0 26px 90px rgba(26, 204, 146, .11), 0 24px 80px var(--shadow); }
.gate-copy, .gate-form { position: relative; z-index: 1; }
.gate-copy h2 { margin: 0 0 10px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.04em; }
.gate-copy p:last-child { margin: 0; color: var(--muted); line-height: 1.75; }
.gate-form { display: grid; gap: 14px; }
.secret-field { display: grid; gap: 8px; color: var(--muted); font-weight: 900; }
.secret-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  outline: 0;
  background: rgba(255,255,255,.08);
  color: var(--ink);
  font-weight: 850;
}
.secret-field input:focus { border-color: var(--asa-soft); box-shadow: 0 0 0 4px rgba(49,224,195,.12); }
.auth-status-card { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.auth-status-card div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  background: rgba(255,255,255,.06);
}
.auth-status-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; }
.auth-status-card strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.gate-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.gate-actions button { min-height: 46px; padding: 11px 17px; font-weight: 950; }
.gate-submit { background: linear-gradient(135deg, var(--asa), #37a5ff); color: #041019; }
.gate-cancel { background: rgba(255, 107, 123, .12); color: #ffd3d9; border-color: rgba(255, 107, 123, .5); }
.gate-status { color: var(--muted); line-height: 1.55; }

.toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
  padding: 14px;
}
.filters { display: flex; gap: 9px; flex-wrap: wrap; }
.filter-button, .refresh-button { min-height: 42px; padding: 9px 16px; font-weight: 900; }
.filter-button.active { background: rgba(255,255,255,.92); color: #07111d; }
.refresh-button { background: rgba(49, 224, 195, .13); }
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: var(--muted);
  font-weight: 900;
}
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-box input::placeholder { color: rgba(159,181,201,.7); }

.notice-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
}
.notice-strip div { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.notice-strip b {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: var(--ink);
  font-size: 12px;
}

.server-section { margin-top: 34px; }
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0 4px 16px;
}
.section-title span { font-size: clamp(24px, 3vw, 34px); font-weight: 1000; letter-spacing: -.04em; }
.section-title em { color: var(--muted); font-style: normal; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); gap: 18px; }
.rust-grid { grid-template-columns: minmax(285px, 560px); }
.server-card { min-height: 310px; padding: 20px; isolation: isolate; }
.server-card[data-accent="rust"] { border-color: rgba(255, 123, 53, .28); }
.server-card[data-accent="asa"] { border-color: rgba(49, 224, 195, .26); }
.server-card[data-accent="ase"] { border-color: rgba(143, 199, 255, .28); }
.server-card.hidden, .auth-hidden { display: none !important; }
.server-card.offline { opacity: .62; filter: grayscale(.32); }
.card-glow {
  position: absolute;
  inset: auto -45px -70px auto;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(49,224,195,.2);
  filter: blur(20px);
}
.server-card[data-accent="rust"] .card-glow { background: rgba(255,123,53,.22); }
.server-card[data-accent="ase"] .card-glow { background: rgba(143,199,255,.2); }
.card-head { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 14px; }
.game-label { margin: 0 0 5px; color: var(--muted); font-size: 12px; font-weight: 950; letter-spacing: .14em; }
h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.subtitle { margin: 6px 0 0; color: var(--muted); }
.status-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  align-self: flex-start;
  padding: 7px 10px;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  font-size: 13px;
  font-weight: 900;
}
.status-pill i { width: 10px; height: 10px; border-radius: 50%; background: #777f8c; box-shadow: 0 0 0 4px rgba(119,127,140,.14); }
.status-pill.online i { background: var(--green); box-shadow: 0 0 0 4px rgba(100,240,143,.17), 0 0 18px rgba(100,240,143,.55); }
.tag-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.tag-row span { padding: 6px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(255,255,255,.07); color: var(--muted); font-size: 13px; font-weight: 850; }
.server-meta { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.server-meta div { padding: 11px; border: 1px solid rgba(255,255,255,.13); border-radius: 16px; background: rgba(255,255,255,.055); }
dt { color: var(--muted); font-size: 12px; font-weight: 900; }
dd { margin: 4px 0 0; font-weight: 950; overflow-wrap: anywhere; }
.card-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.join-button, .copy-button { flex: 1; min-height: 44px; padding: 10px 12px; font-weight: 950; }
.server-card[data-accent="rust"] .join-button { background: linear-gradient(135deg, var(--rust), #ff4f72); }
.server-card[data-accent="asa"] .join-button { background: linear-gradient(135deg, var(--asa), #37a5ff); color: #041019; }
.server-card[data-accent="ase"] .join-button { background: linear-gradient(135deg, var(--ase), #7f7cff); color: #041019; }
.copy-button { background: rgba(255,255,255,.08); }
.copy-address-button { flex: 1 1 100%; min-height: 40px; padding: 9px 12px; background: rgba(255,255,255,.05); border-style: dashed; font-weight: 900; }
.feedback { min-height: 19px; margin: 11px 0 0; color: var(--muted); font-size: 13px; }

.help-panel { margin-top: 28px; padding: 18px 20px; }
.help-panel summary { cursor: pointer; font-weight: 950; font-size: 18px; }
.help-panel ul { margin: 12px 0 0; padding-left: 22px; color: var(--muted); line-height: 1.9; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translate(-50%, 18px);
  max-width: min(560px, calc(100% - 32px));
  padding: 12px 17px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(12, 21, 35, .92);
  color: var(--ink);
  box-shadow: 0 18px 55px rgba(0,0,0,.42);
  backdrop-filter: blur(16px);
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.announcement-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 6, 12, .56);
  backdrop-filter: blur(10px);
}
.announcement-modal.hidden { display: none; }
.announcement-card { width: min(640px, 100%); padding: clamp(24px, 4vw, 36px); }
.announcement-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 25px;
  line-height: 1;
  font-weight: 950;
  background: rgba(255,255,255,.08);
}
.announcement-card h2 { position: relative; z-index: 1; margin: 4px 42px 12px 0; font-size: clamp(30px, 5vw, 46px); line-height: 1.02; letter-spacing: -.05em; }
.announcement-copy, .announcement-note, .announcement-actions { position: relative; z-index: 1; }
.announcement-copy { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.8; }
.secret-hint { margin-top: 8px; }
.announcement-copy strong { color: var(--ink); }
.announcement-actions { display: flex; margin-top: 24px; }
.announcement-enter { width: 100%; min-height: 48px; padding: 11px 18px; background: linear-gradient(135deg, var(--asa), #37a5ff); color: #041019; font-weight: 950; }
.announcement-note { margin: 15px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-status { justify-items: start; text-align: left; }
  .gate-panel { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .notice-strip { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .page-shell { width: min(100% - 20px, 1220px); }
  .hero-actions a { flex: 1 1 180px; }
  .auth-status-card, .server-meta { grid-template-columns: 1fr; }
  .card-head, .section-title { align-items: flex-start; flex-direction: column; }
  .card-actions { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .particle-canvas { display: none; }
  * { scroll-behavior: auto !important; transition: none !important; }
}
