@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/PixelifySans.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #090d18;
  --bg-2: #0f1626;
  --panel: #141d31;
  --line: #24314d;
  --text: #e8eef8;
  --muted: #9fb0c8;
  --cyan: #38d9ff;
  --orange: #ff8a2a;
  --gold: #ffd166;
  --radius: 14px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--cyan); }
a:hover { color: #8be9ff; }

h1, h2, h3, .pixel {
  font-family: "Pixelify Sans", system-ui, sans-serif;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin: 0 0 0.6em; }
h3 { font-size: 1.25rem; margin: 0 0 0.4em; }

.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
section { padding: 72px 0; }
section:nth-of-type(even) { background: var(--bg-2); }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 760px; }

/* Header */
.topbar {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px clamp(16px, 4vw, 40px);
}
.topbar .brand img { width: 46px; height: 46px; border-radius: 10px; }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.topbar nav a:hover { color: var(--cyan); }
.lang { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; background: rgba(9, 13, 24, 0.6); }

/* Hero */
.hero {
  position: relative; min-height: min(92vh, 860px);
  display: grid; place-items: center; text-align: center; overflow: hidden;
  padding: 120px 16px 72px;
}
.hero video, .hero .poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
  transform: scale(1.18); /* push the in-game HUD corners out of frame */
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(ellipse at center, rgba(9, 13, 24, 0.35) 0%, rgba(9, 13, 24, 0.86) 70%),
              linear-gradient(to bottom, rgba(9, 13, 24, 0.2), var(--bg));
}
.hero-inner { position: relative; z-index: 2; max-width: 820px; }
.hero .logo { width: min(640px, 92%); margin: 0 auto 18px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6)); }
.tagline { font-family: "Pixelify Sans", sans-serif; font-size: clamp(1.3rem, 3vw, 1.9rem); color: var(--gold); margin: 0 0 10px; }
.hero p.sub { color: var(--text); font-size: 1.1rem; margin: 0 auto 28px; max-width: 640px; }

.buttons { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "Pixelify Sans", sans-serif; font-size: 1.15rem; font-weight: 600;
  padding: 14px 26px; border-radius: 12px; text-decoration: none; border: 2px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); }
