:root {
    color-scheme: dark;
    --bg: #090d16;
    --surface: #111827;
    --surface-light: #182235;
    --border: rgba(255,255,255,.08);
    --text: #f3f6fc;
    --muted: #8995a9;
    --accent: #648cff;
    --accent-light: #8ba8ff;
}

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

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 76px;
    padding: 0 7%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(9,13,22,.9);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 2px;
}

.brand-icon {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg,#7598ff,#4265d7);
    font-size: 21px;
    color: white;
}

.brand-light {
    color: var(--muted);
    font-weight: 500;
}

.connection-status {
    color: var(--muted);
    font-size: 12px;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: #45d69a;
}

.main-content {
    width: min(100% - 40px, 1000px);
    margin: 0 auto;
    flex: 1;
}

.welcome {
    padding: 85px 0 48px;
}

.eyebrow {
    color: var(--accent-light);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
}

.welcome h1 {
    margin-top: 18px;
    font-size: clamp(42px,7vw,66px);
    line-height: 1.08;
    letter-spacing: -3px;
}

.welcome h1 span {
    color: var(--accent-light);
}

.welcome p {
    max-width: 520px;
    margin-top: 20px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 15px;
}

.search-panel,
.results-section,
.player-section {
    margin-bottom: 28px;
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 17px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.section-heading h2 {
    font-size: 17px;
    font-weight: 650;
}

.muted,
.result-count {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 1.5px;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 7px 8px 7px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 11px;
}

.input-icon {
    color: var(--accent-light);
    font-size: 20px;
}

.search-input-wrap input {
    min-width: 0;
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: white;
    font-size: 14px;
}

.search-input-wrap button {
    padding: 13px 22px;
    background: var(--accent);
    color: white;
    border: 0;
    border-radius: 8px;
    font-weight: 650;
    cursor: pointer;
}

.search-input-wrap button:hover {
    background: var(--accent-light);
}

.search-hint {
    margin-top: 13px;
    color: var(--muted);
    font-size: 11px;
}

.empty-state {
    padding: 45px 15px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 12px;
}

.empty-icon {
    margin-bottom: 14px;
    color: var(--accent-light);
    font-size: 35px;
}

.empty-state h3 {
    font-size: 15px;
}

.empty-state p {
    margin-top: 9px;
    color: var(--muted);
    font-size: 12px;
}

.player-placeholder {
    min-height: 270px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #05080e;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--muted);
    font-size: 13px;
}

.play-icon {
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    padding-left: 4px;
    border-radius: 50%;
    background: var(--surface-light);
    color: var(--accent-light);
    font-size: 19px;
}

footer {
    display: flex;
    justify-content: space-between;
    padding: 25px 7%;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 1.5px;
}

@media (max-width: 600px) {
    .topbar {
        padding: 0 20px;
    }

    .welcome {
        padding-top: 55px;
    }

    .search-panel,
    .results-section,
    .player-section {
        padding: 18px;
    }

    .search-input-wrap {
        flex-wrap: wrap;
    }

    .search-input-wrap input {
        width: calc(100% - 50px);
    }

    .search-input-wrap button {
        width: 100%;
    }
}

/* PREHRAJ.TO INTEGRATED CATALOG */
.catalog-section {
    margin-top: 36px;
}

.catalog-frame-wrap {
    width: 100%;
    height: 850px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background: #101827;
}

#prehraj-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

@media (max-width: 768px) {
    .catalog-frame-wrap {
        height: 700px;
        border-radius: 10px;
    }
}

/* WIDE XENOS PLAYER LAYOUT */
.main-content {
    width: calc(100% - 48px);
    max-width: none;
}

.catalog-frame-wrap {
    height: 1100px;
}

#prehraj-frame {
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .main-content {
        width: calc(100% - 24px);
    }

    .catalog-frame-wrap {
        height: 850px;
    }
}

/* WIDE XENOS PLAYER LAYOUT */
.main-content {
    width: calc(100% - 48px);
    max-width: none;
}

.catalog-frame-wrap {
    height: 1100px;
}

#prehraj-frame {
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .main-content {
        width: calc(100% - 24px);
    }

    .catalog-frame-wrap {
        height: 850px;
    }
}

/* ==========================================
   XENOS PLAYER – MEDIA INTERFACE
========================================== */

.player-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 280px;
    overflow: hidden;
    background: #03060b;
    border: 1px solid var(--border);
    border-radius: 13px;
}

#xenos-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #03060b;
}

#player-placeholder {
    position: absolute;
    inset: 0;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: #03060b;
}

#player-placeholder[hidden] {
    display: none;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px 4px;
}

.player-label {
    color: var(--accent-light);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
}

.player-info h3 {
    margin-top: 8px;
    font-size: 16px;
}

.player-info p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.player-actions button,
.xenos-play-source {
    padding: 11px 17px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-light);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}

.player-actions button:not(:disabled):hover,
.xenos-play-source:hover {
    background: var(--accent);
}

.player-actions button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.player-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.player-options label {
    display: flex;
    flex-direction: column;
    gap: 9px;
    color: var(--muted);
    font-size: 11px;
}

