:root {
  --ink: #f8f0df;
  --muted: #b9aaa1;
  --red: #c62932;
  --wine: #641522;
  --wine-deep: #250d14;
  --gold: #f4be4d;
  --gold-soft: #ffe69b;
  --panel: rgba(31, 13, 18, .76);
  --line: rgba(255, 223, 155, .17);
  --radius: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-width: 320px;
  background: #12090d;
  color: var(--ink);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}
button { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.ambient { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: linear-gradient(132deg, #0d090b 4%, #2b0f18 47%, #17090d 100%); }
.ambient::before {
  content: ""; position: absolute; inset: -6%; opacity: .96;
  background:
    radial-gradient(circle at 78% 12%, rgba(244,190,77,.19), transparent 25%),
    radial-gradient(circle at 9% 68%, rgba(198,41,50,.22), transparent 31%),
    linear-gradient(165deg, transparent 0 63%, rgba(111,19,35,.72) 63.2% 72%, rgba(39,10,18,.85) 72.2%);
  animation: cinematic 24s ease-in-out infinite alternate;
}
.ambient::after {
  content: ""; position: absolute; left: -5%; right: -5%; bottom: -4%; height: 35%; opacity: .56; pointer-events: none;
  background: linear-gradient(168deg, transparent 0 28%, #8c1b2d 28.3% 42%, #551421 42.4% 58%, #1c0c12 58.4%);
  clip-path: polygon(0 54%, 9% 38%, 17% 52%, 29% 17%, 40% 48%, 51% 30%, 61% 58%, 75% 25%, 88% 49%, 100% 31%, 100% 100%, 0 100%);
}
.ambient i { position: absolute; border-radius: 999px; filter: blur(80px); opacity: .12; }
.ambient i:nth-child(1) { width: 34vw; height: 34vw; background: var(--red); left: -14vw; top: -8vw; }
.ambient i:nth-child(2) { width: 28vw; height: 28vw; background: var(--gold); right: -11vw; top: 20vh; opacity: .16; }
.ambient i:nth-child(3) { width: 22vw; height: 22vw; background: var(--gold); left: 35vw; bottom: -15vw; opacity: .05; }

.shell { height: 100svh; min-height: 640px; max-width: 1920px; margin: auto; padding: clamp(14px, 1.5vw, 28px) clamp(16px, 2.3vw, 44px) 12px; display: flex; flex-direction: column; }
.topbar { height: 68px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.identity { min-width: 0; display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.mark { width: 54px; height: 54px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 2px solid #ffe68e; border-radius: 50%; background: #8b0e20; box-shadow: 0 8px 24px rgba(107,8,24,.26); }
.mark img { width: 100%; height: 100%; object-fit: cover; }
.identity-copy { display: grid; gap: 5px; min-width: 0; }
.identity-copy b { font-size: clamp(10px, .82vw, 14px); letter-spacing: .12em; white-space: nowrap; }
.identity-copy small { color: var(--gold-soft); font-size: 10px; letter-spacing: .09em; opacity: .74; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: clamp(10px, 1.1vw, 20px); white-space: nowrap; }
.about-button { border: 0; border-bottom: 1px solid rgba(255,230,155,.35); padding: 7px 0; background: transparent; text-transform: uppercase; font-weight: 700; font-size: 10px; letter-spacing: .13em; cursor: pointer; }
.about-button:hover { border-color: var(--gold); color: var(--gold-soft); }
.language { display: flex; align-items: center; gap: 7px; padding: 5px; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 999px; }
.language button { border: 0; background: transparent; opacity: .46; padding: 3px 5px; font-size: 10px; font-weight: 800; cursor: pointer; }
.language button.active { color: var(--gold-soft); opacity: 1; }
.language span { height: 12px; width: 1px; background: var(--line); }
.on-air { display: flex; align-items: center; gap: 8px; color: #ff7b78; font-size: 10px; letter-spacing: .13em; font-weight: 800; }
.on-air i { width: 7px; height: 7px; border-radius: 50%; background: #ff4747; box-shadow: 0 0 0 5px rgba(255,71,71,.1); animation: pulse 1.8s infinite; }
.on-air.waiting { color: var(--muted); }
.on-air.waiting i { background: #76696c; box-shadow: none; animation: none; }
#kyzylTime { color: var(--muted); font-size: 10px; letter-spacing: .12em; }

.broadcast-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(310px, 24vw, 430px); gap: clamp(14px, 1.5vw, 28px); padding-top: clamp(12px, 1.5vh, 20px); }
.stage-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.stream-tabs { height: 46px; display: flex; gap: 6px; align-items: flex-start; }
.stream-tabs button { height: 35px; color: var(--ink); border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 999px; padding: 0 16px 0 7px; display: flex; gap: 9px; align-items: center; cursor: pointer; opacity: .6; transition: .25s; }
.stream-tabs button span { min-width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 8px; font-weight: 800; }
.stream-tabs button b { font-size: 9px; letter-spacing: .11em; }
.stream-tabs button.active { opacity: 1; border-color: rgba(244,190,77,.5); color: var(--gold-soft); background: rgba(198,41,50,.22); box-shadow: inset 0 0 18px rgba(244,190,77,.04); }
.stream-tabs button.active span { background: var(--red); color: #fff; }

.video-frame { position: relative; flex: 0 0 auto; width: 100%; min-height: 0; overflow: hidden; border: 1px solid rgba(255,224,157,.21); border-radius: var(--radius); background: #120a0d; box-shadow: 0 25px 70px rgba(0,0,0,.34), inset 0 0 0 1px rgba(255,255,255,.025); aspect-ratio: 16/9; }
.video-frame::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3; background: linear-gradient(180deg, rgba(0,0,0,.05), transparent 50%, rgba(0,0,0,.5)); }
.video-placeholder { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; text-align: center; padding: 6%; isolation: isolate; background: radial-gradient(circle at 50% 46%, rgba(244,190,77,.1), transparent 30%), radial-gradient(circle at 50% 46%, rgba(198,41,50,.24), transparent 42%), linear-gradient(135deg,#10090c,#2b0f17 54%,#160a0e); }
.video-placeholder::before, .video-placeholder::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%; opacity: .42; background: linear-gradient(168deg, transparent 0 37%, #b22334 37.5% 53%, #71192a 53.5% 69%, #2c0e16 69.5%); clip-path: polygon(0 55%, 12% 42%, 24% 59%, 39% 25%, 52% 55%, 66% 38%, 79% 62%, 91% 36%, 100% 51%, 100% 100%, 0 100%); }
.video-placeholder::after { transform: translateY(19px) scaleX(-1); opacity: .2; }
.halo { position: relative; z-index: 1; width: clamp(76px, 7vw, 112px); height: clamp(76px, 7vw, 112px); display: grid; place-items: center; margin-bottom: 10px; border-radius: 50%; background: radial-gradient(circle, rgba(255,226,147,.16), transparent 68%); }
.halo::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(247,189,72,.24); border-radius: inherit; animation: spin 28s linear infinite; }
.halo img { width: 72%; height: 72%; object-fit: cover; border: 2px solid #ffe38a; border-radius: 50%; box-shadow: 0 9px 28px rgba(51,2,12,.38); }
.eyebrow { margin: 0 0 7px; color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.video-placeholder h1 { position: relative; z-index: 1; margin: 0; max-width: 680px; font-size: clamp(22px, 2.1vw, 38px); line-height: 1.17; letter-spacing: -.035em; }
.countdown-wrap { position: relative; z-index: 1; display: grid; justify-items: center; gap: 5px; margin-top: clamp(18px, 3vh, 34px); }
.countdown-wrap span { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .18em; }
.countdown-wrap strong { font-variant-numeric: tabular-nums; font-size: clamp(18px, 1.65vw, 28px); letter-spacing: .08em; color: var(--gold-soft); }
.countdown-wrap small { max-width: 520px; color: var(--muted); font-size: clamp(9px, .75vw, 12px); }
.embed, .embed iframe { width: 100%; height: 100%; border: 0; background: #000; }
.video-chrome { position: absolute; z-index: 4; bottom: 14px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; }
.source-pill { border-radius: 999px; padding: 6px 10px; background: rgba(8,4,6,.66); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(12px); font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.video-chrome > div { display: flex; gap: 7px; }
.video-chrome button { width: 32px; height: 32px; padding: 8px; border: 1px solid rgba(255,255,255,.14); background: rgba(8,4,6,.64); border-radius: 50%; backdrop-filter: blur(12px); cursor: pointer; }
.video-chrome button:hover { color: var(--gold-soft); border-color: rgba(247,189,72,.55); }
.video-chrome svg { width: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
footer { height: 34px; margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; color: rgba(255,255,255,.35); font-size: 8px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; }

.programme-panel { min-height: 0; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(160deg, rgba(58,20,28,.84), rgba(20,10,13,.8)); box-shadow: inset 0 1px rgba(255,255,255,.03), 0 20px 55px rgba(0,0,0,.23); backdrop-filter: blur(18px); border-radius: var(--radius); padding: clamp(17px, 1.4vw, 25px); display: flex; flex-direction: column; }
.programme-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.programme-head h2 { margin: 0; font-size: clamp(16px, 1.25vw, 22px); letter-spacing: -.03em; }
.date-badge { padding: 7px 9px; border-radius: 8px; color: var(--gold-soft); background: rgba(247,189,72,.09); border: 1px solid rgba(247,189,72,.25); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.day-tabs { display: grid; grid-template-columns: repeat(2,1fr); gap: 5px; margin: clamp(14px, 2vh, 21px) 0 10px; padding: 4px; background: rgba(0,0,0,.19); border-radius: 10px; }
.day-tabs button { height: 29px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.day-tabs button.active { color: #fff4dc; background: var(--red); box-shadow: 0 5px 18px rgba(198,41,50,.22); }
.schedule { min-height: 0; flex: 1 1 auto; overflow: auto; padding-right: 5px; scrollbar-width: thin; scrollbar-color: rgba(247,189,72,.28) transparent; }
.event { position: relative; display: grid; grid-template-columns: 66px 1fr; gap: 12px; padding: clamp(11px, 1.25vh, 16px) 5px clamp(11px, 1.25vh, 16px) 0; border-bottom: 1px solid rgba(255,255,255,.07); transition: .25s; }
.event.past { opacity: .38; }
.event.current { margin: 3px 0; padding-left: 10px; border-radius: 10px; background: linear-gradient(90deg, rgba(198,41,50,.23), transparent); border-bottom-color: rgba(247,189,72,.2); }
.event.current::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--gold); }
.event time { color: var(--gold-soft); font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.event-copy { min-width: 0; }
.event-status { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 5px; color: #ff7774; font-size: 7px; font-weight: 800; letter-spacing: .15em; }
.event-status.next { color: var(--gold); }
.event-status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.event h3 { margin: 0; font-size: clamp(10px, .74vw, 12px); line-height: 1.4; text-transform: uppercase; }
.event p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.programme-foot { height: 27px; flex: 0 0 auto; display: flex; align-items: flex-end; gap: 7px; color: rgba(255,255,255,.34); font-size: 7px; letter-spacing: .1em; text-transform: uppercase; }
.programme-foot i { width: 4px; height: 4px; background: var(--gold); border-radius: 50%; }
.programme-foot b { margin-left: auto; color: rgba(255,230,155,.52); }

.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; opacity: 0; visibility: hidden; transition: .3s; }
.modal.open { opacity: 1; visibility: visible; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(7,4,5,.78); backdrop-filter: blur(12px); }
.modal-card { position: relative; width: min(720px, 100%); max-height: min(760px, 88vh); overflow: auto; padding: clamp(28px, 4vw, 54px); border: 1px solid rgba(244,190,77,.25); border-radius: 22px; background: linear-gradient(145deg,#32121b,#160b0f 70%); box-shadow: 0 35px 100px rgba(0,0,0,.58); }
.modal-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 100px; pointer-events: none; opacity: .2; background: linear-gradient(170deg,transparent 38%,#c62932 39% 58%,#6b1727 59%); }
.modal-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.04); font-size: 23px; line-height: 1; cursor: pointer; }
.modal-card h2 { max-width: 580px; margin: 0 0 22px; font-size: clamp(25px, 3.1vw, 44px); line-height: 1.08; letter-spacing: -.04em; }
.modal-card p:not(.eyebrow) { color: #cbbdb3; font-size: 13px; line-height: 1.7; }
.modal-sign { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--gold-soft); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.modal-sign img { width: 64px; height: 64px; object-fit: cover; border: 2px solid #ffe38a; border-radius: 50%; }
body.modal-open { overflow: hidden; }

@keyframes cinematic { from { transform: scale(1) translate3d(0,0,0); } to { transform: scale(1.07) translate3d(-1%,1%,0); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255,71,71,0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .identity-copy b { max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
  #kyzylTime { display: none; }
  .broadcast-grid { grid-template-columns: minmax(0, 1fr) 310px; }
  .event { grid-template-columns: 58px 1fr; gap: 8px; }
}

@media (max-width: 820px) {
  .shell { height: auto; min-height: 100svh; padding: 13px; }
  .topbar { height: auto; min-height: 60px; flex-wrap: wrap; padding-bottom: 11px; }
  .mark { width: 46px; height: 46px; }
  .mark img { width: 100%; height: 100%; }
  .identity-copy b { max-width: calc(100vw - 120px); font-size: 9px; }
  .identity-copy small { font-size: 8px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .broadcast-grid { display: flex; flex-direction: column; padding-top: 12px; }
  .video-frame { flex: none; width: 100%; min-height: auto; }
  .programme-panel { min-height: 520px; max-height: 72vh; }
  footer { padding: 8px 2px 2px; height: 36px; }
}

@media (max-width: 520px) {
  .about-button { font-size: 8px; }
  .on-air { font-size: 8px; }
  .stream-tabs button { padding-right: 10px; }
  .stream-tabs button b { font-size: 7px; }
  .video-placeholder { padding: 4%; }
  .halo { display: none; }
  .video-placeholder h1 { font-size: 17px; }
  .countdown-wrap { margin-top: 13px; }
  .countdown-wrap small { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .video-chrome { bottom: 8px; left: 9px; right: 9px; }
  .video-chrome button { width: 28px; height: 28px; }
  .programme-panel { padding: 17px 14px; border-radius: 16px; }
  footer span:first-child { max-width: 80%; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; } }
