/* Interactive app preview (hero phone). Colors mirror the app's dark theme (src/theme/tokens.ts). */
.phone-stage { position: relative; display: flex; flex-direction: column; align-items: center; }
.phone-stage::before {
  content: ""; position: absolute; inset: 6% -12% 8%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(32, 201, 151, .22), transparent);
  z-index: 0; pointer-events: none;
}
.phone {
  --d-bg: #0b0f14; --d-surface: #121821; --d-raised: #18202b; --d-pressed: #1f2935; --d-border: #232d3a;
  --d-accent: #20c997; --d-on-accent: #04130e; --d-text: #ffffff; --d-text-2: #8b97a7; --d-text-3: #5e6a7a;
  --d-track: rgba(255, 255, 255, .12); --d-danger: #ff6b6b;
  position: relative; z-index: 1;
  width: 300px; height: 630px;
  background: #05080b; border-radius: 50px; padding: 12px;
  box-shadow: 0 0 0 2px #1f262e, 0 0 0 9px #e9edf0, 0 0 0 10px #d4dade, 0 40px 80px -20px rgba(11, 15, 20, .45);
}
.screen {
  position: relative; height: 100%; border-radius: 38px; overflow: hidden;
  background: var(--d-bg); color: var(--d-text);
  display: flex; flex-direction: column;
  font-size: 12px; line-height: 1.35; text-align: left;
}
:where(.screen button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
.screen button:focus-visible, .screen input:focus-visible { outline: 2px solid var(--d-accent); outline-offset: 2px; }
.screen svg { display: block; }

.statusbar { flex: none; height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 6px 26px 0; font-weight: 600; font-size: 13px; }
.sb-icons { display: flex; gap: 5px; align-items: center; }
.sb-icons svg { height: 10px; width: auto; fill: currentColor; }

.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 14px 16px; scrollbar-width: none; overscroll-behavior: contain; }
.view::-webkit-scrollbar { display: none; }
.view.enter { animation: d-fade .22s ease; }
@keyframes d-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.demo-noscript { color: var(--d-text-2); padding: 40px 10px; text-align: center; }

.d-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.d-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.d-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--d-surface); border: 1px solid var(--d-border); border-radius: 999px; padding: 4px 9px; color: var(--d-text-2); font-size: 11px; }
.d-search {
  display: flex; align-items: center; gap: 7px; width: 100%;
  background: var(--d-surface); border-radius: 11px; padding: 8px 10px; color: var(--d-text-3); margin-bottom: 12px;
}
.d-search svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.4; flex: none; }
.d-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--d-text); font: inherit; font-size: 12.5px; }
.d-search input::placeholder { color: var(--d-text-3); }

.d-section { margin: 14px 0 8px; font-size: 14px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; }
.d-section small { color: var(--d-accent); font-weight: 600; font-size: 11px; }
.d-hscroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px 2px; }
.d-hscroll::-webkit-scrollbar { display: none; }

