/* =====================================================================
   KoiForge Games — site stylesheet
   Dark, art-focused, forge-warm accents on midnight blue.
   ===================================================================== */

:root {
    /* Surfaces */
    --bg-0:        #06091a;     /* page base, deepest */
    --bg-1:        #0a1226;     /* cards, sections */
    --bg-2:        #131e3a;     /* raised panels */
    --bg-3:        #1c2a4d;     /* hover / active */
    --line:        rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.14);

    /* Forge palette (sampled from mascot art) */
    --fire:        #ff7a1a;     /* primary accent — forge flame */
    --fire-glow:   #ffb347;     /* highlight on fire */
    --koi:         #e63946;     /* koi red */
    --gold:        #ffc857;     /* dragon scale gold */
    --teal:        #4fb3a9;     /* mascot's jade head */

    /* Text */
    --ink:         #f5f0e8;     /* warm off-white */
    --ink-muted:   #aab2cc;
    --ink-dim:     #6c7596;

    /* Layout */
    --nav-h:       72px;
    --maxw:        1200px;
    --radius:      12px;
    --radius-sm:   6px;

    /* Motion */
    --ease:        cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-0);
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 20% -10%, rgba(255, 122, 26, 0.08), transparent 40%),
        radial-gradient(circle at 90% 110%, rgba(230, 57, 70, 0.06), transparent 45%),
        var(--bg-0);
}

img, video { max-width: 100%; display: block; }

a {
    color: var(--fire-glow);
    text-decoration: none;
    transition: color 150ms var(--ease);
}
a:hover { color: var(--gold); }

h1, h2, h3, h4 {
    font-family: 'Cinzel', 'Trajan Pro', Georgia, serif;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin: 0 0 0.5em;
    color: var(--ink);
}
h1 { font-size: clamp(2rem, 4.5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

.muted { color: var(--ink-muted); }
.dim   { color: var(--ink-dim); }

/* ---------- Layout helpers ---------- */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

main {
    flex: 1;
    padding-top: var(--nav-h);
}

section {
    padding: 64px 0;
}
section + section { border-top: 1px solid var(--line); }

.section-head {
    margin-bottom: 32px;
}
.section-head .eyebrow {
    color: var(--fire);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}
.section-head p { color: var(--ink-muted); max-width: 65ch; }

/* ---------- Top navigation ---------- */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(6, 9, 26, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    z-index: 100;
}
.nav-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--ink);
    font-size: 1.15rem;
    letter-spacing: 0.06em;
}
.brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line-strong);
    background: var(--bg-2);
}
.brand .accent { color: var(--fire); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0; padding: 0;
}
.nav-links a {
    color: var(--ink-muted);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 150ms var(--ease), color 150ms var(--ease);
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--ink);
    background: var(--bg-2);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line-strong);
    color: var(--ink);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 120ms var(--ease), box-shadow 120ms var(--ease), background 120ms var(--ease);
    text-decoration: none;
    background: var(--bg-2);
    color: var(--ink);
    border-color: var(--line-strong);
}
.btn:hover  { background: var(--bg-3); color: var(--ink); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--fire) 0%, var(--koi) 100%);
    color: #1a0d05;
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(255, 122, 26, 0.25);
}
.btn-primary:hover {
    color: #1a0d05;
    box-shadow: 0 12px 32px rgba(255, 122, 26, 0.4);
}

.btn-ghost {
    background: transparent;
    border-color: var(--line-strong);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 100px 0 80px;
}
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.18;
    background: radial-gradient(ellipse at center, rgba(255, 122, 26, 0.6), transparent 60%);
    filter: blur(40px);
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
}
.hero h1 { margin-bottom: 16px; }
.hero .lede { font-size: 1.15rem; color: var(--ink-muted); margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Cards & grids ---------- */
.grid {
    display: grid;
    gap: 24px;
}
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }

.card {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 122, 26, 0.35);
    box-shadow: 0 20px 40px -20px rgba(255, 122, 26, 0.3);
}
.card-media {
    aspect-ratio: 16 / 10;
    background: var(--bg-2);
    position: relative;
    overflow: hidden;
}
.card-media img,
.card-media video {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 400ms var(--ease);
}
.card:hover .card-media img { transform: scale(1.04); }

.card-tag {
    position: absolute;
    top: 12px; left: 12px;
    background: rgba(6, 9, 26, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line-strong);
    color: var(--ink);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}
.card-tag.tag-pc      { color: var(--gold);  border-color: rgba(255, 200, 87, 0.4); }
.card-tag.tag-android { color: var(--teal);  border-color: rgba(79, 179, 169, 0.4); }
.card-tag.tag-mod     { color: var(--fire);  border-color: rgba(255, 122, 26, 0.4); }

.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-body h3 { margin: 0; font-family: 'Inter', sans-serif; font-size: 1.15rem; font-weight: 600; }
.card-body p  { margin: 0; color: var(--ink-muted); font-size: 0.92rem; flex: 1; }
.card-body .meta { color: var(--ink-dim); font-size: 0.85rem; margin-top: 8px; }

/* ---------- Game-page structures ---------- */
.game-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding: 120px 0 48px;
    border-bottom: 1px solid var(--line);
}
.game-hero-bg {
    position: absolute; inset: 0; z-index: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.45);
}
.game-hero-bg::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 30%, var(--bg-0) 100%);
}
.game-hero .container { position: relative; z-index: 1; }
.game-hero .platforms {
    display: flex; gap: 8px; margin-bottom: 16px;
}
.platform-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--ink-muted);
    background: rgba(6, 9, 26, 0.6);
}

