:root {
    --bg: #0d0e12;
    --bg-alt: #16181f;
    --card: #1b1e27;
    --border: #2a2d38;
    --text: #e8e9ed;
    --text-dim: #8b8d98;
    --accent: #7c5cff;
    --accent-hover: #9278ff;
    --star: #ffb800;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

header.site-header {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

header.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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

nav a {
    color: var(--text-dim);
    margin-left: 24px;
    font-size: 14px;
    font-weight: 500;
    transition: color .15s;
}

nav a:hover { color: var(--text); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
    padding: 36px 0 60px;
}

.video-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform .18s, border-color .18s;
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

.thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-wrap .no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    font-size: 13px;
}

.gross-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #e0243e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: help;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
    z-index: 2;
}

.gross-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg-alt);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: normal;
    text-align: left;
    box-shadow: 0 4px 16px rgba(0,0,0,.5);
    display: none;
    pointer-events: none;
    z-index: 3;
}

.gross-badge:hover .gross-tooltip,
.gross-badge:focus .gross-tooltip {
    display: block;
}

.gross-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.gross-overlay-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    max-width: 360px;
    text-align: center;
    color: var(--text);
}

.gross-overlay-title {
    font-weight: 700;
    color: #e0243e;
    margin-bottom: 8px;
    font-size: 16px;
}

.gross-overlay-note {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-dim);
    margin: 0 0 6px;
}

.gross-overlay-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 16px 0 12px;
}

.gross-overlay-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    font-size: 12px;
    color: var(--text-dim);
    cursor: pointer;
}

.gross-overlay-remember input {
    width: auto;
    margin: 0;
}

.continue-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.continue-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    max-width: 340px;
    text-align: center;
    color: var(--text);
}

.continue-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}

.continue-box p {
    color: var(--text-dim);
    font-size: 13px;
    margin: 0 0 16px;
}

.continue-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ==== Toggle switch (Gross RP zapnout, vynutit stažení chatu, atd.) ==== */
.toggle-switch,
.field .toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .toggle-track {
    display: inline-block;
    flex: 0 0 auto;
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 999px;
    position: relative;
    transition: background .15s ease;
}

.toggle-switch .toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
}

.toggle-switch input:checked + .toggle-track {
    background: #e0243e;
}

.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(18px);
}

.toggle-switch input:focus-visible + .toggle-track {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.toggle-switch .toggle-label {
    font-size: 14px;
}

.toggle-switch.toggle-small .toggle-track {
    display: inline-block;
    width: 32px;
    height: 18px;
}

.toggle-switch.toggle-small .toggle-track::after {
    width: 14px;
    height: 14px;
}

.toggle-switch.toggle-small input:checked + .toggle-track::after {
    transform: translateX(14px);
}

.toggle-switch.toggle-small .toggle-label {
    font-size: 12px;
    color: var(--text-dim);
}

.gross-overlay-remember.toggle-switch {
    justify-content: center;
    margin: 0 auto;
}

/* ==== Gross RP - přidávání úseků v adminu ==== */
.gross-range-inputs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gross-range-inputs input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    min-width: 120px;
}

.gross-range-inputs input:focus {
    border-color: var(--accent);
}

.gross-ranges-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gross-range-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px 8px 12px;
    font-size: 13px;
}

.gross-range-time {
    flex: 0 0 auto;
    color: var(--text-dim);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.gross-range-note-input {
    flex: 1;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    min-width: 0;
}

.gross-range-note-input:focus {
    border-color: var(--accent);
}

.gross-range-remove {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 6px;
    flex: 0 0 auto;
}

.gross-range-remove:hover {
    color: #ff9a9a;
    background: #3a1a1a;
}

/* ==== Modal na e-mail nahlašovatele (report_playback) ==== */
.report-email-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.report-email-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 26px;
    max-width: 380px;
    width: 100%;
    color: var(--text);
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}

.report-email-title {
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 6px;
}

.report-email-box p {
    color: var(--text-dim);
    font-size: 13px;
    margin: 0 0 16px;
    line-height: 1.4;
}

