:root {
  --bg: #0d0f1a;
  --bg-2: #141728;
  --card: #181c30;
  --border: #262b45;
  --text: #eef0fa;
  --muted: #9aa0bf;
  --accent: #1fa3c9;
  --accent-2: #6fdcf7;
  --radius: 18px;
  --max: 1120px;
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-2); }

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

/* ── Header ───────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(13, 15, 26, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-weight: 700; font-size: 1.15rem; letter-spacing: 0.02em;
}
.brand svg { width: 34px; height: 34px; }
.nav { display: flex; gap: 22px; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* ── Hero ─────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: 96px 0 80px;
  background:
    radial-gradient(800px 400px at 15% 0%, rgba(31, 163, 201, 0.28), transparent 60%),
    radial-gradient(700px 400px at 90% 30%, rgba(111, 220, 247, 0.12), transparent 60%);
}
.hero .wrap {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center;
}
.eyebrow {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: rgba(31, 163, 201, 0.15); color: #8fe3f8;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; margin: 18px 0 16px;
  font-weight: 800; letter-spacing: -0.02em;
}
.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 520px; margin: 0 0 28px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 12px;
  background: linear-gradient(135deg, #2bb6dd, #127fa3);
  color: #fff; text-decoration: none; font-weight: 600;
  box-shadow: 0 8px 24px rgba(31, 163, 201, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31, 163, 201, 0.45); }

.hero-art { display: flex; justify-content: center; }
.hero-art img { width: min(460px, 100%); height: auto; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 20px 40px rgba(31, 163, 201, 0.35)); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ── Games ────────────────────────────────────── */
.section { padding: 72px 0; }
.section h2 { font-size: 2rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.section .lead { color: var(--muted); margin: 0 0 36px; }

.games-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.game-card {
  --c: var(--accent);
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}
.game-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--c);
}
.game-card:hover { transform: translateY(-4px); border-color: var(--c); }
.game-top { display: flex; gap: 16px; align-items: center; }
.game-icon {
  width: 72px; height: 72px; border-radius: 18px; flex-shrink: 0;
  object-fit: cover; background: var(--bg-2);
}
.game-icon.generated {
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 40%, #000));
}
.game-icon.generated svg { width: 44px; height: 44px; }
.game-title { margin: 0; font-size: 1.3rem; }
.game-genre {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--c);
}
.game-tagline { margin: 0; font-weight: 600; }
.game-desc { margin: 0; color: var(--muted); font-size: 0.95rem; flex-grow: 1; }

