:root {
    --bg: #0b0b0f;
    --bg2: #16161c;
    --card: #1b1b22;
    --line: #2a2a33;
    --text: #f4f4f6;
    --muted: #9499a3;
    --accent: #f5c518;      /* zlatá – hodnocení / cinema */
    --accent-dim: #c9a012;
    --danger: #e0556b;
    --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html{
    scroll-behavior: smooth;
}
body {
    font-family: 'Manrope', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
}

/* text se da oznacit jen ve formularovych polich */
input, textarea {
    user-select: text;
    -webkit-user-select: text;
}

a { color: inherit; text-decoration: none; }

/* ---------- NAV ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 40px;
    background: linear-gradient(180deg, rgba(11,11,15,.98), rgba(11,11,15,.75));
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 26px; user-select: none; -webkit-user-select: none; }

.logo {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.35rem;
    letter-spacing: -1px;
    color: var(--text);
}
.logo span { color: var(--accent); }

.nav-links { display: flex; gap: 22px; font-size: .9rem; font-weight: 600; }
.nav-links a { color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--text); }

.nav-right { display: flex; align-items: center; gap: 18px; }

.search { display: flex; align-items: center; flex: 0 0 auto; }
.search input {
    width: 240px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.06);
    color: var(--text);
    font-family: inherit;
    font-size: .9rem;
    user-select: text;
    -webkit-user-select: text;
}
.search input:focus { outline: none; border-color: var(--accent); }

.stats { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.stats b { color: var(--accent); }

/* ---------- HERO ---------- */
.hero {
    position: relative;
    min-height: 460px;
    display: flex;
    align-items: flex-end;
    padding: 48px 40px;
    background-size: cover;
    background-position: center 18%;
}
.hero::after {
    content: "";
    position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(11,11,15,.95) 0%, rgba(11,11,15,.55) 45%, rgba(11,11,15,.1) 100%),
        linear-gradient(0deg, var(--bg) 2%, transparent 55%);
}
.hero-inner { position: relative; z-index: 2; max-width: 560px; }
.hero-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(2.4rem, 6vw, 4rem);
    line-height: .95;
    text-transform: uppercase;
    letter-spacing: -1.5px;
    margin-bottom: 14px;
}
.hero-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; font-size: .9rem; color: var(--muted); }
.hero-rating { color: var(--accent); font-weight: 700; }
.hero-desc { font-size: 1rem; color: #d7d9de; margin-bottom: 22px; max-width: 480px; }
.hero-btns { display: flex; gap: 12px; }
.hero .empty { font-size: 1.05rem; color: var(--muted); }

/* tlacitka */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 22px;
    border: none; border-radius: 8px;
    font-family: inherit; font-weight: 700; font-size: .9rem;
    cursor: pointer; transition: transform .15s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #181500; }
.btn-ghost { background: rgba(255,255,255,.14); color: var(--text); }
.btn-danger { background: rgba(224,85,107,.16); color: var(--danger); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- ROWS ---------- */
.rows { padding: 30px 0 60px; }
.row { margin-bottom: 34px; }
.row.hidden { display: none; }

.row-head {
    display: flex; align-items: center; gap: 14px;
    padding: 0 40px; margin-bottom: 14px;
}
.row-head h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.3px; }
.filter {
    margin-left: auto;
    padding: 6px 10px; border-radius: 8px;
    border: 1px solid var(--line); background: var(--bg2); color: var(--text);
    font-family: inherit; font-size: .82rem;
}

.row-scroll { position: relative; }
.row-track {
    display: flex; gap: 14px;
    padding: 6px 40px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.row-track::-webkit-scrollbar { display: none; }
#row-watchlist{
    scroll-margin-top: 25vh;
}
#row-seen{
    scroll-margin-top: 25vh;
}
#row-top{
    scroll-margin-top: 25vh;
}

