:root {
  color-scheme: dark;
  --bg: #020407;
  --panel: rgba(5, 7, 12, 0.74);
  --panel2: rgba(10, 15, 28, 0.82);
  --text: #f3f8ff;
  --muted: #7d828d;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #18f0ff;
  --accent2: #8e5cff;
  --button: #18f0ff;
  --buttonText: #001014;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 50% 20%, rgba(24, 240, 255, .07), transparent 32%), var(--bg);
}
body.modal-open {
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(24, 240, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 240, 255, .045) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 36%, black, transparent 76%);
}

.cursor-glow {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  translate: -50% -50%;
  background: radial-gradient(circle, rgba(24, 240, 255, .12), transparent 64%);
  mix-blend-mode: screen;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  padding: 15px 18px;
  border: 1px solid rgba(24, 240, 255, .28);
  border-radius: 14px;
  color: var(--text);
  background: rgba(2, 5, 10, .92);
  box-shadow: 0 18px 60px rgba(0,0,0,.36), 0 0 26px rgba(24, 240, 255, .14);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: .22s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1, 4, 8, .68);
  backdrop-filter: blur(18px);
  animation: pageIn .18s ease both;
}
.modal-card {
  width: min(480px, 100%);
  padding: 28px;
  border: 1px solid rgba(24, 240, 255, .24);
  border-radius: 18px;
  text-align: center;
  background: rgba(3, 8, 16, .94);
  box-shadow: 0 28px 90px rgba(0,0,0,.48), 0 0 42px rgba(24, 240, 255, .12);
}
.modal-card h2 {
  margin-bottom: 10px;
  font-size: 32px;
}
.modal-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}
.modal-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1420px, calc(100% - 48px));
  margin: 16px auto 0;
  padding: 8px 12px 8px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(2, 3, 6, .82);
  backdrop-filter: blur(18px);
}

.brand, .topbar nav, .top-actions, .server-strip, .footer-brand {
  display: flex;
  align-items: center;
}
.brand { gap: 10px; font-weight: 900; }
.brand img, .footer-brand img { width: 30px; height: 30px; image-rendering: pixelated; }
.topbar nav { gap: 42px; color: var(--muted); font-weight: 800; }
.topbar nav a.active, .topbar nav a:hover { color: var(--text); }
.top-actions { gap: 8px; }
.theme-dot, .login-link, .download-cta {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  background: rgba(255,255,255,.02);
  color: var(--text);
  font-weight: 900;
}
.theme-dot {
  width: 48px;
  height: 48px;
  padding: 0;
}
.theme-dot::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  margin: auto;
  border-radius: 999px;
  background: white;
  box-shadow: 0 0 14px white;
}
.download-cta, .primary {
  border: 0;
  background: linear-gradient(135deg, var(--button), #39ffcf);
  color: var(--buttonText);
  box-shadow: 0 0 32px rgba(24, 240, 255, .22);
}

main {
  width: min(1180px, calc(100% - 32px));
  min-height: 710px;
  margin: 0 auto;
}
.page { display: none; animation: pageIn .25s ease both; }
.page.active { display: block; }

.center-hero, .page-center, .auth-card {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}
.center-hero { padding: 190px 0 52px; }
.page-center { padding: 126px 0 28px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 10px;
  font-size: clamp(40px, 8vw, 76px);
  letter-spacing: 0;
}
.hero-subtitle, .page-center p, .auth-card p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}
.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 30px 0;
}
.primary, .ghost {
  border-radius: 12px;
  padding: 16px 24px;
  font-weight: 900;
}
.ghost {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
  color: var(--text);
}
.wide { width: 100%; }
.download-buttons {
  display: grid;
  gap: 12px;
  width: 100%;
}
.download-buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.server-strip {
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
}
.server-strip div, .mini-card, .products article, .list-page article, .auth-card, .admin-panel, footer {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
}
.server-strip div {
  min-width: 170px;
  padding: 14px 16px;
  border-radius: 12px;
  text-align: left;
}
.server-strip span, .mini-card span, .products span, .list-page span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.card-row, .products, .list-page {
  display: grid;
  gap: 14px;
}
.card-row { grid-template-columns: repeat(3, 1fr); }
.products { grid-template-columns: repeat(4, 1fr); }
.list-page { grid-template-columns: 1fr; max-width: 820px; margin: 0 auto; }
.mini-card, .products article, .list-page article {
  min-height: 158px;
  padding: 20px;
  border-radius: 16px;
  transition: transform .2s ease, border-color .2s ease;
}
.mini-card:hover, .products article:hover, .list-page article:hover {
  transform: translateY(-4px);
  border-color: rgba(24, 240, 255, .42);
}
.mini-card h2, .products h2, .list-page h2 {
  margin-bottom: 8px;
}
.mini-card p, .products p, .list-page p {
  color: var(--muted);
  line-height: 1.5;
}
.products button {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  background: rgba(255,255,255,.03);
}