.d-cw { flex: none; width: 168px; }
.d-cw .art { height: 94px; border-radius: 10px; position: relative; overflow: hidden; }
.d-cw .bar { position: absolute; left: 8px; right: 8px; bottom: 7px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); }
.d-cw .bar i { display: block; height: 100%; border-radius: 2px; background: var(--d-accent); }
.d-cw .t { font-weight: 600; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-cw .s { color: var(--d-text-2); font-size: 11px; }

.d-fav { flex: none; width: 58px; text-align: center; }
.d-fav .logo { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 5px; font-size: 13px; }
.d-fav span { font-size: 10.5px; color: var(--d-text-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.d-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.d-cat { background: var(--d-surface); border-radius: 11px; padding: 10px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.d-cat span { color: var(--d-text-3); font-weight: 500; font-size: 11px; }

.d-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px 8px; padding: 0 14px; }
.d-chips::-webkit-scrollbar { display: none; }
.d-chip { flex: none; background: var(--d-surface); border-radius: 999px; padding: 5px 11px; color: var(--d-text-2); white-space: nowrap; transition: background .15s; }
.d-chip.on { background: var(--d-accent); color: var(--d-on-accent); font-weight: 700; }

.logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 11.5px; color: #fff; flex: none; letter-spacing: -0.02em; }
.d-row { display: flex; align-items: center; gap: 4px; width: 100%; padding: 7px 6px; border-radius: 11px; transition: background .12s; }
.d-open { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.d-row:hover { background: var(--d-surface); }
.d-row .meta { flex: 1; min-width: 0; }
.d-row .name { font-weight: 650; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-row .now { color: var(--d-text-2); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-prog { height: 2.5px; border-radius: 2px; background: var(--d-track); margin-top: 5px; }
.d-prog i { display: block; height: 100%; border-radius: 2px; background: var(--d-accent); }
.d-star { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--d-text-3); }
.d-star svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.d-star.on { color: var(--d-accent); }
.d-star.on svg { fill: currentColor; }
.d-star.pop { animation: d-pop .3s ease; }
@keyframes d-pop { 50% { transform: scale(1.35); } }
.d-count { color: var(--d-text-3); font-size: 11px; margin: 2px 0 4px; }

.d-empty { text-align: center; color: var(--d-text-2); padding: 60px 16px; }
.d-empty svg { width: 36px; height: 36px; margin: 0 auto 12px; stroke: var(--d-text-3); fill: none; stroke-width: 1.6; }
.d-empty b { display: block; color: var(--d-text); font-size: 15px; margin-bottom: 4px; }

.d-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px 8px; }
.d-poster { width: 100%; }
.d-poster .art { aspect-ratio: 2 / 3; border-radius: 9px; }
.d-poster .t { font-size: 10.5px; font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-poster .y { font-size: 10px; color: var(--d-text-3); }

.art { position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 8px; color: #fff; font-weight: 800; letter-spacing: -0.01em; line-height: 1.05; }
.art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 75% 20%, rgba(255,255,255,.28), transparent 45%); }
.art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.45), transparent 60%); }
.art em { position: relative; z-index: 1; font-style: normal; font-size: 11px; text-shadow: 0 1px 6px rgba(0,0,0,.4); }

/* Detail */
.d-back { display: inline-flex; align-items: center; gap: 3px; color: var(--d-accent); font-weight: 600; font-size: 13px; margin: 2px 0 10px; }
.d-back svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.d-hero { height: 150px; border-radius: 14px; margin-bottom: 12px; }
.d-hero em { font-size: 20px; }
.d-dt { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.d-meta { color: var(--d-text-2); font-size: 11px; margin: 3px 0 10px; }
.d-desc { color: var(--d-text-2); font-size: 11.5px; margin: 10px 0 4px; }
.d-play { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; background: var(--d-accent); color: var(--d-on-accent); font-weight: 800; border-radius: 11px; padding: 10px; font-size: 13px; }
.d-play svg { width: 13px; height: 13px; fill: currentColor; }
.d-ep { display: flex; gap: 10px; align-items: center; width: 100%; padding: 7px 0; border-bottom: 1px solid var(--d-border); }
.d-ep .art { width: 84px; height: 48px; flex: none; border-radius: 7px; padding: 0; }
.d-ep .meta { min-width: 0; flex: 1; }
.d-ep .name { font-weight: 650; font-size: 12px; }
.d-ep .s { color: var(--d-text-3); font-size: 10.5px; }

/* Tab bar */
.tabbar { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--d-border); background: rgba(11, 15, 20, .96); padding: 6px 4px 18px; }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--d-text-2); font-size: 9.5px; font-weight: 600; text-align: center; padding: 2px 0; transition: color .15s; }
.tabbar svg { width: 21px; height: 21px; fill: currentColor; }
.tabbar button[aria-selected="true"] { color: var(--d-accent); }