.btn-primary { background: var(--orange); color: #1a0d00; box-shadow: 0 6px 24px rgba(255, 138, 42, 0.35); }
.btn-primary:hover { background: #ffa04f; color: #1a0d00; }
.btn-ghost { background: rgba(20, 29, 49, 0.75); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--text); }
.btn[aria-disabled="true"] { opacity: 0.7; cursor: default; transform: none; }
.badge { font-size: 0.8rem; font-family: system-ui, sans-serif; color: var(--muted); font-weight: 500; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* Worlds */
.grid { display: grid; gap: 20px; }
.worlds { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card .body { padding: 16px 18px 20px; }
.card .rule { color: var(--muted); margin: 0; }
#worlds .lead { margin: -0.2em 0 1.4em; }

a.card { display: flex; flex-direction: column; color: inherit; text-decoration: none; transition: transform 0.15s ease, border-color 0.15s ease; }
a.card .body { flex: 1; display: flex; flex-direction: column; }
a.card:hover, a.card:focus-visible { transform: translateY(-3px); border-color: var(--cyan); color: inherit; }
.card .media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #000; }
.card .media img, .card .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .media video { opacity: 0; transition: opacity 0.2s ease; }
.card.previewing .media video { opacity: 1; }
.card .play {
  position: absolute; left: 10px; bottom: 10px;
  font-family: "Pixelify Sans", sans-serif; font-size: 0.85rem;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(9, 13, 24, 0.8); border: 1px solid var(--line); color: var(--text);
}
.card .more { margin: auto 0 0; padding-top: 10px; color: var(--cyan); font-weight: 600; font-size: 0.95rem; }

/* World detail dialog */
.world-dialog {
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text);
  width: min(980px, calc(100% - 24px)); max-width: none;
  max-height: calc(100dvh - 24px); overflow: auto;
}
.world-dialog::backdrop { background: rgba(4, 6, 12, 0.8); backdrop-filter: blur(3px); }
body:has(dialog[open]) { overflow: hidden; }
.world-dialog:target:not([open]) { display: block; position: fixed; inset: 12px; margin: auto; z-index: 10; }
.world-dialog:focus, .world-dialog:focus-visible { outline: none; }
.dlg {
  position: relative; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: auto 1fr auto;
}
.dlg .media-col { grid-column: 1; grid-row: 1; background: #000; }
.dlg .media-foot { grid-column: 1; grid-row: 2 / 4; padding: 22px 24px 24px; }
.dlg .dlg-body { grid-column: 2; grid-row: 1 / 3; }
.dlg .dlg-nav { grid-column: 2; grid-row: 3; }
.media-foot .foot-label { font-family: "Pixelify Sans", sans-serif; color: var(--text); font-size: 1.05rem; }
.media-foot .btn { margin-top: 20px; width: 100%; justify-content: center; }
.dlg video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; }
.dlg-body { padding: 26px 28px 8px; }
.dlg .close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line); background: rgba(9, 13, 24, 0.85);
  color: var(--text); text-decoration: none; font-size: 1.5rem; line-height: 1;
}
.dlg .close:hover { border-color: var(--cyan); color: var(--text); }
.dlg .law { font-family: "Pixelify Sans", sans-serif; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem; margin: 0 0 2px; }
.dlg h3 { font-size: 2rem; margin: 0 0 8px; }
.dlg h4 { font-family: "Pixelify Sans", sans-serif; font-size: 1.05rem; color: var(--text); margin: 18px 0 6px; }
.dlg p, .dlg li { color: var(--muted); }
.dlg p { margin: 0; }
.dlg .intro { color: var(--text); }
.dlg ul { margin: 0; padding-left: 1.2em; }
.dlg li { margin: 4px 0; }
.dlg strong { color: var(--text); }
.dlg .c-blue { color: var(--cyan); }
.dlg .c-orange { color: var(--orange); }
.dlg ul.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 10px 0 0; }
.dlg ul.tags li { margin: 0; font-size: 0.85rem; color: var(--text); padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); }
.dlg-nav { display: flex; justify-content: space-between; gap: 12px; margin: 14px 28px 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.dlg-nav a { font-weight: 600; text-decoration: none; }
.world-voxel h3 { color: #ff9a5c; }
.world-number h3 { color: var(--cyan); }
.world-retro h3 { color: #ff6ad5; }
.world-alien h3 { color: #8dff7a; }

/* Features */
.features { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.feature h3 { color: var(--gold); }
.feature p { margin: 0; color: var(--muted); }

/* Gallery */
.gallery { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.gallery a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.2s ease; }
.gallery a:hover img { transform: scale(1.03); }

/* Platforms */
.platforms { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.platform { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.platform .status { display: inline-block; font-size: 0.85rem; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.status.live { background: rgba(141, 255, 122, 0.15); color: #8dff7a; }
.status.soon { background: rgba(255, 209, 102, 0.15); color: var(--gold); }
.platform p { color: var(--muted); margin: 0 0 14px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 32px 0 44px; color: var(--muted); font-size: 0.95rem; }
footer .cols { display: flex; flex-wrap: wrap; gap: 18px 32px; justify-content: space-between; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }

/* Text pages (privacy) */
.page { padding: 120px 0 64px; }
.page .wrap { max-width: 820px; }
.page h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 6px; }
.page h2 { font-size: 1.5rem; margin-top: 1.6em; }
.page h3 { margin-top: 1.2em; }
.page .updated { color: var(--muted); margin-bottom: 28px; }
.page li { margin: 6px 0; }
.page .divider { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }

@media (max-width: 640px) {
  section { padding: 52px 0; }
  .topbar nav a:not(.lang) { display: none; }
  .btn { width: 100%; justify-content: center; }
}
@media (max-width: 760px) {
  .world-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .dlg { grid-template-columns: 1fr; grid-template-rows: none; }
  .dlg > * { grid-column: auto !important; grid-row: auto !important; }
  .dlg-body { padding: 20px 18px 4px; }
  .dlg .media-foot { padding: 18px 18px 4px; }
  .dlg-nav { margin: 14px 18px 22px; }
  .dlg h3 { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero video { display: none; }
  .btn, .gallery img { transition: none; }
}