.arrow {
    position: absolute; top: 0; bottom: 0; z-index: 5;
    width: 46px; border: none; cursor: pointer;
    background: linear-gradient(90deg, rgba(11,11,15,.9), transparent);
    color: var(--text); font-size: 1.8rem;
    opacity: 0; transition: opacity .2s;
}
.arrow.right { right: 0; background: linear-gradient(270deg, rgba(11,11,15,.9), transparent); }
.row-scroll:hover .arrow { opacity: 1; }

.empty-msg { padding: 0 40px; color: var(--muted); font-size: .9rem; }

/* ---------- ZEBRICEK (TOP) ---------- */
.ranked .row-track { gap: 4px; align-items: center; }
.rank-item { display: flex; align-items: center; flex: 0 0 auto; }
.rank-num {
    font-family: 'Archivo Black', sans-serif;
    font-size: 6.5rem;
    line-height: 1;
    margin-right: -22px;
    color: var(--bg);
    -webkit-text-stroke: 3px var(--accent);
    z-index: 1;
}
.rank-item .card { flex-basis: 132px; }

/* ---------- CARD ---------- */
.card { position: relative; flex: 0 0 158px; border-radius: var(--radius); overflow: hidden; background: var(--card); }
.card img, .card .no-img {
    width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block;
}
.no-img {
    display: flex; align-items: center; justify-content: center;
    background: var(--bg2); color: var(--muted); font-size: 2rem;
}
.card-info { padding: 8px 10px 10px; }
.card-title { font-size: .85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: .75rem; color: var(--muted); }

/* tlacitka primo na karte */
.btn-watch, .btn-seen, .btn-del {
    border: none; border-radius: 6px; cursor: pointer;
    font-family: inherit; font-weight: 700; font-size: .8rem; padding: 9px 16px;
}
.btn-watch { background: var(--accent); color: #181500; }
.btn-seen { background: rgba(255,255,255,.14); color: var(--text); }
.btn-del { background: rgba(224,85,107,.16); color: var(--danger); }

.card-info .btn-watch,
.card-info .btn-seen,
.card-info .btn-del {
    display: block; width: 100%; margin-top: 6px; padding: 6px; font-size: .72rem;
}
.card-info .stars { font-size: 1.15rem; margin-top: 6px; cursor: pointer; }
.card-info .review {
    width: 100%; min-height: 46px; margin-top: 6px;
    border-radius: 6px; border: 1px solid var(--line);
    background: var(--bg); color: var(--text);
    padding: 6px; resize: vertical; font-family: inherit; font-size: .72rem;
}
.card-info .star { color: #3a3a44; }
.card-info .star.on { color: var(--accent); }

.badge {
    position: absolute; top: 8px; right: 8px;
    background: rgba(0,0,0,.78);
    padding: 3px 7px; border-radius: 6px;
    font-size: .72rem; font-weight: 700; color: var(--accent);
}
.card-play {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .2s;
    background: rgba(0,0,0,.3);
}
.card:hover .card-play { opacity: 1; }
.card-play span {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,.9); color: #000;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}

/* ---------- MODAL ---------- */
.modal {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.7); padding: 20px;
}
.modal.hidden { display: none; }
.modal-box {
    position: relative;
    width: 100%; max-width: 540px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 14px; overflow: hidden;
    max-height: 90vh; overflow-y: auto;
}
.modal-close {
    position: absolute; top: 12px; right: 12px; z-index: 3;
    width: 34px; height: 34px; border-radius: 50%;
    border: none; cursor: pointer;
    background: rgba(0,0,0,.6); color: var(--text); font-size: 1rem;
}
.modal-hero {
    height: 200px; background-size: cover; background-position: center;
    position: relative;
}
.modal-hero::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(0deg, var(--bg2), transparent 70%);
}
.modal-body { padding: 0 24px 24px; margin-top: -40px; position: relative; z-index: 2; }
.modal-body h2 { font-size: 1.5rem; margin-bottom: 6px; }
.modal-meta { color: var(--muted); font-size: .85rem; margin-bottom: 16px; }
.modal-meta .accent { color: var(--accent); font-weight: 700; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }

