/* RUN005 PR2 — Numariva Premium Cosmic UI design system.
 * Self-contained (no build step) — served as a static asset by nginx.
 * Palette: deep space blues/blacks, violet primary, subtle gold accents.
 * Mobile-first, WCAG AA contrast, prefers-reduced-motion honored. */

:root {
    --bg0: #06050d;
    --bg1: #0c0919;
    --panel: #130e26;
    --panel-2: #191335;
    --panel-3: #1f1840;
    --line: #2a2250;
    --line-2: #3b2f6e;
    --text: #edeaf8;
    --muted: #a49cc4;
    --muted-2: #837ba0;
    --violet: #8b7cf6;
    --violet-2: #a78bfa;
    --violet-deep: #6d5be0;
    --gold: #e9c46a;
    --gold-soft: #f2d98c;
    --rose: #ff8fab;
    --sky: #8ecbff;
    --green: #7fe0a8;
    --danger: #ff8fa8;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 18px 40px -18px rgba(5, 3, 16, .9);
    --font-display: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, 'Times New Roman', serif;
    --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* #162: `clip` html elemente — tik jis taikomas viewport'ui (body overflow-x: clip
 * Chromium'e NEpropaguojamas į viewport). Desktop naršyklėse su klasikiniu
 * (ne-overlay) scrollbar'u vw pagrįsti dekoratyvūs orbit/fan vizualai išsiplečia
 * už layout pločio ir be šito galimas ~21px horizontalus slinkimas. */
html {
    overflow-x: clip;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    line-height: 1.65;
    font-size: 16px;
    /* #162: dekoratyvūs orbit/fan vizualai nupjaunami prie viewport'o —
       horizontalus slinkimas draudžiamas visame puslapyje. */
    overflow-x: clip;
    background:
        radial-gradient(1100px 700px at 82% -12%, rgba(139, 124, 246, .18), transparent 62%),
        radial-gradient(900px 650px at -8% 28%, rgba(255, 143, 171, .08), transparent 55%),
        radial-gradient(1000px 620px at 50% 112%, rgba(233, 196, 106, .07), transparent 60%),
        linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 55%, var(--bg0) 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Starfield: two fixed layers of tiny stars (pure CSS, deterministic). */
body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-repeat: repeat;
}
body::before {
    background-image:
        radial-gradient(1px 1px at 22px 34px, rgba(255, 255, 255, .55), transparent 1.5px),
        radial-gradient(1px 1px at 118px 90px, rgba(196, 186, 255, .5), transparent 1.5px),
        radial-gradient(1.5px 1.5px at 210px 40px, rgba(255, 255, 255, .4), transparent 2px),
        radial-gradient(1px 1px at 284px 130px, rgba(233, 196, 106, .5), transparent 1.5px),
        radial-gradient(1px 1px at 60px 190px, rgba(255, 255, 255, .35), transparent 1.5px),
        radial-gradient(1.5px 1.5px at 160px 240px, rgba(167, 139, 250, .45), transparent 2px);
    background-size: 320px 280px;
    opacity: .5;
}
body::after {
    background-image:
        radial-gradient(1px 1px at 80px 60px, rgba(255, 255, 255, .3), transparent 1.5px),
        radial-gradient(1px 1px at 250px 200px, rgba(255, 214, 138, .3), transparent 1.5px),
        radial-gradient(2px 2px at 330px 30px, rgba(255, 255, 255, .25), transparent 2.5px),
        radial-gradient(1px 1px at 30px 250px, rgba(196, 186, 255, .35), transparent 1.5px);
    background-size: 380px 300px;
    opacity: .4;
}

a { color: var(--violet-2); text-decoration: none; }
a:hover { color: var(--gold-soft); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 6px;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; }

h1, h2, h3, .display {
    font-family: var(--font-display);
    color: #fff;
    line-height: 1.25;
    margin: .2em 0 .45em;
    letter-spacing: .01em;
}
h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 600; }
h2 { font-size: clamp(21px, 3vw, 27px); font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: .5em 0; }
.muted { color: var(--muted); font-size: 14.5px; }
.muted-sm { color: var(--muted-2); font-size: 12.5px; }
.gold { color: var(--gold); }
.red { color: var(--rose); }

