    /*
    Theme Name: Kinovia Dark
    Theme URI: https://kinovia.pl
    Author: Kinovia
    Description: Lekki motyw biblioteki filmów w trybie ciemnym, zoptymalizowany pod REST API.
    Version: 1.0
    Text Domain: kinovia
    */

    :root {
        --bg-main: #0b0b0f;
        --bg-surface: #15151e;
        --bg-card-hover: #1f1f2e;
        --accent: #e50914;
        --accent-hover: #ff1e27;
        --text-primary: #ffffff;
        --text-secondary: #a0a0b2;
        --border-color: rgba(255, 255, 255, 0.08);
    }

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

    body {
        background-color: var(--bg-main);
        color: var(--text-primary);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        line-height: 1.6;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

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

    /* Nawigacja */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(11, 11, 15, 0.85);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--border-color);
        padding: 16px 5%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }

    .logo {
        font-size: 1.7rem;
        font-weight: 900;
        letter-spacing: 1.5px;
        color: var(--text-primary);
        text-transform: uppercase;
    }

    .logo span {
        color: var(--accent);
    }

    .search-form {
        display: flex;
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        border-radius: 999px;
        padding: 6px 16px;
        width: 100%;
        max-width: 360px;
        transition: border-color 0.2s;
    }

    .search-form:focus-within {
        border-color: var(--accent);
    }

    .search-form input {
        background: transparent;
        border: none;
        color: var(--text-primary);
        width: 100%;
        outline: none;
        font-size: 0.95rem;
    }

    .search-form input::placeholder {
        color: var(--text-secondary);
    }

    /* Kontener główny */
    .container {
        width: 100%;
        max-width: 1440px;
        margin: 0 auto;
        padding: 40px 5%;
        flex: 1;
    }

    .section-title {
        font-size: 1.4rem;
        font-weight: 700;
        margin-bottom: 24px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .section-title::before {
        content: "";
        display: inline-block;
        width: 4px;
        height: 22px;
        background: var(--accent);
        border-radius: 2px;
    }

    .new-movies-section {
        margin-bottom: 36px;
    }

    .new-movies-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 16px;
    }

    .new-movies-heading .section-title {
        margin-bottom: 0;
    }

    .new-movies-buttons {
        display: flex;
        flex: none;
        gap: 8px;
    }

    .new-movies-button {
        display: grid;
        width: 36px;
        height: 36px;
        place-items: center;
        border: 1px solid var(--border-color);
        border-radius: 50%;
        background: var(--bg-surface);
        color: var(--text-primary);
        font-size: 1.5rem;
        line-height: 1;
        cursor: pointer;
    }

    .new-movies-button:hover:not(:disabled) {
        background: var(--accent);
        border-color: var(--accent);
    }

    .new-movies-button:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

    .new-movies-ticker {
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .new-movies-ticker::-webkit-scrollbar {
        display: none;
    }

    .new-movies-ticker:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 3px;
    }

    .new-movies-track {
        display: flex;
        width: max-content;
    }

    .new-movies-group {
        display: flex;
        flex: none;
        gap: 16px;
    }

    .new-movie-card {
        flex: 0 0 160px;
    }

    .new-movie-card:hover {
        transform: none;
    }

    .new-movie-card .badge-new,
    .new-movie-card .badge-quality {
        right: auto;
        left: 10px;
    }

    .new-movie-card .badge-quality {
        top: 42px;
    }

    .new-movie-card .movie-card-body {
        padding: 10px;
    }

    /* Siatka filmów (Grid) */
    .movie-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 24px;
    }

    .movie-card {
        background: var(--bg-surface);
        border-radius: 10px;
        overflow: hidden;
        position: relative;
        transition: transform 0.25s ease, box-shadow 0.25s ease;
        border: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
    }

    .movie-card:hover {
        transform: translateY(-6px) scale(1.02);
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7);
        border-color: rgba(229, 9, 20, 0.5);
    }

    .poster-wrapper {
        position: relative;
        width: 100%;
        aspect-ratio: 2 / 3;
        background: #1c1c28;
        overflow: hidden;
    }

    .poster-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.35s ease;
    }

    .movie-card:hover .poster-wrapper img {
        transform: scale(1.06);
    }

    .badge-year {
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(11, 11, 15, 0.85);
        backdrop-filter: blur(6px);
        color: #fff;
        padding: 3px 9px;
        border-radius: 6px;
        font-size: 0.78rem;
        font-weight: 700;
        border: 1px solid var(--border-color);
    }

    .badge-quality,
    .badge-new {
        position: absolute;
        top: 10px;
        padding: 3px 9px;
        border-radius: 6px;
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        line-height: 1.4;
    }

    .badge-quality {
        right: 10px;
        background: rgba(11, 11, 15, 0.88);
        backdrop-filter: blur(6px);
        color: #fff;
        border: 1px solid rgba(229, 9, 20, 0.75);
    }

    .badge-new {
        left: 10px;
        background: var(--accent);
        color: #fff;
        z-index: 1;
        box-shadow: 0 0 14px rgba(229, 9, 20, 0.75);
        animation: new-badge-pulse 1.4s ease-in-out infinite;
    }

    @keyframes new-badge-pulse {
        0%, 100% {
            box-shadow: 0 0 10px rgba(229, 9, 20, 0.55), 0 0 0 0 rgba(229, 9, 20, 0.35);
            transform: scale(1);
        }
        50% {
            box-shadow: 0 0 22px rgba(229, 9, 20, 0.95), 0 0 0 5px rgba(229, 9, 20, 0.18);
            transform: scale(1.1);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .badge-new {
            animation: none;
        }
    }

    .movie-card-body {
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .movie-card-title {
        font-size: 1rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .movie-card-meta {
        font-size: 0.82rem;
        color: var(--text-secondary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Widok pojedynczego filmu */
    .single-movie {
        display: grid;
        grid-template-columns: 300px 1fr;
        gap: 48px;
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        padding: 40px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    }

    .single-poster {
        width: 100%;
        aspect-ratio: 2 / 3;
        border-radius: 12px;
        overflow: hidden;
        background: #1c1c28;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .single-poster img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .single-details {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .back-link {
        display: inline-block;
        color: var(--text-secondary);
        font-size: 0.9rem;
        margin-bottom: 16px;
        transition: color 0.2s;
    }

    .back-link:hover {
        color: var(--text-primary);
    }

    .single-title {
        font-size: 2.6rem;
        font-weight: 800;
        line-height: 1.15;
        margin-bottom: 16px;
    }

    .meta-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 24px;
    }

    .pill {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid var(--border-color);
        padding: 6px 14px;
        border-radius: 8px;
        font-size: 0.9rem;
    }

    .pill strong {
        color: var(--text-secondary);
        font-weight: 500;
        margin-right: 4px;
    }

    .single-description {
        font-size: 1.05rem;
        color: #d0d0de;
        margin-bottom: 32px;
        max-width: 800px;
    }

    .single-description p {
        margin-bottom: 14px;
    }

    .movie-player-container {
        position: relative;
        width: 100%;
        max-width: 640px;
        aspect-ratio: 16 / 9;
        margin: 20px 0 28px 0;
        border-radius: 12px;
        overflow: hidden;
        background: #000;
        border: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .movie-comments {
        width: 100%;
        max-width: 640px;
        margin: 4px 0 20px;
    }

    .comments-title {
        display: flex;
        align-items: center;
        gap: 9px;
        margin-bottom: 16px;
        font-size: 1.2rem;
    }

    .comments-title span {
        color: var(--text-secondary);
        font-size: 0.9rem;
        font-weight: 500;
    }

    .comments-list {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .movie-comment {
        display: flex;
        align-items: flex-start;
        gap: 10px;
    }

    .comment-avatar {
        display: flex;
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        overflow: hidden;
        background: #343444;
        color: #fff;
        font-size: 0.78rem;
        font-weight: 700;
        object-fit: cover;
    }

    .comment-content {
        min-width: 0;
    }

    .comment-bubble {
        padding: 9px 13px;
        border: 1px solid var(--border-color);
        border-radius: 4px 16px 16px;
        background: #22222d;
    }

    .comment-name {
        margin-bottom: 2px;
        font-size: 0.88rem;
        font-weight: 700;
    }

    .comment-bubble p {
        color: #e2e2eb;
        font-size: 0.92rem;
        overflow-wrap: anywhere;
    }

    .comment-time {
        display: inline-block;
        margin: 4px 0 0 12px;
        color: var(--text-secondary);
        font-size: 0.75rem;
    }

    .movie-player {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        background: #000;
        cursor: pointer;
    }

    /* Własny pasek sterowania na dole */
    .player-controls {
        position: relative;
        z-index: 10;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        background: linear-gradient(transparent, rgba(11, 11, 15, 0.95));
    }

    .player-btn {
        background: transparent;
        border: none;
        color: #fff;
        font-size: 1.1rem;
        cursor: pointer;
        padding: 0 4px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.2s;
    }

    .player-btn:hover {
        color: var(--accent);
    }

    /* Pasek postępu bez możliwości kliknięcia/przewijania */
    .player-progress-container {
        flex: 1;
        height: 4px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
        overflow: hidden;
        pointer-events: none; /* Całkowita blokada przewijania */
    }

    .player-progress-bar {
        width: 0%;
        height: 100%;
        background: var(--accent);
        transition: width 0.25s linear;
    }

    .player-time {
        color: var(--text-secondary);
        font-size: 0.82rem;
        font-family: monospace;
        white-space: nowrap;
        user-select: none;
    }
    /* Paginacja i stopka */
    .pagination {
        margin-top: 40px;
        display: flex;
        justify-content: center;
        gap: 10px;
    }

    .pagination .page-numbers {
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        padding: 8px 16px;
        border-radius: 6px;
        font-weight: 600;
    }

    .pagination .page-numbers.current,
    .pagination .page-numbers:hover {
        background: var(--accent);
        border-color: var(--accent);
    }

    .site-footer {
        border-top: 1px solid var(--border-color);
        padding: 24px 5%;
        text-align: center;
        color: var(--text-secondary);
        font-size: 0.85rem;
    }

    @media (max-width: 768px) {
        .new-movies-section {
            margin-bottom: 28px;
        }

        .new-movie-card {
            flex-basis: 135px;
        }

        .new-movies-group {
            gap: 12px;
        }

        .single-movie {
            grid-template-columns: 1fr;
            padding: 24px;
            gap: 24px;
        }
        .single-poster {
            max-width: 240px;
            margin: 0 auto;
        }
        .single-title {
            font-size: 1.9rem;
        }
    }
    .unlock-modal {
        position: fixed;
        inset: 0;
        width: min(600px, calc(100% - 32px));
        max-width: none;
        max-height: calc(100% - 32px);
        margin: auto;
        padding: 0;
        overflow: auto;
        border: 0;
        background: transparent;
        color: var(--text-primary);
    }

    .unlock-modal[open] {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .unlock-modal::backdrop {
        background: rgba(0, 0, 0, 0.78);
        backdrop-filter: blur(4px);
    }

    .unlock-card {
        padding: 40px;
        border: 1px solid var(--border-color);
        border-radius: 16px;
        background: var(--bg-surface);
        text-align: center;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    }

    .unlock-card h1 {
        margin-bottom: 15px;
        color: var(--accent);
        font-size: 26px;
    }

    .unlock-card > p {
        margin-bottom: 25px;
        color: var(--text-secondary);
        font-size: 16px;
        line-height: 1.6;
    }

    .instructions-placeholder {
        margin-bottom: 0;
        padding: 25px;
        border: 1px dashed rgba(255, 255, 255, 0.2);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.04);
        text-align: left;
    }

    .instructions-placeholder h3 {
        margin-top: 0;
        margin-bottom: 10px;
        color: var(--text-primary);
        font-size: 18px;
    }

    .instructions-placeholder ol {
        margin: 0 0 0 20px;
        padding: 0;
        color: var(--text-secondary);
        line-height: 1.8;
    }

    .unlock-emoji {
        font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
        font-variant-emoji: emoji;
    }

    @media (max-width: 600px) {
        .unlock-card {
            padding: 28px 20px;
        }

        .instructions-placeholder {
            padding: 18px;
        }
    }
    .kinovia-link {
        color: var(--accent);
        font-weight: 600;
        position: relative;
        text-decoration: none;
        transition: color 0.2s ease;
    }

    .kinovia-link::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: -2px;
        width: 100%;
        height: 2px;
        background-color: var(--accent-hover);
        transform: scaleX(0);
        transform-origin: right;
        transition: transform 0.25s ease;
    }

    .kinovia-link:hover {
        color: var(--accent-hover);
    }

.kinovia-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