.report-email-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease;
}

.report-email-input:focus {
    border-color: var(--accent);
}

.report-email-input.invalid {
    border-color: #e0243e;
}

.report-email-error {
    min-height: 18px;
    color: #ff9a9a;
    font-size: 12px;
    margin-top: 6px;
}

.report-email-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.btn-secondary:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

/* ==== Ikonka nastavení v hlavičce ==== */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    transition: color .15s ease, transform .2s ease;
}

.icon-btn:hover {
    color: var(--text);
    transform: rotate(30deg);
}

.settings-page {
    max-width: 480px;
    padding-top: 32px;
    padding-bottom: 60px;
}

.page-title {
    font-size: 22px;
    margin-bottom: 24px;
}

/* ==== Segmented control (Gross RP: zobrazovat / zeptat se / nezobrazovat) ==== */
.segmented {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.segmented-btn {
    flex: 1;
    background: var(--bg-alt);
    color: var(--text-dim);
    border: none;
    padding: 10px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    border-right: 1px solid var(--border);
}

.segmented-btn:last-child { border-right: none; }

.segmented-btn:hover { color: var(--text); }

.segmented-btn.active {
    background: #e0243e;
    color: #fff;
}

/* ==== Světlý režim ==== */
[data-theme="light"] {
    --bg: #f4f5f7;
    --bg-alt: #ffffff;
    --card: #ffffff;
    --border: #dcdee3;
    --text: #1b1c20;
    --text-dim: #6b6d78;
    --accent: #7c5cff;
    --accent-hover: #6a48f0;
}

.card-body { padding: 14px 16px 16px; }

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-date {
    font-size: 12px;
    color: var(--text-dim);
    margin: 0 0 8px;
}

.rating-line {
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.rating-line .stars-mini { color: var(--star); }

.video-page {
    padding: 32px 0 60px;
}

.player-wrap {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

.player-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.video-title {
    font-size: 26px;
    font-weight: 700;
    margin: 22px 0 4px;
}

.video-date {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 10px;
}

.report-btn {
    background: #e0243e;
    color: #fff;
    border: 1px solid #e0243e;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    margin: 14px 0 4px;
    transition: background .15s, border-color .15s;
}

.report-btn:hover:not(:disabled) {
    background: #c01f34;
    border-color: #c01f34;
}

.report-btn:disabled {
    cursor: default;
    opacity: 0.6;
}

.rating-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.stars {
    display: flex;
    gap: 4px;
    font-size: 28px;
    cursor: pointer;
}

.stars .star {
    color: #3a3d4a;
    transition: color .1s, transform .1s;
}

.stars .star:hover { transform: scale(1.15); }
.stars .star.filled { color: var(--star); }

.rating-summary {
    color: var(--text-dim);
    font-size: 14px;
}

.rating-summary b { color: var(--text); }

.voted-msg {
    color: var(--accent-hover);
    font-size: 13px;
    display: none;
    align-items: center;
    gap: 8px;
}

.admin-wrap {
    max-width: 560px;
    margin: 60px auto;
    padding: 0 20px;
}

.admin-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
}

.admin-card h1 {
    font-size: 20px;
    margin: 0 0 22px;
}

.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.field input,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* ==== Banner oznámení ==== */
.site-banner {
    width: 100%;
}

.site-banner-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.site-banner-icon {
    font-size: 16px;
    flex: 0 0 auto;
}

.site-banner-text {
    line-height: 1.4;
}

/* ==== FAQ ==== */
.faq-page {
    max-width: 720px;
    padding: 32px 20px 60px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.faq-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
}

.faq-question {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 15px;
}

.faq-answer {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.6;
}

.faq-admin-item {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    margin-top: 18px;
}

/* ==== Footer ==== */
.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--border);
    padding: 24px 0;
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.6;
}

.btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

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