.play-badge {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  padding: 9px 16px; border-radius: 10px;
  background: #000; color: #fff; text-decoration: none;
  border: 1px solid #3a3f5c;
  transition: border-color 0.15s ease;
}
.play-badge:hover { border-color: #fff; }
.play-badge svg { width: 22px; height: 22px; }
.play-badge small { display: block; font-size: 0.65rem; line-height: 1; opacity: 0.8; text-transform: uppercase; }
.play-badge strong { display: block; font-size: 1rem; line-height: 1.2; }
.coming-soon {
  align-self: flex-start; padding: 9px 16px; border-radius: 10px;
  border: 1px dashed var(--border); color: var(--muted); font-size: 0.9rem;
}

/* ── About ────────────────────────────────────── */
.about {
  background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.about-item h3 { margin: 10px 0 6px; font-size: 1.1rem; }
.about-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.about-item .dot {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(31, 163, 201, 0.15); font-size: 1.2rem;
}

/* ── Footer ───────────────────────────────────── */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 28px 0; color: var(--muted); font-size: 0.9rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ── Legal page ───────────────────────────────── */
.legal { padding: 64px 0 80px; }
.legal .wrap { max-width: 800px; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 0 0 6px; letter-spacing: -0.02em; }
.legal .updated { color: var(--muted); margin: 0 0 40px; }
.legal h2 { font-size: 1.35rem; margin: 40px 0 10px; }
.legal h3 { font-size: 1.05rem; margin: 24px 0 6px; }
.legal p, .legal li { color: #c9cde3; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal .toc {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 20px;
}
.legal .toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.legal .toc a { color: var(--text); text-decoration: none; }
.legal .toc a:hover { color: var(--accent-2); }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.95rem; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal th { color: var(--text); }
.legal td { color: #c9cde3; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 820px) {
  .hero { padding: 64px 0 56px; }
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-art { order: -1; }
  .hero-art img { width: min(300px, 80%); }
  .about-grid { grid-template-columns: 1fr; }
  .legal .toc ol { columns: 1; }
}
@media (max-width: 480px) {
  .nav { gap: 14px; }
  .nav a { font-size: 0.85rem; }
  .brand img { height: 40px; }
  .games-grid { grid-template-columns: 1fr; }
  .legal table, .legal thead, .legal tbody, .legal tr, .legal th, .legal td { display: block; }
  .legal thead { display: none; }
  .legal td { border: none; padding: 4px 0; }
  .legal tr { border-bottom: 1px solid var(--border); padding: 10px 0; }
}

/* ── Shooting stars background ────────────────── */
#sky {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.site-header, main, .site-footer { position: relative; z-index: 1; }
.site-header { z-index: 10; }
.about { background: rgba(20, 23, 40, 0.82); }

/* ── Header logo ──────────────────────────────── */
.brand img { height: 48px; width: auto; display: block; }

/* ── Discontinued card ────────────────────────── */
.game-card.is-discontinued { border-style: dashed; }
.game-card.is-discontinued::before { background: var(--border); }
.game-card.is-discontinued .game-icon { filter: grayscale(1) opacity(0.55); }
.game-card.is-discontinued .game-title,
.game-card.is-discontinued .game-tagline { color: var(--muted); }
.game-card.is-discontinued:hover { transform: none; border-color: var(--border); }
.game-card.is-discontinued .game-genre { color: var(--muted); }
.badge-discontinued {
  display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px;
  background: rgba(255, 90, 90, 0.14); color: #ff8a8a;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.discontinued-note {
  align-self: flex-start; padding: 9px 16px; border-radius: 10px;
  border: 1px dashed var(--border); color: var(--muted); font-size: 0.9rem;
}

/* ── Clickable cards ──────────────────────────── */
.game-card { cursor: pointer; }
.game-card:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.more { color: var(--muted); font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.more i { font-style: normal; display: inline-block; transition: transform 0.15s ease; }
.game-card:hover .more, .game-card:focus-visible .more { color: var(--c); }
.game-card:hover .more i { transform: translateX(3px); }

/* ── Game popup ───────────────────────────────── */
html.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 6, 14, 0.78); backdrop-filter: blur(6px); animation: fade 0.18s ease; }
.modal-dialog {
  position: relative; width: 100%; max-width: 860px; max-height: min(92vh, 900px);
  background: var(--card); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  display: flex; flex-direction: column; overflow: hidden; outline: none;
  animation: pop 0.22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: rgba(13, 15, 26, 0.85); color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: var(--bg); border-color: var(--muted); }
.modal-body { overflow-y: auto; overscroll-behavior: contain; padding: 28px 28px 0; }
.m-head { display: flex; gap: 18px; align-items: center; padding-right: 44px; --c: var(--accent); }
.m-head .game-icon { width: 88px; height: 88px; border-radius: 22px; }
.m-head h2 { margin: 0; font-size: 1.8rem; letter-spacing: -0.01em; }
.m-tag { margin: 4px 0 0; color: var(--muted); font-weight: 500; }
.m-shots {
  display: flex; gap: 14px; overflow-x: auto; margin: 22px -28px 0; padding: 4px 28px 14px;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.m-shots img {
  height: min(430px, 52vh); width: auto; border-radius: 16px; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--bg-2); scroll-snap-align: start;
}
.m-text { padding: 8px 0 4px; }
.m-text p { color: #c9cde3; margin: 12px 0; }
.m-text h3 { margin: 22px 0 8px; font-size: 1.05rem; }
.m-text ul { margin: 0; padding-left: 20px; color: #c9cde3; }
.m-text li { margin-bottom: 6px; }
.m-text .m-note { color: var(--muted); font-size: 0.88rem; margin-top: 18px; }
.m-cta {
  position: sticky; bottom: 0; margin: 12px -28px 0; padding: 16px 28px 20px;
  background: linear-gradient(to top, var(--card) 70%, rgba(24, 28, 48, 0));
}
@media (max-width: 560px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal-dialog { max-height: 94vh; border-radius: 22px 22px 0 0; }
  .modal-body { padding: 22px 20px 0; }
  .m-shots { margin: 18px -20px 0; padding: 4px 20px 12px; }
  .m-cta { margin: 12px -20px 0; padding: 14px 20px 18px; }
  .m-head .game-icon { width: 68px; height: 68px; border-radius: 18px; }
  .m-head h2 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { .modal-backdrop, .modal-dialog { animation: none; } }