.rate-label { font-size: .82rem; color: var(--muted); margin: 6px 0 4px; }
.stars { font-size: 1.9rem; cursor: pointer; user-select: none; line-height: 1; }
.star { color: #3a3a44; transition: color .15s; }
.star.on { color: var(--accent); }
.stars:hover .star { color: var(--accent); }
.stars .star:hover ~ .star { color: #3a3a44; }

.review {
    width: 100%; min-height: 80px; margin-top: 4px;
    border-radius: 8px; border: 1px solid var(--line);
    background: var(--bg); color: var(--text);
    padding: 10px; resize: vertical; font-family: inherit; font-size: .9rem;
}

.footer { padding: 28px 40px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); text-align: center; }


.bottom-nav {
    position: sticky;
    bottom: 0; left: 0; right: 0;
    z-index: 60;
    background: linear-gradient(180deg, rgba(8,8,15,.98), rgba(8,8,15,.75));
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    display: none; /* viditelný jen na mobilu */
    align-items: center;
    justify-content: space-around;
    padding: 10px 0 20px 0;
    min-height: 70px;
}
.bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: .8rem;
    color: var(--text);
    font-weight: 600;
}
.bn-item.active { color: var(--accent); }
.bn-icon { font-size: 1.3rem; }
/* ===== MOBILE ===== */
@media (max-width: 640px) {

    /* NAV – flex column, logo uprostřed */
    .nav {
        flex-direction: column;
        align-items: center;
        padding: 12px 16px 10px;
        gap: 10px;
    }
    .nav-left {
        width: 100%;
        justify-content: space-between;
        flex-direction: row-reverse; /* logo jde doprostřed pomocí flex-grow níže */
    }
    .logo {
        flex: 1;
        text-align: center;
        font-size: 1.75rem;
    }
    .nav-links {
        display: none; /* nahrazeno bottom nav barem */
    }

    /* SEARCH – přes celou šířku */
    .search {
        width: 100%;
        padding-bottom: 3.5px;
        padding-top: none;
    }
    .search input {
        width: 100%;
        padding: 7px 16px;
        font-size: 0.8rem;
    }

    /* STATS – schovat nebo zkrátit */
    .stats {
        display: none;
    }

    /* HERO – nižší */
    .hero {
        min-height: 260px;
        padding: 16px;
    }
    .hero-title {
        font-size: clamp(1.2rem, 6vw, 1.65rem);
    }
    .hero-desc{
        font-size: 0.75rem;
    }
    .hero-rating{
        font-size: 0.8rem;
    }
    .hero-meta{
        font-size: 0.8rem;
    }

    /* ROWS – menší padding */
    .row-head,
    .footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    .row-track {
        padding-left: 16px;
        padding-right: 16px;
        gap: 10px;

    }

    /* KARTY – menší */
    .card {
        flex-basis: 100px;
    }

    /* RANK čísla – menší */
    .rank-num {
        font-size: 4.5rem;
        margin-right: -16px;
        -webkit-text-stroke: 2px var(--accent);
    }
    .rank-item .card {
         flex-basis: 100px; 
    }

    .btn {
        padding: 8px 14px;
        font-size: .7rem;
    }
    .card-info .btn-watch,
    .card-info .btn-seen,
    .card-info .btn-del {
        padding: 5px 8px;
        font-size: .5rem;
    }
    .card-info .review{
        font-size: 0.5rem;
    }
    .card-info .stars{
        font-size: 0.9rem;
    }
    /* === BOTTOM NAV BAR === */
    .bottom-nav {
        display: flex;
    }

    /* přidej padding dole, aby obsah neskočil za bottom bar */
    .rows {
        padding-bottom: 80px;
    }
    .footer{
        padding: 14px 20px;
        border-top: none;
    }
}

/* Desktop – schovat bottom nav */
@media (min-width: 641px) {
    .bottom-nav {
        display: none;
    }
}