:root {
    /* Baza */
    --bg-0: #07070c;
    --bg-1: #0d0d16;
    --ink: #e7e7f0;
    --ink-muted: #9a9ab0;

    /* Powierzchnie "szkła" */
    --glass: rgba(255, 255, 255, 0.045);
    --glass-strong: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.10);

    /* Neonowe akcenty */
    --red: #ff3b3b;
    --amber: #ffb020;
    --green: #22e39a;
    --teal: #34d6d6;
    --violet: #a878ff;

    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg-0);
    color: var(--ink);
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Animowane tło (aurora) --- */
.aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(255, 59, 59, 0.16), transparent 60%),
        radial-gradient(1000px 700px at 100% 0%, rgba(168, 120, 255, 0.14), transparent 55%),
        radial-gradient(900px 900px at 50% 120%, rgba(52, 214, 214, 0.10), transparent 60%),
        linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
.aurora::before {
    content: "";
    position: absolute;
    inset: -30%;
    background:
        radial-gradient(40% 40% at 30% 30%, rgba(255, 59, 59, 0.10), transparent 70%),
        radial-gradient(35% 35% at 70% 60%, rgba(168, 120, 255, 0.10), transparent 70%);
    animation: aurora-drift 24s ease-in-out infinite alternate;
    filter: blur(20px);
}

@keyframes aurora-drift {
    0%   { transform: translate3d(-4%, -2%, 0) rotate(0deg); }
    100% { transform: translate3d(4%, 3%, 0) rotate(8deg); }
}

/* --- Nagłówek "NIE" --- */
h1.display-1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(5rem, 13vw, 11rem);
    font-weight: 700;
    letter-spacing: 4px;
    line-height: 0.95;
    user-select: none;
    background: linear-gradient(180deg, #fff 0%, #ffd9d9 55%, var(--red) 130%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 22px rgba(255, 59, 59, 0.45));
    animation: pulse-glow 3.2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 18px rgba(255, 59, 59, 0.35)); }
    50%      { filter: drop-shadow(0 0 34px rgba(255, 59, 59, 0.65)); }
}

.hero-tagline {
    color: var(--ink-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- Kafelki licznika --- */
.counter-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}
.time-tile {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 14px 10px 10px;
    min-width: 92px;
    flex: 0 1 110px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.time-tile .tile-val {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: #fff;
}
.time-tile .tile-unit {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-muted);
}
.time-tile.is-seconds {
    border-color: rgba(255, 59, 59, 0.35);
}
.time-tile.is-seconds .tile-val {
    color: #ffd0d0;
    text-shadow: 0 0 14px rgba(255, 59, 59, 0.5);
}

/* --- Pasek medali (globalny) --- */
.medal-bar {
    display: inline-flex;
    gap: 22px;
    padding: 12px 24px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-variant-numeric: tabular-nums;
}

/* --- Sekcja tytułów --- */
.section-eyebrow {
    color: var(--ink-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- Karty (szkło) --- */
.card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
    position: relative;
}
.card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,59,59,0.5), rgba(168,120,255,0.5));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
}
.card:hover::after { opacity: 1; }

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--glass-border);
    padding: 0.85rem 1.1rem;
}
.card-body { padding: 1.1rem; }

.percent-chip {
    font-variant-numeric: tabular-nums;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- Karty gier (streaks) --- */
.streak-card { text-align: center; }
.streak-card .streak-dot { font-size: 0.7rem; vertical-align: middle; }
.streak-genshin { --accent: var(--teal); }
.streak-wuwa    { --accent: var(--violet); }
.streak-card .streak-title-game { color: var(--accent); font-weight: 600; }
.streak-card .streak-flame {
    display: inline-block;
    animation: flame-flicker 1.6s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 176, 32, 0.6));
}
@keyframes flame-flicker {
    0%, 100% { transform: scale(1) rotate(-2deg); }
    50%      { transform: scale(1.12) rotate(2deg); }
}