/* ------------------------------------------------------------------ header */
header {
    border-bottom: 1px solid var(--line);
    background: rgba(10, 8, 22, .72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 40;
}
header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.logo {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: .09em;
    color: #fff;
    font-size: 21px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.logo .logo-star { color: var(--gold); font-size: 15px; transform: translateY(-1px); }
.logo span { color: var(--violet-2); }
.logo:hover { text-decoration: none; color: #fff; }
.logo:hover .logo-star { color: var(--gold-soft); }

nav.mainnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 4px; }
nav.mainnav a {
    font-size: 13.5px;
    color: #cbc3e8;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
nav.mainnav a:hover { color: #fff; text-decoration: none; background: rgba(139, 124, 246, .14); border-color: var(--line-2); }
.langswitch { font-size: 13px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.langswitch a {
    color: var(--muted-2);
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
}
.langswitch a.on { color: #0d0a1c; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.langswitch a:hover { text-decoration: none; color: var(--gold-soft); }
.langswitch a.on:hover { color: #0d0a1c; }

main { padding: 40px 0 64px; }

/* ------------------------------------------------------------------ panels */
.card, .panel {
    background: linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin: 18px 0;
    box-shadow: var(--shadow);
}
.card.tool, a.card.tool { display: block; color: var(--text); transition: transform .15s ease, border-color .15s ease; }
a.card.tool:hover { text-decoration: none; border-color: var(--line-2); transform: translateY(-2px); color: var(--text); }
.card .eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--violet-deep) 0%, var(--violet) 100%);
    color: #fff;
    border: 0;
    padding: 12px 26px;
    border-radius: 999px;
    font-size: 15.5px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .02em;
    box-shadow: 0 8px 22px -8px rgba(109, 91, 224, .65);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: linear-gradient(135deg, #7d69ec 0%, var(--violet-2) 100%); text-decoration: none; color: #fff; transform: translateY(-1px); }
.btn-gold {
    background: linear-gradient(135deg, #caa54a 0%, var(--gold) 100%);
    color: #1c1503;
    box-shadow: 0 8px 22px -8px rgba(233, 196, 106, .5);
}
.btn-gold:hover { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-soft) 100%); color: #1c1503; }
.btn-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--violet-2); box-shadow: none; }
.btn-ghost:hover { border-color: var(--violet-2); background: rgba(139, 124, 246, .1); color: var(--gold-soft); }

.badge {
    display: inline-block;
    background: rgba(139, 124, 246, .13);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: 4px 13px;
    font-size: 12.5px;
    color: var(--violet-2);
    margin: 3px 6px 3px 0;
    white-space: nowrap;
}
a.badge:hover { border-color: var(--violet-2); color: var(--gold-soft); text-decoration: none; }
.badge-gold { background: rgba(233, 196, 106, .12); border-color: rgba(233, 196, 106, .4); color: var(--gold); }

/* ------------------------------------------------------------------- forms */
.field label { display: block; margin-bottom: 6px; }
input[type="date"] {
    background: #0e0b1f;
    color: var(--text);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 15.5px;
    max-width: 100%;
    color-scheme: dark;
}
input[type="date"]:hover { border-color: var(--violet); }
.form-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.form-error { color: var(--danger); margin-top: 12px; font-size: 14.5px; }

/* -------------------------------------------------------------------- hero */
.hero { display: grid; grid-template-columns: 1fr; gap: 34px; align-items: center; padding: 26px 0 10px; }
.hero h1 { font-size: clamp(34px, 6vw, 54px); margin: .1em 0 .3em; }
.hero .hero-sub { color: var(--muted); font-size: 17px; max-width: 52ch; }
.hero-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }
.hero-form input[type="date"] { padding: 12px 16px; font-size: 16px; }
.hero-note { margin-top: 12px; }
.hero-visual { display: flex; justify-content: center; }
.fan { position: relative; width: min(300px, 78vw); height: 340px; }
.fan .fan-card { position: absolute; top: 0; left: 50%; transform-origin: 50% 115%; filter: drop-shadow(0 22px 30px rgba(4, 2, 14, .65)); }
.fan .fan-1 { transform: translateX(-50%) rotate(-14deg) translateX(-86px); z-index: 1; }
.fan .fan-2 { transform: translateX(-50%) translateY(-14px); z-index: 3; }
.fan .fan-3 { transform: translateX(-50%) rotate(14deg) translateX(86px); z-index: 2; }
.orbit-ring {
    position: absolute;
    inset: -8% -22%;
    border: 1px dashed rgba(233, 196, 106, .28);
    border-radius: 50%;
    pointer-events: none;
}
.orbit-ring .orbit-dot {
    position: absolute;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 12px rgba(233, 196, 106, .8);
    top: 4%; left: 8%;
}
@media (prefers-reduced-motion: no-preference) {
    @keyframes orbit-spin { to { transform: rotate(360deg); } }
    .orbit-ring { animation: orbit-spin 40s linear infinite; }
}

/* ------------------------------------------------------------- tool grids */
.grid-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.tool-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 10px;
    background: linear-gradient(140deg, rgba(139, 124, 246, .22), rgba(233, 196, 106, .12));
    border: 1px solid var(--line-2);
}
.tool-card-title { font-weight: 700; font-size: 16px; color: #fff; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    font-weight: 700;
    color: #0d0a1c;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-soft) 100%);
    margin-bottom: 8px;
}

/* -------------------------------------------------------- card visuals svg */
.cardvisual { display: block; width: 100%; height: auto; }
.cardvisual-sm { width: 62px; }
.cardvisual-md { width: 96px; }
.cardvisual-lg { width: 150px; }
.cardvisual-xl { width: 210px; }
.card-visual-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    padding: 14px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}
a.card-visual-tile:hover { border-color: var(--line-2); background: rgba(139, 124, 246, .07); text-decoration: none; }
.card-visual-tile .cv-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.card-visual-tile .cv-meta { font-size: 11.5px; color: var(--muted-2); }
.deck-strip { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ------------------------------------------------------------------ result */
.result-grid { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.bigcard { font-size: clamp(24px, 4vw, 32px); font-weight: 700; color: #fff; font-family: var(--font-display); }
.bigcard .red, .glyph .red { color: var(--rose); }
.glyph { font-size: clamp(30px, 5vw, 42px); line-height: 1; font-family: var(--font-display); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat {
    background: linear-gradient(160deg, var(--panel-3) 0%, var(--panel) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}
.stat .stat-num {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 700;
    color: var(--gold-soft);
    line-height: 1.1;
}
.stat .stat-label { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }

/* ------------------------------------------------------------------ tables */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
/* #162: maži viewport'ai — lentelė turi vidinį slinkimą, ne horizontalų puslapio. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table th {
    text-align: left;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gold);
    border-bottom: 1px solid var(--line-2);
    padding: 8px 10px;
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--text); }
.table tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------- calendar */
.month-block { margin-top: 26px; }
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.cal-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(19, 14, 38, .75);
    color: var(--text);
    min-width: 0;
}
.cal-cell:hover { text-decoration: none; border-color: var(--violet); color: var(--text); }
.cal-cell .cal-day { font-weight: 700; font-size: 15px; color: #fff; }
.cal-cell .cal-card { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-cell.cal-joker { border-color: rgba(233, 196, 106, .5); background: rgba(233, 196, 106, .08); }
.cal-cell.cal-joker .cal-card { color: var(--gold); }

/* --------------------------------------------------------------- sections */
.section-title { margin-top: 34px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.vs { font-family: var(--font-display); font-size: 26px; color: var(--gold); align-self: center; }
.pair-row { display: flex; gap: 18px; align-items: center; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ footer */
footer { border-top: 1px solid var(--line); padding: 24px 0 44px; background: rgba(10, 8, 22, .6); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; }
.disclaimer { color: var(--muted-2); font-size: 12.5px; max-width: 72ch; }
footer a { color: var(--violet-2); }

@media (min-width: 760px) {
    .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); padding: 44px 0 16px; }
    .hero-visual { justify-content: flex-end; }
}
@media (max-width: 400px) {
    .wrap { padding: 0 14px; }
    .card, .panel { padding: 18px 16px; }
    .cardvisual-sm { width: 52px; }
    .fan { height: 280px; }
    nav.mainnav a { padding: 5px 8px; font-size: 12.5px; }
}