/* Hoca TV — giriş ve mod seçim ekranı. Renkler brand.css değişkenlerinden gelir. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--brand-ink); font-family: "Segoe UI", Arial, sans-serif; overflow-x: hidden; }

.mode-tabs { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1100; display: flex; gap: 4px; }
.mode-tab { color: #b8c5dd; text-decoration: none; font-size: 13px; font-weight: 700; }

.race-logo { position: fixed; left: 50%; transform: translateX(-50%); z-index: 1050; color: #fff; font-size: 22px; font-weight: 900; }
.race-logo span { color: var(--brand-cyan); }

.tv-overlay {
    position: fixed; inset: 0; display: grid; place-items: center; padding: 100px 20px 40px;
    background: radial-gradient(circle at 50% 15%, rgba(255, 212, 94, .16), transparent 38%),
                linear-gradient(180deg, rgba(10, 14, 26, .7), rgba(3, 5, 12, .95));
    backdrop-filter: blur(10px);
    animation: tvFadeIn .35s ease both;
}
.tv-overlay.hidden { display: none; }
@keyframes tvFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes tvCardIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.tv-card { animation: tvCardIn .4s cubic-bezier(.2, .8, .2, 1) both; }

.tv-card {
    width: min(880px, 100%);
    border: 1px solid var(--brand-line);
    border-radius: 24px;
    padding: 40px clamp(20px, 4vw, 48px);
    background: radial-gradient(circle at 100% 0, rgba(255, 212, 94, .08), transparent 30%),
                linear-gradient(150deg, rgba(22, 34, 57, .97), rgba(6, 11, 22, .98));
    box-shadow: 0 35px 110px rgba(0, 0, 0, .58), inset 0 1px rgba(255, 255, 255, .07);
    color: var(--brand-text);
    text-align: center;
}
.tv-card .eyebrow { color: var(--brand-cyan); font-size: 12px; font-weight: 900; letter-spacing: 3px; margin-bottom: 6px; }
.tv-card h1 { margin: 0 0 10px; font-family: var(--brand-display-font); font-size: clamp(28px, 4vw, 42px); }
.tv-sub { color: var(--brand-muted); margin: 0 0 28px; font-size: 14px; }

.tv-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 28px; }
.tv-mode-card {
    display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 6px;
    padding: 22px; border-radius: 17px; cursor: pointer;
    border: 1px solid rgba(123, 175, 226, .17);
    background: linear-gradient(155deg, rgba(27, 39, 65, .94), rgba(7, 13, 25, .98));
    color: var(--brand-text); font-family: inherit;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.tv-mode-card:hover { transform: translateY(-4px); }
.tv-mode-card:focus-visible { outline: 2px solid var(--brand-cyan); outline-offset: 2px; }
.tv-mode-card.active {
    border-color: var(--brand-cyan);
    box-shadow: 0 0 0 3px rgba(95, 244, 238, .09), 0 15px 35px rgba(0, 0, 0, .36);
}
.tv-mode-icon { font-size: 28px; }
.tv-mode-card strong { font-size: 18px; }
.tv-mode-card small { color: var(--brand-cyan); font-size: 11px; font-weight: 700; letter-spacing: .3px; }
.tv-mode-card p { margin: 4px 0 0; color: var(--brand-muted); font-size: 13px; line-height: 1.5; }

#tvStartBtn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 34px; border: none; border-radius: 13px; font-size: 15px; font-weight: 800;
    cursor: pointer; letter-spacing: .7px;
    background: linear-gradient(115deg, var(--brand-cyan), #89f2dd 48%, var(--brand-gold));
    box-shadow: 0 13px 35px rgba(58, 231, 225, .2);
    transition: transform .2s, filter .2s, opacity .2s;
}
#tvStartBtn:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.08); }
#tvStartBtn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }

.tv-error {
    margin: 16px 0 0; padding: 10px 16px; border-radius: 10px; font-size: 13px;
    color: #ffb4b4; background: rgba(255, 90, 90, .1); border: 1px solid rgba(255, 90, 90, .3);
}
.tv-error.hidden { display: none; }

/* Video ekranı — ana odak her zaman video, gereksiz öğe yok. */
.tv-player-screen { position: fixed; inset: 0; display: flex; flex-direction: column; background: #000; }
.tv-player-screen.hidden { display: none; }
.tv-player-wrap { flex: 1; position: relative; padding-top: 70px; }
.tv-player-wrap #tvPlayerFrame { position: absolute; inset: 70px 0 0 0; width: 100%; height: calc(100% - 70px); }
/* İmza rozetindeki backdrop-filter:blur, oynayan videonun arkasında sürekli
   yeniden hesaplanıp gözle görülür kasmaya yol açıyordu — video ekranındayken
   tamamen gizlenir (aynı zamanda dokümanın "video ana odak olsun" kuralına uyar). */
body.tv-playing .creator-signature { display: none; }

.tv-status-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 18px; background: rgba(6, 10, 20, .92); border-top: 1px solid var(--brand-line);
}
.tv-status-badge {
    font-size: 12px; font-weight: 800; letter-spacing: .4px; color: var(--brand-text);
    padding: 6px 14px; border-radius: 999px; border: 1px solid var(--brand-line);
    background: linear-gradient(135deg, rgba(55, 219, 218, .18), rgba(85, 102, 255, .22));
}
.tv-kick-status.hidden { display: none; }
.tv-kick-status.tv-kick-connected { background: linear-gradient(135deg, rgba(80, 220, 130, .2), rgba(30, 200, 100, .22)); border-color: rgba(90, 230, 140, .4); }
.tv-kick-status.tv-kick-disconnected { background: linear-gradient(135deg, rgba(255, 90, 90, .18), rgba(200, 40, 40, .2)); border-color: rgba(255, 120, 120, .4); animation: tvPulseWarn 1.6s ease-in-out infinite; }
@keyframes tvPulseWarn { 50% { opacity: .55; } }