/* --- Pasek postępu --- */
.progress {
    background: rgba(255, 255, 255, 0.06);
    height: 22px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}
.progress-bar {
    border-radius: 999px;
    position: relative;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    background-size: 200% 100%;
}
/* Połysk przesuwający się po pasku */
.progress-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.35) 50%, transparent 80%);
    transform: translateX(-100%);
    animation: shimmer 2.6s linear infinite;
}
.bg-success {
    background-image: linear-gradient(90deg, #12a06a, var(--green)) !important;
    box-shadow: 0 0 14px rgba(34, 227, 154, 0.45);
}
.bg-warning {
    background-image: linear-gradient(90deg, #d98a00, var(--amber)) !important;
    box-shadow: 0 0 14px rgba(255, 176, 32, 0.45);
}
.bg-glow-red {
    background-image: linear-gradient(90deg, #c11c1c, var(--red)) !important;
    box-shadow: 0 0 18px rgba(255, 59, 59, 0.6);
}
@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.medals-box {
    min-width: 90px;
    letter-spacing: 2px;
    filter: drop-shadow(0 0 6px rgba(255, 200, 80, 0.5));
}

/* --- Wejściowa animacja kart --- */
.fade-up {
    opacity: 0;
    animation: fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Pływające pigułki: język i repozytorium (szklany wygląd) --- */
.lang-btn,
.repo-btn {
    position: fixed;
    top: 18px;
    z-index: 1050;
    color: var(--ink);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.2s ease, transform 0.2s ease;
}
.lang-btn:hover,
.repo-btn:hover {
    background: var(--glass-strong);
    color: #fff;
    transform: translateY(-1px);
}
.lang-btn {
    right: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 6px 16px;
}
/* Ikona zamiast tekstu: inne odstępy, ta sama wysokość co pigułka języka. */
.repo-btn {
    left: 18px;
    display: inline-flex;
    align-items: center;
    padding: 9px 15px;
    line-height: 1;
}

/* --- Dostępność: mniej ruchu --- */
@media (prefers-reduced-motion: reduce) {
    .aurora::before,
    h1.display-1,
    .streak-flame,
    .progress-bar::after,
    .fade-up {
        animation: none !important;
    }
    .fade-up { opacity: 1; }
}

/* --- Mobile --- */
@media (max-width: 480px) {
    /* Na wąskich ekranach tagline sięgał aż pod pływające pigułki w rogach. */
    .hero-tagline { margin-top: 18px; }
    .time-tile { min-width: 78px; flex-basis: 88px; padding: 10px 6px 8px; }
    .time-tile .tile-val { font-size: 1.6rem; }
    .medal-bar { gap: 14px; padding: 10px 16px; }
}

/* --- Statyczne podsumowanie dla botów i przeglądarek bez JS --- */
/* Widoczne tylko wtedy, gdy JavaScript nie wystartował. Agenci AI i crawlery
   czytające surowy HTML dostają tu komplet danych zamiast pustych kafelków. */
html.js #static-summary { display: none; }

html.no-js #counter,
html.no-js #counter-msg,
html.no-js #game-streaks,
html.no-js #global-medals,
html.no-js #comparisons,
html.no-js .lang-btn { display: none; }

#static-summary {
    max-width: 60rem;
    margin: 0 auto;
    padding: 2rem 1.25rem;
    text-align: left;
    line-height: 1.6;
}
#static-summary h1 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    margin-bottom: 0.75rem;
}
#static-summary h2 {
    font-size: 1.15rem;
    margin: 2rem 0 0.75rem;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
#static-summary a { color: var(--teal); }
#static-summary ol { padding-left: 1.4rem; }
#static-summary li { margin-bottom: 0.9rem; }
#static-summary .event-en { color: var(--ink-muted); }
#static-summary .event-duration { color: var(--amber); white-space: nowrap; }
#static-summary .event-desc { display: block; color: var(--ink-muted); font-size: 0.92rem; }
