/* Кинозал — телевизор: ЭЛТ-кинескоп, корпус, пульт, список каналов */
.tvroom { position: relative; min-height: 100svh; padding: calc(var(--topbar-h) + clamp(110px, 12vw, 150px)) 0 90px; background: linear-gradient(180deg, rgba(10, 4, 7, .82), rgba(10, 4, 7, .5) 35%, rgba(10, 4, 7, .94)), url(../img/tv-room.webp) 50% 0 / cover fixed; }
.tv-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 410px); gap: clamp(22px, 3vw, 44px); align-items: start; }
.tv-main { min-width: 0; display: grid; gap: 22px; justify-items: center; }

/* корпус */
.tv-set { position: relative; width: min(100%, 860px); }
.tv-antenna { position: absolute; left: 44%; bottom: 99%; width: 0; height: 0; pointer-events: none; }
.tv-antenna i { position: absolute; bottom: 0; left: 0; width: 3px; height: clamp(70px, 12vw, 130px); background: linear-gradient(90deg, #9a9a9a, #e8e8e8, #6a6a6a); border-radius: 2px; transform-origin: 50% 100%; }
.tv-antenna i::after { content: ""; position: absolute; top: -5px; left: -3px; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #aaa 60%, #555); }
.tv-antenna i:first-child { transform: rotate(-32deg); } .tv-antenna i:last-child { transform: rotate(26deg); }
.tv-cabinet { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) clamp(96px, 17%, 150px); gap: 0; border-radius: 28px 28px 22px 22px; padding: clamp(10px, 1.6vw, 18px); background: repeating-linear-gradient(94deg, rgba(0, 0, 0, .07) 0 2px, transparent 2px 7px), linear-gradient(135deg, #7a4f2b 0%, #4a2d16 42%, #2b180a 100%); box-shadow: inset 0 2px 0 rgba(255, 220, 170, .28), inset 0 -3px 0 rgba(0, 0, 0, .5), 0 40px 70px -24px #000, 0 0 0 2px #140a04; }
.tv-bezel { align-self: start; padding: clamp(8px, 1.4vw, 16px); background: linear-gradient(145deg, #1b1612, #0b0907); border-radius: 22px; box-shadow: inset 0 0 0 2px #000, inset 0 6px 14px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 220, 170, .18); }
.tv-legs { display: flex; justify-content: space-between; padding: 0 9%; }
.tv-legs i { width: 12%; height: 24px; background: linear-gradient(180deg, #2b180a, #120a04); clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%); }

/* экран */
.crt { position: relative; container-type: inline-size; aspect-ratio: 3 / 2; border-radius: 9% / 13%; overflow: hidden; background: #000; isolation: isolate; box-shadow: 0 0 0 3px #000, 0 0 30px rgba(0, 0, 0, .9); }
.crt-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; filter: contrast(1.08) saturate(1.12) brightness(1.02); }
.crt-snow { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; opacity: 0; transition: opacity .12s; filter: contrast(1.25) brightness(.95); }
.crt[data-state="snow"] .crt-snow { opacity: 1; }
.crt[data-state="off"] .crt-video, .crt[data-state="off"] .crt-snow { opacity: 0; }
.crt::before { content: ""; position: absolute; inset: 0; z-index: 6; background: #fff; opacity: 0; pointer-events: none; }
.crt[data-power="on"]::before { animation: crt-on .8s ease-out both; }
@keyframes crt-on {
  0% { opacity: 1; clip-path: inset(49.4% 49.4% 49.4% 49.4%); }
  30% { opacity: 1; clip-path: inset(49.4% 0 49.4% 0); }
  58% { opacity: .95; clip-path: inset(0); }
  100% { opacity: 0; clip-path: inset(0); }
}
.crt-glass { position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .27) 0 1px, transparent 1px 3px), radial-gradient(ellipse 125% 105% at 50% 50%, transparent 52%, rgba(0, 0, 0, .62) 100%), radial-gradient(ellipse 55% 34% at 24% 14%, rgba(255, 255, 255, .15), transparent 62%);
  box-shadow: inset 0 0 8cqw rgba(0, 0, 0, .85); animation: crt-flicker 5s steps(1) infinite; }
@keyframes crt-flicker { 0%, 100% { opacity: 1 } 47% { opacity: .94 } 48% { opacity: 1 } 73% { opacity: .96 } 74% { opacity: 1 } }
.crt[data-state="live"] .crt-video { animation: crt-jit 9s steps(1) infinite; }
@keyframes crt-jit { 0%, 100% { transform: none } 61% { transform: translateX(.15%) } 62% { transform: none } }
.crt-power { position: absolute; z-index: 7; inset: 0; margin: auto; width: max-content; height: max-content; display: inline-flex; align-items: center; gap: 12px; padding: 14px 26px; border: 1px solid var(--gold); border-radius: 3px; background: rgba(10, 4, 7, .7); color: var(--gold-hi); font: 600 1.05rem var(--font-ui); transition: background .2s, transform .2s var(--ease), box-shadow .3s; box-shadow: 0 0 40px -6px rgba(217, 164, 65, .5); }
.crt-power:hover { background: rgba(217, 164, 65, .2); color: var(--paper); transform: scale(1.03); }
.crt-power .icon { width: 26px; height: 26px; }
.crt:not([data-power="off"]) .crt-power { display: none; }

/* экранное меню */
.crt-osd { position: absolute; inset: 0; z-index: 3; pointer-events: none; font-family: var(--font-osd); text-transform: uppercase; }
.crt-osd > * { position: absolute; transition: opacity .25s; text-shadow: 2px 2px 0 #000; }
.osd-live { top: 5cqw; left: 6cqw; display: flex; align-items: center; gap: 1.2cqw; font-size: 2cqw; color: #fff; }
.osd-live i { width: 1.8cqw; height: 1.8cqw; border-radius: 50%; background: var(--live); box-shadow: 0 0 1.2cqw var(--live); animation: blink 1.2s steps(1) infinite; }
.osd-ch { top: 3.4cqw; right: 7cqw; font: 400 10.5cqw/1 var(--font-digits); color: var(--phosphor); text-shadow: 0 0 1.6cqw rgba(157, 255, 176, .8), .5cqw .5cqw 0 #000; opacity: 0; letter-spacing: .04em; }
.osd-name { left: 6cqw; bottom: 6.5cqw; max-width: 70cqw; font-size: 2.1cqw; line-height: 1.5; padding: .8cqw 1.6cqw; background: rgba(0, 0, 0, .55); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; }
.osd-vol { left: 50%; bottom: 14cqw; transform: translateX(-50%); font-size: 2.1cqw; color: var(--phosphor); white-space: nowrap; opacity: 0; }
.osd-msg { left: 50%; top: 46%; transform: translate(-50%, -50%); font-size: 3.4cqw; color: #fff; background: rgba(0, 0, 0, .7); padding: 1.6cqw 3cqw; opacity: 0; white-space: nowrap; }
.crt.osd-on .osd-ch, .crt.osd-on .osd-name, .osd-vol.on, .osd-msg.on { opacity: 1; }
.osd-msg.on { animation: blink 1.1s steps(1) infinite; }
.crt-fail { position: absolute; z-index: 8; left: 50%; bottom: 8cqw; transform: translateX(-50%); width: min(88%, 520px); display: grid; gap: 12px; justify-items: center; text-align: center; padding: 16px 18px; background: rgba(10, 4, 7, .88); border: 1px solid var(--line-strong); border-radius: 3px; font-family: var(--font-ui); text-transform: none; }
.crt-fail p { font-size: 1rem; }
.crt-fail .row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* боковая панель корпуса */
.tv-side { display: grid; align-content: start; justify-items: center; gap: clamp(12px, 2vw, 22px); padding: clamp(10px, 1.6vw, 18px) 6px; }
.tv-brand { padding: 5px 10px; border-radius: 2px; background: linear-gradient(180deg, #e8c36a, #a67a26); color: #2a1604; font: 700 clamp(.62rem, 1.1vw, .82rem)/1.25 var(--font-marquee); letter-spacing: .12em; text-align: center; box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset, 0 2px 4px rgba(0, 0, 0, .5); }
.tv-brand small { display: block; font: 400 .58rem var(--font-ui); letter-spacing: 0; opacity: .8; }
.knob { --rot: 0deg; position: relative; width: clamp(48px, 7.4cqw, 74px); width: clamp(48px, 8vw, 74px); aspect-ratio: 1; border-radius: 50%; background: conic-gradient(from 0deg, #c9c9c9, #4a4a4a 12%, #d9d9d9 25%, #3a3a3a 37%, #cfcfcf 50%, #4a4a4a 62%, #d9d9d9 75%, #3a3a3a 87%, #c9c9c9); box-shadow: 0 6px 10px rgba(0, 0, 0, .6), inset 0 0 0 3px #1a1a1a, inset 0 0 0 8px rgba(0, 0, 0, .35); transform: rotate(var(--rot)); transition: transform .5s var(--ease); }
.knob::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #5a5a5a, #1b1b1b); }
.knob i { position: absolute; z-index: 2; top: 7%; left: 50%; width: 4px; height: 20%; margin-left: -2px; border-radius: 2px; background: var(--gold-hi); box-shadow: 0 0 6px rgba(244, 213, 138, .7); }
.knob.small { width: clamp(36px, 5.6vw, 54px); }
.grille { width: 78%; height: clamp(60px, 12vw, 110px); border-radius: 6px; background: repeating-linear-gradient(0deg, #050302 0 3px, #3c2410 3px 8px); box-shadow: inset 0 0 10px #000, 0 1px 0 rgba(255, 220, 170, .2); }
.led { width: 12px; height: 12px; border-radius: 50%; background: #3a0c0c; box-shadow: inset 0 1px 2px #000, 0 0 0 2px #120805; transition: background .3s, box-shadow .3s; }
.led.on { background: #ff4d3d; box-shadow: 0 0 12px 2px rgba(255, 77, 61, .8), 0 0 0 2px #120805; }

/* пульт */
.remote { width: min(100%, 860px); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 14px 16px; background: linear-gradient(180deg, #2a231f, #14100d); border: 1px solid #3a2f28; border-radius: 18px; box-shadow: 0 20px 40px -18px #000, inset 0 1px 0 rgba(255, 255, 255, .08); }
.rbtn { position: relative; display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 8px; border-radius: 10px; background: linear-gradient(180deg, #4a4039, #2c2622); color: var(--paper); box-shadow: 0 3px 0 #0b0806, inset 0 1px 0 rgba(255, 255, 255, .12); transition: transform .1s, box-shadow .1s, background .2s, color .2s; font: 600 1rem var(--font-ui); }
.rbtn:hover { background: linear-gradient(180deg, #5b4f46, #352e29); color: var(--gold-hi); }
.rbtn:active { transform: translateY(3px); box-shadow: 0 0 0 #0b0806, inset 0 1px 0 rgba(255, 255, 255, .06); }
.rbtn[aria-pressed="true"] { color: var(--live); } .rbtn[aria-pressed="true"] .icon { fill: currentColor; }
.rbtn small { position: absolute; right: 4px; bottom: 2px; font: 700 .58rem var(--font-ui); color: var(--paper-3); }
.rbtn .icon { width: 22px; height: 22px; }
.rbtn.pwr { background: linear-gradient(180deg, #b02a47, #6b1428); color: #fff; }
.digits { display: grid; grid-template-columns: repeat(5, 46px); gap: 6px; margin: 0 6px; }
.rbtn.d { font: 400 1.5rem var(--font-digits); color: var(--phosphor); }
@media (max-width: 560px) { .digits { grid-template-columns: repeat(5, 1fr); width: 100%; margin: 4px 0; } .rbtn { min-width: 44px; } }

/* телегид */
.guide { width: min(100%, 860px); }
.guide h2 { font: italic 700 1.3rem var(--font-display); margin-bottom: 10px; }
.guide-body { display: flex; flex-wrap: wrap; gap: 8px; }
.gchip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(18, 6, 11, .7); color: var(--paper); transition: border-color .2s, background .2s; }
.gchip:hover { border-color: var(--gold); background: rgba(217, 164, 65, .12); }
.gchip img { width: 28px; height: 28px; border-radius: 50%; object-fit: contain; background: #fff2; }
.gchip b { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--gold-hi); font-size: .88rem; }
.gchip .icon { width: 14px; height: 14px; }

/* список каналов */
.tv-list { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; max-height: calc(100svh - var(--topbar-h) - 32px); background: rgba(18, 6, 11, .88); backdrop-filter: blur(12px); border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; box-shadow: 0 30px 60px -30px #000; }
.tl-head { display: grid; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.tl-head h2 { font: italic 800 1.5rem var(--font-display); }
.tl-head .n { font: 400 1.4rem var(--font-digits); color: var(--phosphor); margin-left: 6px; font-style: normal; }
.tl-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tl-selects label:first-child { grid-column: span 2; }
.tl-selects .select { padding: 8px 26px 8px 10px; font-size: .86rem; min-height: 42px; background-position: right 10px center; }
.tl-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--oxblood) transparent; min-height: 200px; }
.chrow { display: grid; grid-template-columns: 44px 40px minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 6px 8px 6px 10px; border-left: 3px solid transparent; border-bottom: 1px solid rgba(217, 164, 65, .08); color: inherit; text-decoration: none; cursor: pointer; content-visibility: auto; contain-intrinsic-size: auto 58px; transition: background .15s; }
.chrow:hover, .chrow:focus-visible { background: rgba(217, 164, 65, .08); color: inherit; }
.chrow.on { background: rgba(217, 164, 65, .15); border-left-color: var(--gold); }
.chrow .num { font: 400 1.5rem/1 var(--font-digits); color: var(--phosphor); text-shadow: 0 0 6px rgba(157, 255, 176, .4); }
.chrow img { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; background: rgba(241, 230, 207, .12); }
.chrow .nm { display: grid; min-width: 0; line-height: 1.25; }
.chrow .nm .t, .chrow > span.nm:not(:has(.t)) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.chrow .nm .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; color: var(--paper-3); }
.chrow .q { padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 2px; font: 500 .7rem var(--font-marquee); color: var(--gold-hi); }
.chrow .viewers { display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; color: var(--gold-hi); }
.chrow .viewers .icon { width: 13px; height: 13px; }
.chrow .icon-btn { width: 40px; height: 40px; }
.ch-list .chrow { border: 1px solid var(--line); border-radius: 3px; background: rgba(42, 13, 24, .3); grid-template-columns: 44px 40px minmax(0, 1fr) auto; }
.tv-legal { margin-top: 36px; color: var(--paper-3); font-size: .86rem; max-width: 90ch; }

.crt:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }

@media (max-width: 1000px) {
  .tvroom { padding-top: calc(var(--topbar-h) + 100px); background-attachment: scroll; }
  .tv-layout { grid-template-columns: 1fr; }
  .tv-list { position: static; max-height: none; }
  .tl-body { max-height: 70svh; }
}
@media (max-width: 560px) {
  .tv-cabinet { grid-template-columns: 1fr; border-radius: 18px; }
  .tv-side { grid-auto-flow: column; justify-content: space-evenly; align-items: center; padding: 14px 4px 4px; gap: 10px; }
  .tv-side .grille { display: none; }
  .tv-brand { font-size: .6rem; }
}
@media (prefers-reduced-motion: reduce) { .crt-glass, .crt[data-state="live"] .crt-video { animation: none; } }