.player-options select {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
}

.xenos-source-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 17px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 11px;
}

.xenos-source-card strong {
    font-size: 13px;
}

.xenos-source-card span {
    color: var(--muted);
    font-size: 11px;
}

.xenos-play-source {
    background: var(--accent);
    border: 0;
}

.xenos-subtitle-link {
    display: inline-block;
    margin: 8px 10px 8px 0;
    color: var(--accent-light);
    font-size: 12px;
}

@media (max-width: 600px) {
    .player-screen {
        min-height: 210px;
    }

    .player-info {
        align-items: flex-start;
        flex-direction: column;
    }

    .player-options {
        grid-template-columns: 1fr;
    }

    .xenos-source-card {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* XENOS – KOMPAKTNÍ KATALOG */
.catalog-frame-wrap {
    height: 380px !important;
}

@media (max-width: 768px) {
    .catalog-frame-wrap {
        height: 300px !important;
    }
}


/* XENOS MOBILE CAPTURE */
.mobile-capture-section {
    margin: 22px 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}
.mobile-capture-section p {
    color: var(--muted);
    line-height: 1.55;
}
#mobile-bookmarklet {
    display: block;
    width: 100%;
    margin: 12px 0;
    padding: 12px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 9px;
    font: 12px/1.5 monospace;
    overflow-wrap: anywhere;
    resize: vertical;
}
#copy-mobile-bookmarklet {
    padding: 11px 16px;
    color: white;
    background: var(--accent);
    border: 0;
    border-radius: 9px;
    font-weight: 600;
}
.mobile-capture-hint {
    font-size: 13px;
}
#mobile-capture-status {
    font-size: 13px;
}



.search-results {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.search-results:empty {
    display: none;
}

.search-result-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 20px 22px;
    overflow: hidden;
    background: linear-gradient(115deg, var(--bg), rgba(255,255,255,0.025));
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

.search-result-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--accent);
    opacity: .65;
    transition: opacity .2s ease;
}

.search-result-card:hover {
    border-color: var(--accent);
    background: linear-gradient(115deg, var(--bg), rgba(255,255,255,0.045));
    transform: translateY(-2px);
}

.search-result-card:hover::before {
    opacity: 1;
}

.search-result-info {
    min-width: 0;
    flex: 1;
}

.search-result-title {
    color: white;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.5;
    overflow-wrap: anywhere;
    letter-spacing: .1px;
}

.search-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
    color: var(--muted);
    font-size: 11px;
}

.search-result-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 6px;
    font-weight: 550;
}

.search-result-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 120px;
    padding: 11px 17px;
    color: white;
    background: var(--accent);
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.search-result-button::before {
    content: "▶";
    margin-right: 9px;
    font-size: 10px;
}

.search-result-button:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.search-result-button:disabled {
    opacity: .6;
    cursor: wait;
    transform: none;
}

.search-results-message {
    padding: 15px 18px;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
}

@media (max-width: 600px) {
    .search-results {
        gap: 10px;
    }

    .search-result-card {
        align-items: stretch;
        flex-direction: column;
        gap: 15px;
        padding: 17px;
    }

    .search-result-title {
        font-size: 14px;
    }

    .search-result-button {
        width: 100%;
        min-height: 43px;
    }
}



/* XENOS PLAYER – filmová mřížka */
.search-results {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    align-items: start;
    gap: 18px;
}

.search-results-message {
    grid-column: 1 / -1;
}

.search-result-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
    border-radius: 13px;
    background: var(--bg);
}

.search-result-card::before {
    display: none;
}

.search-result-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #171b22;
}

.search-result-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .2s ease, transform .3s ease;
}

.search-result-card.has-preview .search-result-image {
    opacity: 1;
}

.search-result-card.has-preview .search-result-placeholder {
    display: none;
}

.search-result-card.no-preview .search-result-placeholder {
    color: var(--muted);
}

.search-result-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8993a3;
    font-size: 12px;
}

.search-result-card:hover .search-result-image {
    transform: scale(1.04);
}

.search-result-info {
    flex: 1;
    padding: 14px 14px 8px;
}

.search-result-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    min-height: 42px;
    font-size: 14px;
}

.search-result-meta {
    gap: 5px;
    margin-top: 9px;
}

.search-result-meta span {
    min-height: 23px;
    padding: 3px 7px;
    font-size: 10px;
}

.search-result-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    min-height: 25px;
    align-items: center;
    margin-top: 11px;
    color: var(--muted);
    font-size: 12px;
}

.rating-like {
    color: #70ce91;
    font-weight: 650;
}

.rating-dislike {
    color: #e58b8b;
    font-weight: 650;
}

.search-result-button {
    width: auto;
    min-height: 42px;
    margin: 0 14px 14px;
}

@media (min-width: 601px) {
    .search-results {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    }
}

