.tv-entry, .tv-mode, .tv-session {
  --mo-ink: #221a5c; --mo-ink-2: #4a4275; --mo-ink-3: #5b5585; --mo-violet: #6b3cf2;
  --mo-edge: rgba(255,255,255,.75); --mo-rim: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(34,26,92,.12);
  --mo-glass-card: linear-gradient(170deg,rgba(255,255,255,.78),rgba(255,255,255,.58));
  --mo-glass-control: linear-gradient(180deg,rgba(255,255,255,.62),rgba(255,255,255,.4));
  --mo-blur: blur(18px) saturate(1.35);
  font-family: Inter, sans-serif; color: var(--mo-ink);
}
.tv-entry { position: fixed; right: 24px; bottom: 24px; z-index: 25; display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-radius: 999px; border: 1px solid var(--mo-edge); background: var(--mo-glass-card); box-shadow: var(--mo-rim), 0 6px 16px rgba(14,8,32,.14); backdrop-filter: var(--mo-blur); -webkit-backdrop-filter: var(--mo-blur); font-size: 15px; font-weight: 800; cursor: pointer; }
.tv-entry:focus-visible, .tv-mode :focus-visible { outline: 3px solid var(--mo-violet); outline-offset: 3px; }
.tv-mode { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #b9dfff url('/next/assets/sky-pan.webp') center / cover; overflow: auto; overscroll-behavior: contain; }
.tv-mode::backdrop { background: #b9dfff; }
.tv-mode *, .tv-mode *::before, .tv-mode *::after { box-sizing: border-box; }
.tv-mode [hidden] { display: none !important; }
.tv-wrap { max-width: 1480px; margin: auto; padding: max(24px,env(safe-area-inset-top)) max(36px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(36px,env(safe-area-inset-left)); }
.tv-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 32px; }
.tv-brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .06em; font-size: 16px; }
.tv-brand > span { font-size: 11px; color: var(--mo-ink-2); }
.tv-button { font: 700 15px/1.3 Inter,sans-serif; color: var(--mo-ink); border: 1px solid var(--mo-edge); background: var(--mo-glass-control); box-shadow: var(--mo-rim), 0 6px 16px rgba(14,8,32,.08); backdrop-filter: var(--mo-blur); -webkit-backdrop-filter: var(--mo-blur); padding: 13px 20px; min-height: 48px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; }
.tv-button:hover { background: rgba(255,255,255,.86); }
.tv-button:disabled { opacity: .4; cursor: default; }
.tv-setup { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 24px 48px; padding-top: clamp(12px,5vh,60px); }
.tv-eyebrow { color: var(--mo-ink-2); font-size: 12px; font-weight: 800; letter-spacing: .16em; margin: 0 0 20px; }
.tv-intro h1 { font-family: Bungee,Inter,sans-serif; font-weight: 400; font-size: clamp(32px,4.6vw,64px); line-height: 1.14; letter-spacing: -.025em; margin: 0 0 24px; }
.tv-intro > p:not(.tv-eyebrow) { font-size: clamp(18px,1.7vw,24px); line-height: 1.65; color: var(--mo-ink-2); }
.tv-connection { border: 1px solid var(--mo-edge); border-radius: 36px; background: var(--mo-glass-card); box-shadow: var(--mo-rim), 0 18px 50px rgba(14,8,32,.12); backdrop-filter: var(--mo-blur); -webkit-backdrop-filter: var(--mo-blur); padding: 24px 28px; }
.tv-diagram { width: 100%; max-height: 245px; display: block; overflow: visible; }
.tv-signal { animation: tv-signal 1.5s linear infinite; }
.tv-demo-cursor { animation: tv-select 4s ease-in-out infinite; transform-origin: 398px 90px; }
.tv-methods { display: flex; justify-content: center; gap: 8px; margin: 12px 0 24px; }
.tv-methods .tv-button { font-size: 14px; padding: 10px 16px; }
.tv-methods [aria-pressed=true] { background: #fff; outline: 2px solid var(--mo-violet); outline-offset: -2px; }
.tv-instructions { min-height: 170px; }
.tv-instructions h2 { font-size: 24px; margin: 0 0 12px; font-weight: 800; }
.tv-instructions p { color: var(--mo-ink-2); font-size: 16px; line-height: 1.7; margin: 0 0 8px; }
.tv-instructions a { color: var(--mo-ink); font-size: 14px; text-underline-offset: 4px; }
.tv-setup-footer { grid-column: 1/-1; display: flex; justify-content: space-between; gap: 32px; align-items: center; padding: 28px 0; border-top: 1px solid rgba(255,255,255,.65); }
.tv-setup-footer p { color: var(--mo-ink-2); font-size: 15px; line-height: 1.65; }
.tv-setup-footer strong { color: var(--mo-ink); }
.tv-primary { padding: 8px 8px 8px 24px; font-size: 17px; background: var(--mo-glass-card); white-space: nowrap; }
.tv-orb { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: white; font-size: 26px; background: radial-gradient(circle at 32% 22%,#a07bff,#6b3cf2 48%,#4318c4); box-shadow: inset 0 2px 2px #ffffff70,0 4px 10px #4318c433; }
.tv-cursor { position: fixed; width: 54px; height: 54px; border-radius: 50%; transform: translate(-50%,-50%); background: conic-gradient(var(--mo-violet) var(--progress,0deg),#ffffffb3 0); box-shadow: 0 4px 18px #221a5c55; padding: 5px; pointer-events: none; z-index: 10; }
.tv-cursor span { display: block; width: 100%; height: 100%; background: var(--mo-violet); border: 5px solid white; border-radius: inherit; }
.tv-cursor--closed span { transform: scale(.7); }
@keyframes tv-signal { to { stroke-dashoffset: -32; } }
@keyframes tv-select { 0%,100% { transform: translate(-65px,40px); } 45%,65% { transform: translate(0,0); } 55% { transform: scale(.7); } }

.tv-session [hidden] { display:none !important; }
.tv-demo { display:block; width:100%; max-height:240px; margin-bottom:16px; overflow:hidden; border-radius:20px; }
.tv-control-panel { animation:tv-panel 9s step-end infinite; }
.tv-receiver-panel { animation:tv-receiver 9s step-end infinite; }
.tv-airplay-check { animation:tv-airplay-check 9s step-end infinite; }
.tv-demo-pointer { animation:tv-pointer 9s ease-in-out infinite; }
.tv-illustration-note { display:block; margin-top:18px; color:var(--mo-ink-3); font-size:11px; text-align:center; }
.tv-instructions { min-height:190px; }
.tv-instructions ol { padding-left:24px; margin:0; color:var(--mo-ink-2); font-size:15px; line-height:1.65; }
.tv-instructions li { padding-left:6px; margin-bottom:8px; }
.tv-instructions li::marker { font-weight:800; color:var(--mo-ink); }
.tv-setup { padding-top:12px; }
.tv-control-dock { position:fixed; z-index:101; right:18px; bottom:18px; width:190px; padding:12px; border:1px solid var(--mo-edge); border-radius:22px; background:var(--mo-glass-card); backdrop-filter:var(--mo-blur); -webkit-backdrop-filter:var(--mo-blur); box-shadow:var(--mo-rim),0 12px 28px rgba(14,8,32,.13); }
.tv-dock-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; font-size:13px; }
.tv-dock-heading strong span { font-size:10px; color:var(--mo-violet); margin-left:4px; }
.tv-mini-button { color:var(--mo-ink); background:#ffffff88; border:1px solid white; border-radius:50%; width:32px; height:32px; font:20px Inter,sans-serif; cursor:pointer; }
.tv-video-wrap { position:relative; border-radius:12px; overflow:hidden; background:#221a5c; aspect-ratio:4/3; }
.tv-video-wrap video { width:100%;height:100%;object-fit:cover;transform:scaleX(-1); }
.tv-camera-label { position:absolute;left:7px;bottom:7px;color:white;background:#221a5cbb;padding:4px 6px;font-size:8px;border-radius:4px; }
.tv-status { font-size:12px;line-height:1.5;font-weight:700;min-height:36px;margin:10px 0; }
.tv-dock-guide { font-size:11px;line-height:1.6;color:var(--mo-ink-2);margin:0 0 8px; }
.tv-control-dock .tv-button { font-size:12px;padding:8px;min-height:36px;width:100%;margin-top:6px; }
.tv-game-stage { position:fixed;inset:0;margin:0;width:100%;height:100dvh;max-width:none;max-height:none;border:0;padding:0;color:var(--mo-ink);background:#b9dfff url('/next/assets/sky-pan.webp') center/cover;overflow:hidden; }
.tv-game-stage::backdrop { background:#b9dfff; }
.tv-stage-bar { height:76px;display:flex;gap:20px;align-items:center;padding:12px 20px; }
.tv-stage-bar strong { flex:1;font-size:19px; }
.tv-frame-wrap { position:absolute;left:16px;top:76px;bottom:16px;right:220px;overflow:hidden;border:2px solid #ffffffbb;border-radius:26px;background:#221a5c;box-shadow:0 18px 50px rgba(14,8,32,.2); }
.tv-frame-wrap iframe { width:100%;height:100%;border:0;display:block;background:white; }
.tv-game-loading,.tv-game-error { position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;background:#e7f4ff;color:var(--mo-ink);font-weight:800;padding:24px;text-align:center; }
.tv-game-stage .tv-control-dock { top:76px;bottom:auto; }
.tv-target-ring { position:fixed;z-index:103;outline:4px solid var(--mo-violet);outline-offset:4px;border-radius:16px;box-shadow:0 0 0 8px #ffffff88;pointer-events:none; }
.tv-session .tv-cursor { z-index:104; }
.tv-session :focus-visible { outline:3px solid var(--mo-violet);outline-offset:3px; }
@keyframes tv-panel { 0%,18%,90%,100% {opacity:0} 20%,88% {opacity:1} }
@keyframes tv-receiver { 0%,44%,90%,100% {opacity:0} 46%,88% {opacity:1} }
@keyframes tv-airplay-check { 0%,68%,90%,100% {opacity:0} 70%,88% {opacity:1} }
@keyframes tv-pointer { 0%,100% {transform:translate(260px,210px)} 16%,24% {transform:translate(490px,34px)} 40%,49% {transform:translate(462px,188px)} 64%,82% {transform:translate(460px,139px)} }
@media (max-width:1000px) { .tv-wrap {padding:20px}.tv-setup {gap:24px}.tv-setup-footer {gap:16px}.tv-primary {font-size:14px}.tv-control-dock {width:165px;right:10px;padding:10px}.tv-frame-wrap {right:186px;left:10px} }
@media (max-width:720px) { .tv-wrap {padding:16px}.tv-brand>span {display:none}.tv-top {margin-bottom:24px}.tv-top .tv-button {padding:10px 14px;font-size:13px}.tv-setup {grid-template-columns:1fr;padding-top:0}.tv-intro h1 {font-size:36px}.tv-intro>p:not(.tv-eyebrow) {font-size:17px;line-height:1.5;margin-bottom:0}.tv-connection {padding:16px}.tv-demo {margin-bottom:8px}.tv-methods {gap:6px}.tv-methods .tv-button {padding:10px 12px;font-size:12px}.tv-instructions {min-height:210px}.tv-instructions h2 {font-size:21px}.tv-instructions ol {font-size:13px}.tv-setup-footer {flex-direction:column;align-items:stretch;padding:0 0 16px;border:0}.tv-setup-footer p {font-size:13px;margin:0}.tv-primary {font-size:14px;justify-content:space-between}.tv-entry {bottom:16px;right:16px}.tv-control-dock {width:158px;bottom:10px}.tv-control-dock .tv-video-wrap,.tv-dock-guide {display:none}.tv-frame-wrap {right:10px;bottom:170px;top:66px;border-radius:18px}.tv-stage-bar {height:66px;padding:8px 10px;gap:10px}.tv-stage-bar strong {font-size:14px}.tv-stage-bar .tv-button {font-size:12px;padding:9px}.tv-stage-bar [data-fullscreen] {display:none}.tv-game-stage .tv-control-dock {top:auto;bottom:8px;left:10px;right:10px;width:auto;display:grid;grid-template-columns:1fr 1fr;gap:4px 14px;padding:8px 12px}.tv-game-stage .tv-dock-heading {margin:0}.tv-game-stage .tv-status {margin:0;grid-row:2;min-height:30px;font-size:11px}.tv-game-stage .tv-control-dock .tv-button {margin:0;grid-column:2;grid-row:1/3}.tv-game-stage .tv-control-dock [data-retry]:not([hidden]) {grid-row:3}.tv-game-stage .tv-control-dock {min-height:86px}.tv-frame-wrap {bottom:116px} }
@media (prefers-reduced-motion:reduce) { .tv-session *, .tv-session *::before, .tv-session *::after {animation:none!important;transition:none!important}.tv-demo-pointer {display:none}.tv-control-panel {opacity:0}.tv-receiver-panel,.tv-airplay-check {opacity:1} }

.tv-placement { margin:20px 0 0; max-width:680px; }
.tv-placement svg { display:block; width:100%; height:auto; overflow:visible; }
.tv-placement figcaption { font-size:13px; line-height:1.6; padding:8px 0 0; }
.tv-placement figcaption strong,.tv-placement figcaption span { display:block; }
.tv-placement figcaption span { color:var(--mo-ink-2); }
.tv-camera-direction { stroke-dasharray:6 5; animation:tv-camera-direction 2s linear infinite; }
@keyframes tv-camera-direction { to {stroke-dashoffset:-22} }
@media (min-width:1001px) and (min-height:760px) { .tv-intro h1 {font-size:clamp(32px,3.7vw,52px);margin-bottom:14px}.tv-intro>p:not(.tv-eyebrow) {font-size:20px;line-height:1.5;margin:0}.tv-eyebrow {margin-bottom:14px}.tv-setup {align-items:start}.tv-placement {margin-top:12px}.tv-placement svg {max-height:none}.tv-setup-footer {padding:18px 0} }
@media (min-width:721px) and (max-width:1000px) { .tv-intro h1 {font-size:32px}.tv-placement svg {min-height:180px}.tv-placement figcaption {font-size:12px} }
@media (max-width:720px) { .tv-placement {margin:20px 0 0}.tv-placement svg {max-height:none}.tv-placement figcaption {font-size:12px} }

.tv-setup-footer { padding:20px 24px; border:1px solid #fff; border-radius:26px; background:rgba(249,252,255,.96); box-shadow:inset 0 1px 0 #fff,0 10px 28px #221a5c14; }
.tv-setup-footer p { margin:0; max-width:540px; color:var(--mo-ink-2); font-size:15px; line-height:1.5; }
.tv-setup-footer p strong { display:block; margin-bottom:5px; font-size:23px; color:var(--mo-ink); }
.tv-setup-footer p span { display:block; }
.tv-setup-footer .tv-primary { background:#6b3cf2; color:#fff; border-color:#7950e8; box-shadow:inset 0 1px 0 #ffffff40,0 6px 16px #4318c433; }
.tv-setup-footer .tv-primary:hover { background:#5728da; }
@media (max-width:720px) { .tv-setup-footer {padding:20px;gap:18px}.tv-setup-footer p {font-size:14px}.tv-setup-footer p strong {font-size:22px}.tv-setup-footer .tv-primary {white-space:normal;font-size:14px} }

.tv-intro { text-align:center; }
.tv-placement { margin-left:auto; margin-right:auto; }
.tv-placement figcaption { text-align:center; }

/* Keep the game viewport stable while the hand-control dock becomes quiet. */
.tv-menu-paused .tv-video-wrap,.tv-menu-paused .tv-dock-guide { display:none; }

/* The floating entry must not cover Online room controls (notably Leave room). */
body:has(.nav [data-online-link][aria-current="page"]) > .tv-entry { display: none; }