.auth-card {
  margin-top: 142px;
  padding: 32px;
  border-radius: 18px;
}
.auth-card form, .admin-panel {
  display: grid;
  gap: 14px;
}
.auth-card form {
  margin-top: 26px;
  text-align: left;
}
.auth-card label, .admin-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}
.auth-card input, .admin-panel input, .admin-panel textarea, .admin-panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px;
  color: var(--text);
  background: rgba(255,255,255,.025);
  outline: none;
}
.admin-panel textarea {
  min-height: 150px;
  resize: vertical;
}
.auth-card input:focus, .admin-panel input:focus, .admin-panel textarea:focus, .admin-panel select:focus {
  border-color: rgba(24, 240, 255, .45);
}
.profile-card {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  text-align: left;
}
.profile-card h2 {
  margin-bottom: 2px;
}
.profile-card p {
  margin: 0;
}
.download-card img {
  width: 78px;
  height: 78px;
  image-rendering: pixelated;
  margin-bottom: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 16px;
  align-items: start;
}
.admin-panel {
  padding: 22px;
  border-radius: 16px;
}
.accounts-list {
  display: grid;
  gap: 10px;
}
.account-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 140px minmax(150px, 1fr) auto auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}
.account-row span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}
.account-row button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255,255,255,.03);
}
.account-actions, .history-list {
  display: grid;
  gap: 10px;
}
.confirm-box {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid rgba(24, 240, 255, .22);
  border-radius: 12px;
  background: rgba(24, 240, 255, .045);
}
.confirm-box p {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}
.history-list {
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}
.history-list p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
}
.account-row button:disabled {
  opacity: .4;
  cursor: default;
}
.download-card button:disabled {
  opacity: .7;
  cursor: default;
}

footer {
  width: min(1420px, calc(100% - 48px));
  margin: 58px auto 24px;
  padding: 24px;
  border-radius: 18px;
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.footer-columns div {
  display: grid;
  gap: 8px;
}
.footer-columns a, .footer-columns span {
  color: var(--muted);
}
.footer-brand {
  gap: 10px;
  padding-top: 24px;
  font-weight: 900;
}

.mobile-nav {
  display: none;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .topbar nav { display: none; }
  .topbar { width: min(100% - 24px, 1420px); }
  .login-link { display: none; }
  body { padding-bottom: 78px; }
  .center-hero { padding-top: 96px; }
  .server-strip, .hero-buttons { flex-direction: column; }
  .server-strip div, .primary, .ghost { width: 100%; }
  .card-row, .products, .footer-columns, .admin-grid { grid-template-columns: 1fr; }
  .account-row { grid-template-columns: 1fr; }
  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(24, 240, 255, .18);
    border-radius: 18px;
    background: rgba(2, 5, 10, .92);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 50px rgba(0,0,0,.34), 0 0 28px rgba(24, 240, 255, .12);
  }
  .mobile-nav a {
    display: grid;
    place-items: center;
    min-height: 46px;
    border-radius: 13px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }
  .mobile-nav a.active {
    color: var(--buttonText);
    background: linear-gradient(135deg, var(--button), #39ffcf);
  }
}
