:root {
  --bg: #070a11;
  --bg2: #0d1220;
  --panel: rgba(18, 24, 38, 0.92);
  --panel-strong: rgba(24, 31, 49, 0.98);
  --border: rgba(145, 166, 212, 0.18);
  --text: #eef2ff;
  --muted: #aab6d3;
  --accent: #8b5cf6;
  --accent-hover: #9f77ff;
  --accent-2: #4cc9f0;
  --shadow: 0 18px 50px rgba(0,0,0,0.35);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --maxw: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, rgba(139,92,246,0.20), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(76,201,240,0.16), transparent 20%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
p, li { line-height: 1.8; }
.container { width: min(var(--maxw), calc(100% - 32px)); margin: 0 auto; }

.topbar {
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px);
  background: rgba(7,10,17,0.72); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 74px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img,
.hero .brand-main-logo {
  width: 178px !important;
  max-width: 40vw !important;
  height: auto !important;
  display: block;
}

.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.nav a {
  color: var(--muted); font-size: 0.98rem; transition: color 0.2s ease, background 0.2s ease;
  padding: 8px 10px; border-radius: 10px;
}
.nav a:hover, .nav a.active { color: var(--text); background: rgba(255,255,255,0.05); }

.hero { padding: 52px 0 34px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 28px; align-items: center; }

.hero-copy, .hero-side, .panel, .legal-shell, .info-card, .content-card, .link-card {
  background: linear-gradient(180deg, rgba(16,22,35,0.84), rgba(12,18,30,0.92));
  border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: var(--radius-xl);
}
.hero-copy { padding: 36px; }
.hero-side { padding: 28px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; color: var(--accent-2);
  background: rgba(76,201,240,0.08); border: 1px solid rgba(76,201,240,0.18);
  border-radius: 999px; padding: 8px 12px; font-size: 0.9rem; margin-bottom: 18px;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: 1.04; margin: 0 0 16px; letter-spacing: -0.03em; }
h2 { line-height: 1.2; }

.hero p, .section-head p, .muted, .lede { color: var(--muted); }
.hero p { font-size: 1.08rem; max-width: 64ch; }

.hero-actions, .legal-links, .card-actions, .tab-nav { display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 18px; border-radius: 14px; font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  border: 1px solid transparent;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); color: white; box-shadow: 0 10px 26px rgba(139,92,246,0.26); }
.button-secondary { background: rgba(255,255,255,0.03); color: var(--text); border-color: var(--border); }
.button-secondary:hover, .tab-nav a:hover, .tab-nav a.active { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.16); }
.button img, .icon-link img { width: 20px; height: 20px; object-fit: contain; display: block; }

.hero-side ul, .clean-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.hero-side li, .clean-list li {
  color: var(--muted); background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px; padding: 14px 16px;
}

section { padding: 28px 0 12px; }
.section-head { margin-bottom: 22px; }
.section-head h2 { margin: 0 0 10px; font-size: clamp(1.7rem, 3vw, 2.35rem); }

.games-grid, .card-grid, .link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.game-card, .link-card {
  background: linear-gradient(180deg, rgba(18, 24, 38, 0.94), rgba(11, 16, 27, 0.98));
  border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}

.game-visual {
  display: grid; place-items: center; min-height: 220px; padding: 28px;
  background: radial-gradient(circle at top, rgba(139,92,246,0.18), transparent 40%), linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.game-visual img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: none !important;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,0.28));
}
.game-visual img.logo-wide,
.game-visual img.logo-gloomvex {
  max-width: 220px !important;
  max-height: 94px !important;
}
.game-visual img.logo-square,
.game-visual img.logo-gleam {
  max-width: 118px !important;
  max-height: 118px !important;
}

.game-body, .link-card-body { padding: 24px; display: flex; flex-direction: column; gap: 18px; height: 100%; }
.game-body h3, .link-card-body h3 { margin: 0; font-size: 1.45rem; }
.game-body p, .link-card-body p { margin: 0; color: var(--muted); }

.tag-row { display: flex; gap: 10px; flex-wrap: wrap; }
.tag {
  display: inline-flex; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06); color: #d7dff3; font-size: 0.9rem;
}

.page-hero { padding: 42px 0 24px; }
.page-hero-inner {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: stretch;
}
.page-head, .page-side { padding: 30px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3.3rem); margin-bottom: 14px; }

.project-logo {
  width: auto !important;
  height: auto !important;
  max-width: 300px !important;
  max-height: 128px !important;
  object-fit: contain;
  display: block;
  margin-bottom: 18px;
  filter: drop-shadow(0 16px 24px rgba(0,0,0,0.3));
}
.project-logo.logo-square,
.project-logo.logo-gleam {
  max-width: 118px !important;
  max-height: 118px !important;
}
.project-logo.logo-gloomvex {
  max-width: 220px !important;
  max-height: 94px !important;
}

.tab-nav { margin-top: 18px; }
.tab-nav a {
  padding: 11px 14px; border-radius: 12px; color: var(--text); background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  font-weight: 700;
}

.legal-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; padding-bottom: 42px; }
.legal-shell { padding: 22px; align-self: start; position: sticky; top: 92px; }
.legal-shell h3 { margin: 0 0 14px; font-size: 1rem; }

.side-nav { display: grid; gap: 10px; }
.side-nav a {
  padding: 12px 14px; border-radius: 12px; color: var(--muted); background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); font-weight: 700;
}
.side-nav a:hover, .side-nav a.active { color: var(--text); background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); }

.content-card { padding: 34px; }
.content-card h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 10px; }
.content-card h2 { margin-top: 30px; margin-bottom: 12px; font-size: 1.15rem; }
.content-card p, .content-card li { color: var(--muted); }
.content-card ul { padding-left: 22px; }
.content-card .muted, .content-card .meta { color: var(--muted); margin-bottom: 20px; }
.content-card .box {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px; padding: 22px; margin-bottom: 18px;
}
.content-card .box h2 { margin-top: 0; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a:hover { color: var(--text); }

.footer-box {
  background: rgba(11,16,27,0.75); border: 1px solid rgba(255,255,255,0.06); border-radius: 18px;
  padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
footer { padding: 36px 0 54px; color: var(--muted); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--text); }

@media (max-width: 960px) {
  .hero-grid, .games-grid, .card-grid, .link-grid, .page-hero-inner, .legal-layout { grid-template-columns: 1fr; }
  .legal-shell { position: static; }
}

@media (max-width: 900px) {
  .topbar-inner { min-height: unset; padding: 14px 0; align-items: flex-start; flex-direction: column; }
  .nav { justify-content: flex-start; }
  .hero-copy, .hero-side, .page-head, .page-side, .content-card, .legal-shell { padding: 24px; }
}

@media (max-width: 520px) {
  .container { width: min(var(--maxw), calc(100% - 20px)); }
  .brand img,
  .hero .brand-main-logo { width: 128px !important; max-width: 48vw !important; }
  .button, .card-actions .button { width: 100%; }
  .game-body, .link-card-body { padding: 20px; }
  .game-visual { min-height: 180px; padding: 22px; }
  .game-visual img.logo-wide,
  .game-visual img.logo-gloomvex,
  .project-logo.logo-gloomvex { max-width: 200px !important; max-height: 86px !important; }
  .game-visual img.logo-square,
  .game-visual img.logo-gleam,
  .project-logo.logo-square,
  .project-logo.logo-gleam { max-width: 104px !important; max-height: 104px !important; }
}