@media (max-width: 600px) {
    .search-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px;
    }

    .search-result-card {
        padding: 0;
        gap: 0;
    }

    .search-result-info {
        padding: 10px 9px 6px;
    }

    .search-result-title {
        font-size: 12px;
        min-height: 38px;
    }

    .search-result-meta {
        gap: 4px;
    }

    .search-result-meta span {
        font-size: 9px;
        padding: 3px 5px;
    }

    .search-result-ratings {
        gap: 8px;
        font-size: 10px;
        margin-top: 8px;
    }

    .search-result-button {
        width: auto;
        min-height: 39px;
        margin: 0 9px 10px;
        padding: 9px 6px;
        font-size: 11px;
    }
}


/* XENOS – KOMPAKTNÍ VÝBĚR KVALITY */
.results-section {
    display: none !important;
}

.player-options {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.quality-control {
    position: relative;
}

.quality-control summary {
    cursor: pointer;
    list-style: none;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg);
    color: var(--text);
    font-size: 12px;
    user-select: none;
}

.quality-control summary::-webkit-details-marker {
    display: none;
}

.quality-control[open] summary {
    border-color: var(--accent);
}

.quality-menu {
    position: absolute;
    z-index: 20;
    right: 0;
    top: calc(100% + 8px);
    width: 220px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

.quality-menu label {
    display: block;
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 11px;
}

.quality-menu select {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg);
    color: var(--text);
}

@media (max-width: 600px) {
    .player-options {
        justify-content: space-between;
    }
}

/* ==========================================
   XENOS PLAYER – PREMIUM HOME REDESIGN
========================================== */

[hidden] {
    display: none !important;
}

.main-content {
    width: min(100% - 32px, 1100px);
}

.search-panel-home {
    max-width: 780px;
    margin: clamp(65px, 13vh, 130px) auto 35px;
    padding: 24px 20px;
    background: transparent;
    border: 0;
    text-align: center;
}

.hero-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 17px;
    margin-bottom: 48px;
}

.hero-mark {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 21px;
    color: #fff;
    font-size: 39px;
    font-weight: 900;
    background: linear-gradient(145deg, #83a5ff, #345bd5);
    box-shadow: 0 0 35px rgba(83, 125, 255, .32);
}

.hero-brand h1 {
    color: #f7f9ff;
    font-size: clamp(31px, 6vw, 48px);
    font-weight: 850;
    letter-spacing: 5px;
    text-shadow: 0 0 35px rgba(100, 140, 255, .2);
}

.hero-brand h1 span {
    color: #83a5ff;
}

.search-heading {
    margin-bottom: 19px;
    color: #f3f6fc;
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -.4px;
}

.search-panel-home form {
    max-width: 650px;
    margin: 0 auto;
}

.search-input-wrap {
    min-height: 62px;
    padding: 7px 8px 7px 19px;
    gap: 13px;
    background: #111a2a;
    border: 1px solid rgba(132, 164, 255, .2);
    border-radius: 16px;
    box-shadow: 0 12px 45px rgba(0, 0, 0, .25),
                0 0 25px rgba(75, 112, 220, .07);
    transition: border-color .2s, box-shadow .2s;
}

.search-input-wrap:focus-within {
    border-color: rgba(120, 155, 255, .7);
    box-shadow: 0 0 0 3px rgba(100, 140, 255, .1),
                0 12px 45px rgba(0, 0, 0, .3);
}

.input-icon {
    font-size: 0;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    position: relative;
}

.input-icon::before {
    content: "";
    position: absolute;
    width: 11px;
    height: 11px;
    border: 2px solid #8ba8ff;
    border-radius: 50%;
    left: 1px;
    top: 1px;
}

.input-icon::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 2px;
    background: #8ba8ff;
    transform: rotate(45deg);
    left: 12px;
    top: 14px;
    border-radius: 2px;
}

.search-input-wrap input {
    font-size: 14px;
}

.search-input-wrap button {
    min-width: 100px;
    padding: 13px 20px;
    border-radius: 11px;
    background: linear-gradient(135deg, #7397ff, #456be0);
    box-shadow: 0 5px 18px rgba(73, 109, 225, .25);
    transition: transform .2s, box-shadow .2s;
}

.search-input-wrap button:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 23px rgba(73, 109, 225, .38);
}

.search-hint {
    margin-top: 17px;
    color: #748198;
    font-size: 11px;
}

.player-section {
    margin-top: 35px;
}

@media (max-width: 600px) {
    .search-panel-home {
        margin-top: 75px;
        padding: 15px 0;
    }

    .hero-brand {
        margin-bottom: 39px;
    }

    .hero-mark {
        width: 58px;
        height: 58px;
        font-size: 34px;
    }

    .hero-brand h1 {
        letter-spacing: 3px;
    }

    .search-heading {
        font-size: 19px;
    }

    .search-input-wrap {
        min-height: 57px;
        padding-left: 13px;
        gap: 9px;
    }

    .search-input-wrap input {
        font-size: 12px;
    }

    .search-input-wrap button {
        min-width: 76px;
        padding: 12px 13px;
        font-size: 12px;
    }
}


/* XENOS – SVG VIDEO RATINGS */
.search-result-ratings {
    gap: 16px;
}

.rating-like,
.rating-dislike {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 650;
}

.rating-like {
    color: #70ce91;
}

.rating-dislike {
    color: #e58b8b;
}

.search-result-ratings svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