.tv-skip-btn {
    padding: 8px 16px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .06); color: var(--brand-text); font-size: 13px; font-weight: 700; cursor: pointer;
}
.tv-skip-btn:hover { background: rgba(255, 255, 255, .12); }
.tv-status-spacer { flex: 1; }

/* Öneri (oylama) ekranı. */
.tv-suggest-card { width: min(1100px, 100%); }
.tv-suggest-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.tv-suggest-item {
    position: relative; border-radius: 15px; padding: 14px; text-align: left;
    border: 1px solid rgba(123, 175, 226, .17);
    background: linear-gradient(155deg, rgba(27, 39, 65, .94), rgba(7, 13, 25, .98));
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.tv-suggest-item:hover { transform: translateY(-4px); border-color: rgba(100, 244, 235, .4); box-shadow: 0 14px 34px rgba(0, 0, 0, .4); }
.tv-suggest-item.tv-leading { border-color: var(--brand-gold); box-shadow: 0 0 0 2px rgba(255, 212, 94, .25), 0 15px 35px rgba(0, 0, 0, .4); }
.tv-vote-count { display: inline-block; transition: transform .15s; }
.tv-vote-bump { animation: tvVoteBump .3s ease; }
@keyframes tvVoteBump { 0% { transform: scale(1); } 40% { transform: scale(1.5); color: var(--brand-gold); } 100% { transform: scale(1); } }
.tv-suggest-num {
    position: absolute; top: 10px; left: 10px; width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 900; font-size: 13px; color: #061018;
    background: linear-gradient(115deg, var(--brand-cyan), var(--brand-gold)); z-index: 2;
}
.tv-suggest-thumb { width: 100%; border-radius: 9px; display: block; aspect-ratio: 16/9; object-fit: cover; background: #111; }
.tv-suggest-title { margin-top: 8px; font-size: 13px; font-weight: 700; line-height: 1.35; max-height: 3.6em; overflow: hidden; }
.tv-suggest-channel { margin-top: 4px; font-size: 11px; color: var(--brand-muted); }
.tv-suggest-votes { margin-top: 8px; font-size: 12px; color: var(--brand-cyan); font-weight: 800; }
.tv-demo-vote-btn {
    margin-top: 8px; width: 100%; padding: 7px; border-radius: 8px; border: 1px dashed rgba(255, 212, 94, .5);
    background: rgba(255, 212, 94, .08); color: var(--brand-gold); font-size: 11px; font-weight: 700; cursor: pointer;
}

/* Otomatik geçiş ekranı. */
.tv-transition-card { display: flex; flex-direction: column; align-items: center; }
.tv-spinner {
    width: 46px; height: 46px; border-radius: 50%; margin-bottom: 18px;
    border: 4px solid rgba(95, 244, 238, .18); border-top-color: var(--brand-cyan);
    animation: tvSpin 1s linear infinite;
}
@keyframes tvSpin { to { transform: rotate(360deg); } }

/* Geçici bildirimler (video atlandı, hata vb.) — hangi ekran açık olursa olsun üstte belirir. */
.tv-toast {
    position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 2000;
    max-width: min(520px, calc(100vw - 40px)); padding: 12px 20px; border-radius: 999px;
    border: 1px solid rgba(255, 212, 94, .4); background: rgba(20, 16, 8, .94); color: #ffe9a8;
    font-size: 13px; font-weight: 700; text-align: center; box-shadow: 0 18px 45px rgba(0, 0, 0, .5);
    animation: tvToastIn .25s ease both;
}
.tv-toast.hidden { display: none; }
@keyframes tvToastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%); } }

@media (max-width: 760px) {
    .tv-mode-grid { grid-template-columns: 1fr; }
    .tv-overlay { padding-top: 130px; }
    .tv-suggest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    .tv-mode-card, #tvStartBtn, .tv-suggest-item { transition: none; }
    .tv-spinner { animation: none; }
    .tv-overlay, .tv-card, .tv-toast { animation: none; }
}