/* Two-column game layout: gallery left, sidebar right */
.game-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 48px;
}
@media (max-width: 960px) {
    .game-layout { grid-template-columns: 1fr; }
}

/* ---------- Gallery ---------- */
.gallery {
    margin-bottom: 48px;
}
.gallery-main {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-1);
    border: 1px solid var(--line);
    margin-bottom: 12px;
}
.gallery-main img,
.gallery-main video,
.gallery-main iframe {
    width: 100%; height: 100%;
    object-fit: cover;
    border: none;
}
.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}
.gallery-thumb {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-1);
    border: 1px solid var(--line);
    cursor: pointer;
    position: relative;
    transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb:hover { transform: translateY(-2px); }
.gallery-thumb.active { border-color: var(--fire); }
.gallery-thumb.video::after {
    content: '▶';
    position: absolute; inset: 0;
    display: grid; place-items: center;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    font-size: 1.4rem;
    background: rgba(0, 0, 0, 0.3);
}

/* ---------- Sidebar widgets (price, specs, etc.) ---------- */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}
.widget h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 16px;
}
.price {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 4px;
}
.price-note { color: var(--ink-dim); font-size: 0.85rem; margin-bottom: 16px; }

.widget .btn { width: 100%; justify-content: center; }
.widget .btn + .btn { margin-top: 8px; }

/* Specs comparison table */
.specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.specs-col {
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--line);
}
.specs-col h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 12px;
    color: var(--ink-muted);
}
.specs-col h4.minimum   { color: var(--ink-muted); }
.specs-col h4.recommended { color: var(--gold); }
.specs-col dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: 0.88rem; }
.specs-col dt { color: var(--ink-dim); font-weight: 500; }
.specs-col dd { color: var(--ink); margin: 0; }
@media (max-width: 720px) { .specs { grid-template-columns: 1fr; } }

/* ---------- Feature lists ---------- */
.feature-list {
    list-style: none;
    margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.feature-list li {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.feature-list .ico {
    flex: 0 0 32px;
    width: 32px; height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--fire), var(--koi));
    display: grid; place-items: center;
    color: #1a0d05;
    font-weight: 700;
    font-size: 1rem;
}
.feature-list strong { display: block; margin-bottom: 4px; color: var(--ink); }
.feature-list span   { color: var(--ink-muted); font-size: 0.9rem; }

/* ---------- Forms ---------- */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-row label { font-size: 0.85rem; color: var(--ink-muted); font-weight: 500; }
.form-row input,
.form-row textarea,
.form-row select {
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--ink);
    font: inherit;
    transition: border-color 150ms var(--ease);
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--fire);
}
.form-row textarea { min-height: 140px; resize: vertical; }

/* ---------- Notice banner (privacy/etc) ---------- */
.notice {
    background: linear-gradient(135deg, rgba(255, 122, 26, 0.08), rgba(230, 57, 70, 0.04));
    border: 1px solid rgba(255, 122, 26, 0.2);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 24px 0;
}
.notice strong { color: var(--fire); }

/* ---------- Footer ---------- */
.footer {
    background: var(--bg-1);
    border-top: 1px solid var(--line);
    padding: 48px 0 24px;
    margin-top: 80px;
    color: var(--ink-muted);
    font-size: 0.9rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}
.footer h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 14px;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--ink-muted); }
.footer a:hover { color: var(--ink); }
.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--ink-dim);
    font-size: 0.85rem;
}

/* ---------- Intro splash ----------
   Video is sized to fit the viewport entirely (object-fit: contain),
   so the whole frame is visible at any resolution / aspect ratio.
   Letterbox area falls back to the page background. The browser
   re-fits automatically on resize — no JS needed. */
.intro {
    position: fixed;
    inset: 0;
    background: var(--bg-0);
    /* Subtle vignette so the letterbox isn't a flat slab. */
    background-image:
        radial-gradient(ellipse at center, rgba(255, 122, 26, 0.10), transparent 60%),
        var(--bg-0);
    display: grid;
    place-items: center;
    z-index: 999;
    overflow: hidden;
}
.intro video {
    width: 100vw;
    height: 100vh;
    /* Modern browsers honor 100svh / 100dvh — graceful fall-back to vh. */
    height: 100svh;
    height: 100dvh;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}
.intro-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 8vh;
    background: linear-gradient(to bottom, transparent 50%, rgba(6, 9, 26, 0.85) 100%);
    text-align: center;
}
.intro-overlay h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 8px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}
.intro-overlay p { color: var(--ink-muted); margin-bottom: 24px; }
.intro-skip {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(6, 9, 26, 0.7);
    backdrop-filter: blur(8px);
    color: var(--ink);
    border: 1px solid var(--line-strong);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
}
.intro-skip:hover { background: rgba(6, 9, 26, 0.9); }

/* ---------- Tabs (Games: PC / Android) ---------- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 32px;
}
.tab {
    background: none;
    border: none;
    color: var(--ink-muted);
    padding: 12px 20px;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 150ms var(--ease), border-color 150ms var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--fire); border-bottom-color: var(--fire); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    :root { --nav-h: 64px; }
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0; right: 0;
        flex-direction: column;
        background: var(--bg-1);
        border-bottom: 1px solid var(--line);
        padding: 16px;
        align-items: stretch;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 14px; }
    .nav-toggle { display: inline-block; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    section { padding: 48px 0; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}