.error-msg {
    background: #3a1a1a;
    border: 1px solid #6b2a2a;
    color: #ff9a9a;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.success-msg {
    background: #16311f;
    border: 1px solid #2a6b3a;
    color: #9affb0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.admin-list {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.admin-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.admin-row.dragging {
    position: fixed;
    z-index: 999;
    margin: 0;
    box-shadow: 0 14px 32px rgba(0,0,0,.5);
    border-color: var(--accent);
    cursor: grabbing;
    pointer-events: none;
}

.admin-row-placeholder {
    border: 2px dashed var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    background: transparent;
}

.drag-handle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    cursor: grab;
    padding: 4px;
    border-radius: 6px;
    touch-action: none;
    transition: color .15s ease, background .15s ease;
}

.drag-handle:hover {
    color: var(--text);
    background: var(--bg);
}

.admin-row.dragging .drag-handle {
    color: var(--accent);
    cursor: grabbing;
}

.admin-row img {
    width: 90px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    background: #000;
}

.admin-row .info { flex: 1; }
.admin-row .info .t { font-weight: 600; font-size: 14px; }
.admin-row .info .u { color: var(--text-dim); font-size: 12px; }

.top-bar-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
    margin: 30px auto 0;
    padding: 0 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

/* Stream layout - video vlevo, chat vpravo (jako Kick/Twitch).
   Flexbox místo gridu - spolehlivější, chat-panel nemá "height:100%"
   proti nedefinované výšce řádku, což dřív mohlo způsobit kolaps/zalomení. */
.stream-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
}

.player-col {
    flex: 1 1 480px;
    min-width: 280px;
}

.stream-layout .player-wrap {
    aspect-ratio: 16/9;
    width: 100%;
}

.chat-panel {
    flex: 0 0 340px;
    width: 340px;
    height: 480px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 860px) {
    .chat-panel {
        flex: 1 1 100%;
        width: 100%;
        height: 360px;
    }
}

.chat-header {
    padding: 12px 14px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.chat-msg {
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.chat-user {
    font-weight: 700;
}

.chat-text {
    color: var(--text);
}

.chat-emote {
    height: 22px;
    width: auto;
    vertical-align: middle;
    display: inline-block;
    margin: -2px 1px;
}

.hint {
    font-size: 12px;
    color: var(--text-dim);
    margin: 6px 0 0;
}

.type-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--border);
    color: var(--text-dim);
    margin-left: 6px;
    vertical-align: middle;
}

.type-badge.type-mp4 {
    background: #2a1e4a;
    color: #b9a3ff;
}

/* Video.js témování pod barvy webu */
/* Video.js web-components (@videojs/html) - video-player má podle docs display:contents,
   takže layout/rozměry musí zajistit video-skin + video uvnitř */
video-player,
video-skin {
    display: block;
    width: 100%;
    height: 100%;
}

.player-wrap video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.player-wrap video-skin video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

/* Komentáře */
.comments-section {
    margin-top: 36px;
}

.comments-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
}

.comment-form {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 22px;
}

.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}

.comment-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent-hover);
}

.comment-date {
    font-size: 12px;
    color: var(--text-dim);
}

.comment-content {
    font-size: 14px;
    color: var(--text);
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* ==== SPOILER tlačítko ve formuláři ==== */
.spoiler-toggle-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.spoiler-toggle-btn[data-active="true"] {
    background: #e0243e;
    border-color: #e0243e;
    color: #fff;
}

/* ==== Skrytý spoiler komentář ==== */
.comment-spoiler {
    position: relative;
}

.comment-spoiler-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #3a1a1a;
    color: #ff9a9a;
    border: 1px solid #5a2a2a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
}

.comment-spoiler-btn {
    background: #e0243e;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}

.comment-spoiler-btn:hover {
    background: #c01f34;
}

.comment-spoiler-body {
    display: none;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text);
    white-space: pre-wrap;
}

.comment-spoiler[data-revealed="true"] .comment-spoiler-warning {
    display: none;
}

.comment-spoiler[data-revealed="true"] .comment-spoiler-body {
    display: block;
}

/* ==== YouTube embed player ==== */
.player-wrap #ytPlayer {
    width: 100%;
    height: 100%;
}
