/* شاشة التلفاز — عرض كبير */
html.qtv-html, .qtv-body { height: 100%; margin: 0; overflow: hidden; }
.qtv {
    height: 100vh; height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 0; overflow: hidden;
}
/* يُقاس المحتوى ثم يُكبَّر/يُصغَّر بالـ JS ليملأ الشاشة كاملاً دون تمرير أو إخفاء */
.qtv-stage {
    width: 100%; max-width: 1400px;
    transform-origin: center center;
    will-change: transform;
}

.qtv-loader { text-align: center; color: var(--qonline-muted); }
.qtv-loader__icon { font-size: 80px; animation: qtv-pulse 1.4s ease-in-out infinite; }
.qtv-loader__text { margin-top: 16px; font-size: 1.4rem; }
@keyframes qtv-pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

/* ===== اقتران ===== */
.qtv-pair { text-align: center; }
.qtv-pair__brand { color: var(--qonline-sky); font-size: 1.6rem; font-weight: 800; margin-bottom: 10px; }
.qtv-pair__title { font-size: clamp(1.8rem, 4vw, 3.2rem); margin: 0 0 24px; }
.qtv-qr {
    display: inline-block; background: #fff; padding: 18px; border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.qtv-qr canvas, .qtv-qr img { display: block; }
.qtv-pair__hint { color: var(--qonline-muted); font-size: clamp(1rem, 1.6vw, 1.4rem); margin: 24px auto 16px; max-width: 640px; }
.qtv-reset { width: auto; }

/* ===== لوبي ===== */
.qtv-lobby { display: flex; gap: 5vw; align-items: center; justify-content: center; flex-wrap: wrap; }
.qtv-lobby__main { text-align: center; }
.qtv-lobby__title { font-size: clamp(2rem, 4.5vw, 3.6rem); margin: 0 0 8px; }
.qtv-lobby__sub { color: var(--qonline-muted); font-size: clamp(1rem, 1.8vw, 1.5rem); margin: 0 0 20px; }
.qtv-code { font-size: clamp(1.2rem, 2vw, 1.8rem); margin-top: 18px; }
.qtv-code b { color: var(--qonline-gold); letter-spacing: 4px; }
.qtv-lobby__side { min-width: 280px; }
.qtv-side__title { font-size: clamp(1.2rem, 2vw, 1.8rem); margin: 0 0 14px; color: var(--qonline-sky); }
.qtv-playerlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.qtv-playerlist li {
    background: var(--qonline-surface); border: 1px solid var(--qonline-border);
    border-radius: 14px; padding: 14px 20px; font-size: clamp(1.1rem, 1.8vw, 1.6rem); font-weight: 700;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.qtv-pl__name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.qtv-host { font-size: .7em; background: rgba(56,189,248,.18); color: #bae6fd; padding: 3px 10px; border-radius: 999px; margin-right: 8px; }
.qtv-kick {
    flex: 0 0 auto; width: 1.9em; height: 1.9em; border-radius: 50%;
    border: 1px solid rgba(248,113,113,.5); background: rgba(248,113,113,.14); color: #fca5a5;
    font-size: .8em; font-weight: 900; cursor: pointer; line-height: 1; padding: 0;
    display: inline-flex; align-items: center; justify-content: center; transition: background .15s, transform .1s;
}
.qtv-kick:hover { background: rgba(248,113,113,.3); color: #fff; transform: scale(1.08); }
.qtv-kick:active { transform: scale(.96); }

/* ===== شريط التحكّم (ابدأ من جديد) ===== */
.qtv-controls { position: fixed; top: 18px; left: 18px; z-index: 30; }
.qtv-ctrlbtn {
    background: rgba(15,23,42,.78); color: var(--qonline-text);
    border: 1px solid var(--qonline-border); border-radius: 999px;
    padding: 10px 18px; font-size: clamp(.9rem, 1.4vw, 1.1rem); font-weight: 700;
    cursor: pointer; backdrop-filter: blur(6px); transition: background .15s, transform .1s;
}
.qtv-ctrlbtn:hover { background: rgba(30,41,59,.95); }
.qtv-ctrlbtn:active { transform: scale(.97); }

/* ===== نافذة التأكيد (بديل window.confirm لمتصفحات التلفاز) ===== */
.qtv-modal {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: rgba(2,6,23,.72); backdrop-filter: blur(4px); padding: 4vw;
}
.qtv-modal__box {
    background: #142038; border: 1px solid var(--qonline-border); border-radius: 22px;
    padding: clamp(24px, 4vw, 48px); max-width: 760px; width: 100%; text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.qtv-modal__msg { font-size: clamp(1.3rem, 2.6vw, 2.2rem); font-weight: 800; line-height: 1.5; margin-bottom: clamp(20px, 3vw, 36px); }
.qtv-modal__btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.qtv-modal__btn {
    border-radius: 14px; padding: clamp(12px, 1.8vw, 18px) clamp(24px, 3.5vw, 44px);
    font-size: clamp(1.1rem, 2vw, 1.6rem); font-weight: 800; cursor: pointer;
    border: 1px solid var(--qonline-border); transition: transform .1s, filter .15s;
}
.qtv-modal__btn:active { transform: scale(.96); }
.qtv-modal__yes { background: var(--qonline-gold, #fbbf24); color: #1a1300; border-color: transparent; }
.qtv-modal__yes:hover { filter: brightness(1.08); }
.qtv-modal__no { background: rgba(148,163,184,.16); color: var(--qonline-text); }
.qtv-modal__no:hover { background: rgba(148,163,184,.28); }
.qtv-modal__btn:focus { outline: 3px solid var(--qonline-sky, #38bdf8); outline-offset: 2px; }
.qtv-waiting { color: var(--qonline-muted); font-size: clamp(1rem, 1.6vw, 1.4rem); margin-top: 18px; }

/* ===== مقدمة ===== */
.qtv-intro { text-align: center; }
.qtv-intro__icon { font-size: clamp(60px, 10vw, 140px); }
.qtv-intro__label { color: var(--qonline-muted); font-size: clamp(1.1rem, 2vw, 1.6rem); }
.qtv-intro__name { font-size: clamp(2.4rem, 7vw, 6rem); font-weight: 900; color: var(--qonline-gold); margin: 8px 0; }
.qtv-intro__hint { color: var(--qonline-text); font-size: clamp(1.2rem, 2.4vw, 2rem); }

/* ===== المؤقّت ===== */
.qtv-timer {
    display: inline-block; min-width: 1.6em; text-align: center;
    font-size: clamp(1.6rem, 3vw, 2.6rem); font-weight: 900;
    background: rgba(255,255,255,.07); border: 1px solid var(--qonline-border);
    border-radius: 18px; padding: 6px 22px; margin-top: 16px;
}
.qtv-timer.is-urgent { color: #fca5a5; border-color: rgba(248,113,113,.6); animation: qtv-blink .8s steps(2) infinite; }
@keyframes qtv-blink { 50% { opacity: .4; } }

/* ===== مرحلة الأسئلة ===== */
.qtv-asking { text-align: center; }
.qtv-asking__top { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; margin-bottom: 22px; }
.qtv-subject { font-size: clamp(1.1rem, 2vw, 1.6rem); color: var(--qonline-muted); }
.qtv-subject b { color: var(--qonline-gold); }
.qtv-qprog { font-size: clamp(1.1rem, 2vw, 1.6rem); color: var(--qonline-muted); }
.qtv-bigcard {
    background: linear-gradient(160deg, #1b2a4a, #142038);
    border: 1px solid var(--qonline-border); border-radius: 28px;
    padding: clamp(28px, 5vw, 70px) clamp(20px, 4vw, 60px);
    max-width: 1100px; margin: 0 auto; box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.qtv-bigcard__emoji { font-size: clamp(70px, 12vw, 160px); }
.qtv-bigcard__q { font-size: clamp(1.8rem, 4.5vw, 4rem); font-weight: 900; line-height: 1.4; margin-top: 18px; }
.qtv-answered { font-size: clamp(1.1rem, 2vw, 1.6rem); color: var(--qonline-muted); margin-top: 22px; }
.qtv-dots { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.qtv-dot {
    background: var(--qonline-surface); border: 1px solid var(--qonline-border);
    border-radius: 999px; padding: 8px 18px; font-size: clamp(.95rem, 1.5vw, 1.3rem);
    opacity: .55; transition: all .2s ease;
}
.qtv-dot.is-done { opacity: 1; background: rgba(74,222,128,.16); border-color: rgba(74,222,128,.45); color: #bbf7d0; }
.qtv-dot.is-subject { border-color: var(--qonline-gold); }

/* ===== النتيجة ===== */
.qtv-ended { text-align: center; }
.qtv-ended__icon { font-size: clamp(60px, 9vw, 120px); }
.qtv-ended__title { font-size: clamp(1.8rem, 4vw, 3.4rem); margin: 6px 0 26px; }
.qtv-ranking { list-style: none; padding: 0; margin: 0 auto; max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.qtv-ranking li {
    display: flex; align-items: center; gap: 18px;
    background: var(--qonline-surface); border: 1px solid var(--qonline-border);
    border-radius: 16px; padding: 16px 26px; font-size: clamp(1.2rem, 2.2vw, 1.9rem);
}
.qtv-ranking li.is-top { background: rgba(251,191,36,.14); border-color: rgba(251,191,36,.45); }
.qtv-rank__pos { min-width: 1.6em; font-weight: 900; }
.qtv-rank__name { flex: 1; text-align: right; font-weight: 800; }
.qtv-rank__score { font-weight: 900; color: var(--qonline-gold); }
.qtv-ended__hint { color: var(--qonline-muted); font-size: clamp(1rem, 1.6vw, 1.4rem); margin-top: 26px; }

/* ===== من الجاسوس — تلفاز ===== */
.qtv-pair__btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.qtv-sound { width: auto; }

.qtv-spytv { text-align: center; width: 100%; }
.qtv-spytv__head { margin-bottom: 18px; }
.qtv-spytv__title { font-size: clamp(1.8rem, 4vw, 3.4rem); margin: 0 0 12px; }
.qtv-spytv__sub { color: var(--qonline-muted); font-size: clamp(1.1rem, 2vw, 1.7rem); margin: 10px 0; }
.qtv-spytv__sub b { color: var(--qonline-gold); }
.qtv-spytv__badge {
    display: inline-block; background: rgba(250,204,21,.18); color: #fde68a;
    border-radius: 999px; padding: 6px 20px; font-size: clamp(1rem, 1.6vw, 1.4rem); margin-bottom: 12px;
}
.qtv-spytv__bigemoji { font-size: clamp(70px, 11vw, 150px); }
.qtv-spytv__center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.qtv-spytv__ready, .qtv-spytv__foot { font-size: clamp(1.1rem, 2vw, 1.6rem); color: var(--qonline-muted); margin-top: 14px; }

/* تصويت الصنف */
.qtv-catgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 22px); max-width: 1100px; margin: 0 auto; }
.qtv-cat {
    position: relative; background: var(--qonline-surface); border: 2px solid var(--qonline-border);
    border-radius: 20px; padding: clamp(14px, 2vw, 28px) 10px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.qtv-cat__emoji { font-size: clamp(40px, 6vw, 80px); }
.qtv-cat__label { font-size: clamp(1.1rem, 2vw, 1.8rem); font-weight: 800; }
.qtv-cat__votes {
    position: absolute; top: -14px; inset-inline-start: -14px;
    background: var(--qonline-sky); color: #0b1020; font-weight: 900;
    min-width: 40px; height: 40px; line-height: 40px; border-radius: 999px;
    font-size: clamp(1.1rem, 1.8vw, 1.5rem); box-shadow: 0 6px 16px rgba(0,0,0,.4);
}

/* التنقلات */
.qtv-spytv__turnbar {
    font-size: clamp(1.2rem, 2.2vw, 1.9rem); color: var(--qonline-sky); font-weight: 800;
    margin-bottom: 20px; display: flex; gap: 24px; align-items: center; justify-content: center;
}
.qtv-spytv__ask { font-size: clamp(2rem, 5vw, 4.4rem); font-weight: 900; line-height: 1.3; }
.qtv-spytv__asker { color: var(--qonline-gold); }
.qtv-spytv__target { color: var(--qonline-sky); }
.qtv-spytv__arrow { color: var(--qonline-muted); font-size: .7em; }
.qtv-spytv__players { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 30px; }
.qtv-spytv__pl {
    background: var(--qonline-surface); border: 2px solid var(--qonline-border);
    border-radius: 999px; padding: 10px 24px; font-size: clamp(1rem, 1.6vw, 1.4rem); opacity: .7;
}
.qtv-spytv__pl.is-asker { border-color: var(--qonline-gold); opacity: 1; background: rgba(251,191,36,.14); }
.qtv-spytv__pl.is-target { border-color: var(--qonline-sky); opacity: 1; background: rgba(56,189,248,.14); }
.qtv-spytv__pl.is-voted { opacity: 1; background: rgba(74,222,128,.16); border-color: rgba(74,222,128,.45); }
.qtv-spytv__pl.is-out { opacity: .3; text-decoration: line-through; }

/* طلب الإنهاء */
.qtv-spytv__endreq {
    background: rgba(250,204,21,.10); border: 2px solid rgba(250,204,21,.4);
    border-radius: 24px; padding: clamp(20px, 3vw, 44px); max-width: 1000px; margin: 0 auto;
}

/* النتيجة */
.qtv-spytv__revealword { font-size: clamp(1.6rem, 3.4vw, 3rem); margin: 14px 0; }
.qtv-spytv__revealword b { color: var(--qonline-gold); }
.qtv-spytv__cat { color: var(--qonline-muted); font-size: .65em; }
.qtv-spytv__rolelist { list-style: none; padding: 0; margin: 24px auto 0; max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.qtv-spytv__rolelist li {
    display: flex; align-items: center; gap: 16px;
    background: var(--qonline-surface); border: 1px solid var(--qonline-border);
    border-radius: 16px; padding: 14px 24px; font-size: clamp(1.1rem, 2vw, 1.7rem);
}
.qtv-spytv__rolelist li.is-spy { border-color: rgba(248,113,113,.5); background: rgba(248,113,113,.1); }
.qtv-spytv__rolelist li.is-winner { box-shadow: 0 0 0 2px rgba(251,191,36,.5) inset; }
.qtv-spytv__roleicon { font-size: 1.6em; }
.qtv-spytv__rolename { flex: 1; text-align: right; font-weight: 800; }
.qtv-spytv__roletag { color: #fca5a5; font-weight: 800; }
.qtv-spytv__wintag { font-size: 1.4em; }
