/* Liber Games: dark, colourful, mobile first. Each game page sets --accent to its colour. */
:root {
    --bg: #0b0d14;
    --panel: rgba(255, 255, 255, 0.045);
    --panel-strong: rgba(255, 255, 255, 0.08);
    --line: rgba(255, 255, 255, 0.1);
    --text: #eef0f7;
    --muted: #9aa3b8;
    --brand-a: #1a8cff;
    --brand-b: #22d3ee;
    --radius: 22px;
    --max: 1160px;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: Outfit, Inter, sans-serif; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 700; }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 40ch; }

/* Slowly drifting colour glows behind everything. */
.glow { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow span { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: .32; animation: drift 26s ease-in-out infinite alternate; }
.glow span:nth-child(1) { background: var(--brand-a); top: -18vmax; left: -12vmax; }
.glow span:nth-child(2) { background: var(--brand-b); bottom: -22vmax; right: -14vmax; animation-delay: -9s; }
.glow span:nth-child(3) { background: var(--accent); top: 30%; left: 45%; width: 30vmax; height: 30vmax; opacity: .18; animation-delay: -17s; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.12); } }

/* Header */
.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px max(20px, calc((100vw - var(--max)) / 2 + 20px));
    background: rgba(11, 13, 20, .72);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; }
.nav { display: flex; gap: 6px; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 999px; font-weight: 500; transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); background: var(--panel-strong); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; font-size: 1rem; transition: transform .2s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--brand-a), var(--brand-b)); box-shadow: 0 10px 30px -10px var(--brand-a); }
.btn-ghost { color: var(--text); background: var(--panel-strong); border: 1px solid var(--line); }

/* Home hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; min-height: calc(100vh - 160px); padding: 40px 0; }
.eyebrow { display: inline-block; font-weight: 600; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-b); margin-bottom: 18px; }
.grad { background: linear-gradient(90deg, var(--brand-a), var(--brand-b), #a3e635); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-logo { display: block; height: clamp(76px, 11vw, 120px); width: auto; margin-bottom: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 460px; justify-self: center; width: 100%; }
.orbit { position: absolute; inset: 8%; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .12); animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.float { position: absolute; border-radius: 28%; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7); animation: bob 6s ease-in-out infinite; }
.float-0 { width: 56%; top: 20%; left: 22%; z-index: 2; }
.float-1 { width: 34%; top: 2%; right: 0; animation-delay: -2s; opacity: .9; }
.float-2 { width: 30%; bottom: 4%; left: 0; animation-delay: -4s; opacity: .85; }
@keyframes bob { 50% { transform: translateY(-14px) rotate(-2deg); } }

/* Sections */
.section { padding: 70px 0; }
.section-head { text-align: center; margin: 0 auto 40px; max-width: 640px; }
.section-head p { color: var(--muted); }

/* Game cards */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.game-card {
    position: relative; display: flex; flex-direction: column; gap: 6px;
    padding: 26px; border-radius: var(--radius); text-decoration: none;
    background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, transparent), var(--panel) 55%);
    border: 1px solid var(--line); overflow: hidden;
    transition: transform .3s, border-color .3s, box-shadow .3s;
}
.game-card::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: var(--accent); filter: blur(70px); opacity: .25; transition: opacity .3s; }
.game-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 24px 50px -24px var(--accent); }
.game-card:hover::after { opacity: .45; }
.game-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.game-card img { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6); }
.game-card p { color: var(--muted); margin: 0 0 14px; }
.card-link { margin-top: auto; font-weight: 600; color: var(--accent); }
.game-card-soon { background: var(--panel); border-style: dashed; justify-content: center; text-align: center; align-items: center; min-height: 260px; }
.game-card-soon::after { display: none; }
.soon-mark { width: 64px; height: 64px; color: var(--muted); margin-bottom: 10px; animation: spin 18s linear infinite; }

.badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; letter-spacing: .03em; background: var(--panel-strong); border: 1px solid var(--line); }
.badge-live { color: #4ade80; border-color: rgba(74, 222, 128, .35); }
.badge-coming_soon { color: #fbbf24; border-color: rgba(251, 191, 36, .35); }
.badge-in_development { color: #93c5fd; border-color: rgba(147, 197, 253, .35); }

/* About */
.about-card { padding: clamp(28px, 5vw, 56px); border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.about-card > p { color: var(--muted); max-width: 70ch; font-size: 1.08rem; }
.about-points { list-style: none; padding: 0; margin: 30px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.about-points li { padding: 20px; border-radius: 16px; background: var(--panel-strong); display: flex; flex-direction: column; gap: 4px; }
.about-points b { font-family: Outfit, sans-serif; font-size: 1.1rem; }
.about-points span { color: var(--muted); }

/* Game page */
.game-hero { padding: 60px 0 30px; }
.game-hero-main { display: flex; gap: 34px; align-items: center; }
.game-icon { width: 160px; height: 160px; border-radius: 38px; box-shadow: 0 30px 60px -20px var(--accent); flex-shrink: 0; }
.game-hero h1 { margin-top: 12px; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.store { display: inline-flex; align-items: center; gap: 12px; padding: 10px 20px 10px 16px; border-radius: 14px; background: #000; border: 1px solid rgba(255, 255, 255, .25); text-decoration: none; transition: transform .2s; }
.store:hover { transform: translateY(-2px); }
.store span { display: flex; flex-direction: column; line-height: 1.15; font: 600 1.15rem Outfit, sans-serif; }
.store small { font: 500 .7rem Inter, sans-serif; letter-spacing: .04em; text-transform: uppercase; color: #cfd3dc; }
.store-icon { width: 28px; height: 28px; }
.store-soon { opacity: .55; }

.shots { margin: 10px -20px; overflow: hidden; }
.shots-track { display: flex; gap: 22px; overflow-x: auto; padding: 20px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shots-track::-webkit-scrollbar { display: none; }
.phone { margin: 0; flex: 0 0 auto; width: min(240px, 62vw); padding: 10px; border-radius: 34px; background: #05060a; border: 1px solid var(--line); box-shadow: 0 30px 60px -30px var(--accent); scroll-snap-align: center; }
.phone img { border-radius: 24px; width: 100%; height: auto; aspect-ratio: 540 / 1170; object-fit: cover; object-position: top; }

.game-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.features { list-style: none; padding: 26px; margin: 0; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.features li { display: flex; gap: 12px; align-items: baseline; }
.tick { flex-shrink: 0; width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent); font-weight: 700; font-size: .85rem; }
.info-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.info-links a { padding: 18px 22px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; font-weight: 600; display: flex; justify-content: space-between; transition: border-color .2s, background .2s; }
.info-links a:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: var(--panel-strong); }

/* Long-form text (descriptions, policies) */
.prose { color: #d6dae5; max-width: 76ch; }
.prose h2 { font-size: 1.45rem; margin-top: 2em; color: var(--text); }
.prose h3 { font-size: 1.15rem; margin-top: 1.6em; color: var(--text); }
.prose a { color: var(--accent); }
.prose ul { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--panel-strong); }
.doc { margin: 0 auto; padding: clamp(24px, 4vw, 48px); border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.doc h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.updated { color: var(--muted); font-size: .9rem; margin-top: -.4em; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .9rem; margin: 0 auto 18px; max-width: 76ch; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.page .doc, .page .form-card { max-width: calc(76ch + 96px); }

/* Forms */
.form-card { margin: 30px auto 0; padding: clamp(24px, 4vw, 40px); border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.form-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.form-card .hint { font-weight: 400; color: var(--muted); font-size: .88rem; }
.form-card input[type=email], .form-card input[type=text], .form-card textarea { font: inherit; color: var(--text); background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.form-card input:focus, .form-card textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.form-card .check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
.form-card .check input { margin-top: 5px; accent-color: var(--accent); }
.form-card .btn { align-self: flex-start; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 14px 18px; border-radius: 12px; margin: 0; }
.notice-ok { background: rgba(74, 222, 128, .12); color: #86efac; }
.notice-err { background: rgba(248, 113, 113, .12); color: #fca5a5; }

/* Errors */
.error-page { text-align: center; padding: 120px 0; display: flex; flex-direction: column; align-items: center; }
.error-code { font: 800 clamp(5rem, 18vw, 9rem) Outfit, sans-serif; line-height: 1; background: linear-gradient(135deg, var(--brand-a), var(--brand-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page .lead { margin: 0 auto 28px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 30px max(20px, calc((100vw - var(--max)) / 2 + 20px)); color: var(--muted); font-size: .92rem; display: flex; flex-direction: column; gap: 14px; margin-top: 40px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }
.footer-game, .footer-main { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.footer-main { justify-content: space-between; }
.footer-title { color: var(--text); font-weight: 600; }

/* Scroll-in animation (site.js adds .in) */
/* Only when the script runs: without it (or before it), everything simply shows. */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js .reveal { opacity: 1; transform: none; }
}

/* Phones */
@media (max-width: 820px) {
    .hero { grid-template-columns: 1fr; text-align: center; min-height: 0; padding-top: 30px; }
    .hero .lead { margin: 0 auto; }
    .hero-logo { margin: 0 auto 20px; }
    .hero-actions { justify-content: center; }
    .hero-art { max-width: 320px; grid-row: 1; }
    .game-hero-main { flex-direction: column; text-align: center; }
    .game-hero .lead { margin: 0 auto; }
    .stores { justify-content: center; }
    .game-icon { width: 128px; height: 128px; border-radius: 30px; }
    .game-body { grid-template-columns: 1fr; }
    .nav a { padding: 8px 9px; font-size: .92rem; }
    .section { padding: 50px 0; }
}
@media (max-width: 420px) {
    .brand-logo { height: 34px; }
    .nav a:nth-child(2) { display: none; }
}