/* Player */
.player-layer { position: absolute; inset: 0; z-index: 5; background: #000; display: flex; flex-direction: column; animation: d-up .28s cubic-bezier(.2,.8,.2,1); }
.player-layer[hidden] { display: none; }
@keyframes d-up { from { transform: translateY(100%); } to { transform: none; } }
.p-top { display: flex; align-items: center; justify-content: space-between; padding: 46px 14px 8px; }
.p-btn { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; flex: none; }
.p-btn svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.p-btn.on svg { fill: var(--d-accent); stroke: var(--d-accent); }
.p-title { flex: 1; text-align: center; font-weight: 700; font-size: 13px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-video { position: relative; aspect-ratio: 16 / 9; margin: 10px 0 0; overflow: hidden; background: #111; }
.p-video .scene { position: absolute; inset: -20%; background-size: 200% 200%; animation: d-pan 9s ease-in-out infinite alternate; }
@keyframes d-pan { from { background-position: 0% 30%; transform: scale(1); } to { background-position: 100% 70%; transform: scale(1.08); } }
.p-video .badge { position: absolute; left: 8px; top: 8px; background: #e5484d; color: #fff; font-weight: 800; font-size: 9px; border-radius: 4px; padding: 2px 6px; letter-spacing: .05em; z-index: 2; }
.p-video .spinner { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: d-spin .8s linear infinite; z-index: 2; }
@keyframes d-spin { to { transform: rotate(360deg); } }
.p-video .paused { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); z-index: 2; }
.p-video .paused svg { width: 34px; height: 34px; fill: #fff; }
.p-video .engine { position: absolute; right: 8px; bottom: 7px; z-index: 2; font-size: 9px; color: rgba(255,255,255,.8); background: rgba(0,0,0,.4); padding: 2px 6px; border-radius: 4px; }
.p-info { padding: 14px 16px 0; flex: 1; overflow-y: auto; scrollbar-width: none; }
.p-info::-webkit-scrollbar { display: none; }
.p-info .ch { display: flex; align-items: center; gap: 10px; }
.p-info .name { font-weight: 750; font-size: 15px; }
.p-info .grp { color: var(--d-text-2); font-size: 11px; }
.p-epg { margin-top: 14px; background: var(--d-surface); border-radius: 12px; padding: 10px 12px; }
.p-epg .lab { color: var(--d-accent); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.p-epg .prog { font-weight: 650; font-size: 13px; margin: 2px 0 6px; }
.p-epg .times { display: flex; justify-content: space-between; color: var(--d-text-3); font-size: 10px; margin-top: 4px; }
.p-epg .next { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--d-border); display: flex; justify-content: space-between; gap: 8px; }
.p-epg .next span:first-child { color: var(--d-text-2); }
.p-bell { display: inline-flex; align-items: center; gap: 4px; color: var(--d-accent); font-weight: 700; font-size: 11px; white-space: nowrap; }
.p-bell svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.p-bell.set { color: var(--d-text-2); }
.p-ctrls { display: flex; justify-content: center; align-items: center; gap: 22px; padding: 16px 0 26px; }
.p-ctrls .big { width: 52px; height: 52px; background: #fff; }
.p-ctrls .big svg { stroke: #000; fill: #000; width: 18px; height: 18px; }
.p-ctrls .p-btn { width: 40px; height: 40px; }
.p-scrub { margin: 14px 0 0; }
.p-scrub .d-prog { height: 4px; }
.p-toast {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 6;
  background: rgba(32, 41, 53, .96); color: #fff; border-radius: 999px; padding: 7px 13px; font-size: 11px; font-weight: 600;
  white-space: nowrap; animation: d-toast 2.2s ease forwards; pointer-events: none;
}
@keyframes d-toast { 0% { opacity: 0; transform: translate(-50%, 6px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* Hint under the phone */
.demo-hint { position: relative; z-index: 1; margin: 22px 0 0; display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(32, 201, 151, .6); animation: d-pulse 1.8s infinite; }
@keyframes d-pulse { 70% { box-shadow: 0 0 0 9px rgba(32, 201, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(32, 201, 151, 0); } }

@media (max-width: 640px) {
  .phone { width: 280px; height: 590px; }
}
@media (prefers-reduced-motion: reduce) {
  .view.enter, .player-layer, .p-video .scene, .pulse, .d-star.pop, .p-toast { animation: none; }
}
