:root {
  --bg: #0b0d14;
  --bg-elev: #131722;
  --bg-card: #161b28;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ink: #f5f6fa;
  --muted: #9da4b8;
  --accent: #ffbf3c;
  --accent-ink: #11131a;
  --accent-soft: rgba(255, 191, 60, 0.14);
  --emerald: #40d4a0;
  --emerald-soft: rgba(64, 212, 160, 0.14);
  --radius: 16px;
  --max: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(ellipse 80% 45% at 50% -10%, #1d243b 0%, var(--bg) 65%);
  background-color: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(11, 13, 20, 0.86);
  border-bottom: 1px solid var(--border);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 800;
  font-size: 16.5px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; opacity: 0.92; }
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-links a {
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  transition: color 0.15s ease;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--ink);
  text-decoration: none;
}
.nav-links a.nav-play-pill {
  background: var(--emerald-soft);
  color: #6be7bc;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(64, 212, 160, 0.3);
}
.nav-links a.nav-play-pill:hover, .nav-links a.nav-play-pill.active {
  background: var(--emerald);
  color: #0b1310;
}

/* Language Switcher */
.lang-wrap {
  position: relative;
}
.lang-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--ink);
  font: 600 13px/1 inherit;
  cursor: pointer;
}
.lang-btn:hover { border-color: rgba(255,255,255,0.32); }
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: 310px;
  max-height: 380px;
  overflow-y: auto;
  background: #141926;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  z-index: 60;
}
.lang-wrap.open .lang-menu { display: grid; }
.lang-menu a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #cfd5e6;
  font-weight: 500;
}
.lang-menu a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  text-decoration: none;
}
.lang-menu a.current {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

/* Hero */
.hero {
  padding: 58px 0 36px;
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.eyebrow.portal {
  background: var(--emerald-soft);
  color: #6be7bc;
}
.hero h1 {
  margin: 0 auto 14px;
  max-width: 820px;
  font-size: clamp(30px, 4.8vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.hero p {
  margin: 0 auto 26px;
  max-width: 640px;
  color: var(--muted);
  font-size: 17px;
}

/* Filter bar */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 34px;
}
.filter-btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--muted);
  padding: 9px 18px;
  border-radius: 999px;
  font: 600 14px/1 inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-btn:hover { color: var(--ink); border-color: rgba(255,255,255,0.3); }
.filter-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* Sections */
.section { padding: 18px 0 54px; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.section-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.section-head span { color: var(--muted); font-size: 14.5px; }

/* Game Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.grid.portal-live {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  color: inherit;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  text-decoration: none;
}
.card.portal-featured {
  border-color: rgba(64, 212, 160, 0.28);
  background: linear-gradient(180deg, rgba(64, 212, 160, 0.06), var(--bg-card) 42%);
}
.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #10131d;
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.card:hover .card-media img { transform: scale(1.03); }
.pill-float {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.pill-float.live {
  background: rgba(16, 185, 129, 0.9);
  color: #062118;
}
.pill-float.soon {
  background: rgba(11, 13, 20, 0.8);
  color: #cbd1e3;
  border: 1px solid rgba(255,255,255,0.16);
}
.card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card-body h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.card-body p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd1e3;
}
.badge.web { background: var(--emerald-soft); color: #6be7bc; }

/* Portal Player Stage */
.player-section { padding: 28px 0 56px; }
.player-shell {
  background: #0d1019;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.player-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.player-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.player-title img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}
.player-title h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}
.player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tool-btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  padding: 8px 13px;
  border-radius: 10px;
  font: 600 13px/1 inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tool-btn:hover { background: rgba(255, 255, 255, 0.12); text-decoration: none; }
.player-stage {
  background: #05070c;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}
.player-frame-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 78vh;
  transition: max-width 0.2s ease, aspect-ratio 0.2s ease;
}
.player-frame-wrap.portrait {
  max-width: 440px;
  aspect-ratio: 9 / 16;
  max-height: 82vh;
  margin: 16px auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
}
.player-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}
.player-foot {
  padding: 18px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* About strip */
.about-box {
  background: linear-gradient(135deg, rgba(255,191,60,0.08), rgba(22,27,40,0.9) 45%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: center;
}
.about-box h2 { margin: 0 0 12px; font-size: 26px; letter-spacing: -0.02em; }
.about-box p { margin: 0 0 12px; color: var(--muted); }
.about-box p:last-child { margin-bottom: 0; }
.contact-card {
  background: rgba(11, 13, 20, 0.65);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.contact-card h3 { margin: 0 0 8px; font-size: 17px; }
.contact-card p { font-size: 14px; margin-bottom: 14px; }

/* Buttons */
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 19px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:hover { transform: translateY(-1px); opacity: 0.94; text-decoration: none; }
.btn.primary, .btn.play { background: var(--accent); color: var(--accent-ink); }
.btn.emerald { background: var(--emerald); color: #062118; }
.btn.ios { background: #ffffff; color: #11131a; }
.btn.secondary, .btn.web {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border: 1px solid var(--border-strong);
}

/* Game Detail Page */
.game-hero { padding: 44px 0 64px; }
.game-layout {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 36px;
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px;
}
.game-art {
  border-radius: 16px;
  overflow: hidden;
  background: #10131d;
  border: 1px solid var(--border);
}
.game-art img { width: 100%; height: auto; object-fit: cover; }
.game-info h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.game-info .lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16.5px;
}
.game-meta {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13.5px;
  color: var(--muted);
}

/* Prose / Legal pages */
.prose-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 44px 24px 72px;
}
.prose {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 40px;
}
.prose h1 { margin: 0 0 16px; font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; }
.prose h2 { margin: 28px 0 10px; font-size: 20px; color: var(--ink); }
.prose h3 { margin: 22px 0 8px; font-size: 17px; color: var(--ink); }
.prose p, .prose li { color: #cfd5e6; font-size: 15.5px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: 13.5px;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

@media (max-width: 820px) {
  .about-box, .game-layout { grid-template-columns: 1fr; padding: 24px; }
  .prose { padding: 24px 20px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 13.5px; }
  .brand span { display: none; }
  .lang-menu { width: 260px; }
  .grid.portal-live { grid-template-columns: 1fr; }
}
