:root {
  --bg: #081526;
  --card: #0f1c2d;
  --muted: #a9bdd3;
  --accent: #2ad9ff;
  --accent2: #7df0ff;
  --text: #f1f7ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(60% 60% at 20% 10%, #204a72 0%, transparent 55%),
              radial-gradient(50% 50% at 90% 10%, #0f5f8f 0%, transparent 60%),
              linear-gradient(180deg, #081526, #0a1b2d 55%, #081526 100%);
  z-index: -1;
  filter: saturate(1.32) contrast(1.08);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  filter: saturate(1.32) contrast(1.08);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}

.hero-left h1 {
  font-size: 48px;
  margin: 0 0 12px;
}

.lang-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.lang-switch button {
  background: #121a24;
  border: 1px solid #2c3a4f;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
}

.lang-switch button.active {
  color: #061019;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
}

.subtitle {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 18px;
}

.note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.note.error {
  color: #ff8a8a;
}

.license-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 99999;
  isolation: isolate;
  background: rgba(5, 8, 12, 0.78);
  backdrop-filter: blur(2px);
}

.license-overlay.show {
  display: flex !important;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.license-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: min(1100px, 96vw);
  height: min(84vh, 960px);
  max-height: 88vh;
  background: #101720;
  border: 1px solid #2a3b55;
  border-radius: 18px;
  padding: 20px 20px 16px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(42, 217, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.license-title {
  font-size: 20px;
  font-weight: 700;
}

.license-text {
  background: #0c1219;
  border: 1px solid #1d2838;
  border-radius: 12px;
  padding: 12px;
  color: #c7d5e6;
  white-space: pre-wrap;
  overflow: auto;
  font-size: 13px;
  line-height: 1.4;
  max-height: none;
  flex: 1;
  min-height: 0;
}

.license-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.license-fallback {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2;
}

.license-fallback-box {
  width: min(680px, 92vw);
  background: #101720;
  border: 1px solid #2ad9ff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.license-fallback-title {
  font-size: 20px;
  font-weight: 700;
}

.license-fallback-text {
  color: #c7d5e6;
  font-size: 13px;
  line-height: 1.4;
}

.license-emergency {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100000;
  background: rgba(5, 8, 12, 0.82);
  backdrop-filter: blur(2px);
}

.license-emergency.show {
  display: flex;
}

.license-emergency-box {
  width: min(560px, 92vw);
  background: #101720;
  border: 1px solid #2ad9ff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.license-emergency-title {
  font-size: 20px;
  font-weight: 700;
}

.license-emergency-text {
  color: #c7d5e6;
  font-size: 13px;
  line-height: 1.4;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tags span {
  padding: 6px 10px;
  background: #151d28;
  border: 1px solid #243244;
  border-radius: 999px;
  font-size: 12px;
}

.cta {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.btn {
  text-decoration: none;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #2c3a4f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #061019;
  border: none;
}

.btn.ghost {
  background: #141c26;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.meta a {
  color: var(--accent2);
  text-decoration: none;
}

.hero-card {
  background: var(--card);
  border: 1px solid #243244;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.stat {
  background: #0f151d;
  border: 1px solid #1e2b3a;
  border-radius: 14px;
  padding: 16px 18px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
}

.card-title {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.card-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
}

.cover {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background-image: url("/static/cover.jpg"), linear-gradient(145deg, #2b3442, #1a202b);
  background-size: cover, cover;
  background-position: center;
  background-repeat: no-repeat;
}

.card-text .track {
  font-weight: 700;
  margin-bottom: 6px;
}

.card-text .artist {
  color: var(--muted);
  margin-bottom: 10px;
}

.progress {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.bar {
  height: 6px;
  background: #233041;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #38d2ff, #6ae0ff);
}

.block {
  margin-top: 40px;
  background: #0f151d;
  border: 1px solid #1e2b3a;
  border-radius: 16px;
  padding: 20px 22px;
}

.block h2 {
  margin-top: 0;
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.admin-form input,
.admin-form select {
  background: #111822;
  border: 1px solid #243244;
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.link-cards {
  display: grid;
  gap: 14px;
}

.link-card {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #101720;
  border: 1px solid #1e2b3a;
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: #2d3f55;
}

.icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0b0f14;
}

.icon.discord {
  background: #5865f2;
}

.icon.telegram {
  background: #2aa7e0;
}

.icon.support {
  background: #29c3ff;
}

.link-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.link-sub {
  color: var(--muted);
  font-size: 13px;
}

.donate-row {
  margin-top: 16px;
  background: #101720;
  border: 1px solid #1e2b3a;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.donate-text .link-title {
  margin-bottom: 6px;
}

.donate-btn {
  min-width: 180px;
  padding: 12px 18px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.load-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.load-card {
  background: #101720;
  border: 1px solid #1e2b3a;
  border-radius: 14px;
  padding: 16px 18px;
}

.load-panel {
  display: flex;
  align-items: center;
  gap: 16px;
}

.load-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(#2ad9ff 0%, #1a2635 0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.load-center {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #0f151d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

.load-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.error-page .wrap,
.gate-page .wrap {
  max-width: 100%;
  min-height: 100vh;
  padding: 80px 5vw;
}

.error-page .error-block,
.gate-page .gate-block {
  width: 100%;
  min-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.error-page .cta,
.gate-page .cta {
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .donate-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .donate-btn {
    width: 100%;
  }
}

.install-options .option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.install-options .option-card {
  background: #101720;
  border: 1px solid #1e2b3a;
  border-radius: 14px;
  padding: 16px 18px;
}

.install-options .option-card h3 {
  margin-top: 0;
}

.creators-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.creators-list strong {
  color: var(--text);
}

ul.updates-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 6px;
}

.filter-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-input {
  flex: 1;
  background: #111822;
  border: 1px solid #243244;
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
}

.filter-row .btn {
  white-space: nowrap;
}

ul.updates-list li {
  padding: 10px 0;
  border-bottom: 1px solid #1e2b3a;
  color: var(--muted);
}

ul.updates-list li strong {
  color: var(--text);
  font-weight: 600;
}

ul.updates-list li:last-child {
  border-bottom: none;
}

ul.updates-list::-webkit-scrollbar {
  width: 8px;
}

ul.updates-list::-webkit-scrollbar-thumb {
  background: #233041;
  border-radius: 999px;
}

ol {
  margin: 0;
  padding-left: 20px;
}

code {
  background: #111822;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #243244;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .cta {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-row {
    flex-direction: column;
  }
  .filter-row .btn {
    width: 100%;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .install-options .option-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .load-panel {
    flex-direction: column;
    align-items: flex-start;
  }
}





