/* Jimbo TV Cast: the TV screen (cast.html) and the phone remote */

/* ---------- TV screen ---------- */
html.tv-screen, html.tv-screen body { overflow: hidden; background: #000; }
html.tv-screen .tv__screen { position: fixed !important; inset: 0; z-index: 2147480000; width: 100vw; height: 100vh; max-width: none; aspect-ratio: auto; border-radius: 0; margin: 0; border: 0; box-shadow: none; }
html.tv-screen .tv__gate { display: none !important; }
html.tv-screen .tv__osd { top: 4vh; left: 4vw; padding: 1.2vh 1.6vw; transform-origin: top left; font-size: 1.6vw; }
html.tv-screen .tv__osd b { font-size: 3.4vw; }
html.tv-screen .tv__osd span { font-size: 1.6vw; max-width: 60vw; }
html.tv-screen .tv__sound { font-size: 1.3vw; padding: 1.4vh 1.6vw; right: 4vw; bottom: 8vh; }

.cast-tv { position: fixed; inset: 0; z-index: 2147480500; display: grid; place-items: center; padding: 5vh 6vw;
  background: radial-gradient(120% 90% at 80% 0%, #3a2207 0%, #120c05 45%, #050403 100%); color: #f6f1e7; font-family: var(--font-body); }
.cast-tv[hidden] { display: none; }
.cast-tv__in { width: min(1500px, 100%); display: grid; gap: 3.4vh; }
.cast-tv__brand { margin: 0; font: 800 clamp(1rem, 1.6vw, 2rem)/1 var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: #ffcf7a; }
.cast-tv__brand b { color: var(--amber); }
.cast-tv__brand span { color: #b9ae9b; font-weight: 700; }
.cast-tv__h { margin: 0; font: 900 clamp(2rem, 4.6vw, 5.4rem)/1 var(--font-display); letter-spacing: -.02em; }
.cast-tv__row { display: grid; grid-template-columns: 1.1fr .9fr; gap: 4vw; align-items: center; }
.cast-tv__steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 2.6vh; }
.cast-tv__steps li { counter-increment: s; display: grid; grid-template-columns: auto 1fr; gap: 1.4vw; align-items: center; font: 600 clamp(1rem, 1.9vw, 2.3rem)/1.3 var(--font-body); color: #e9e2d4; }
.cast-tv__steps li::before { content: counter(s); width: 2.6em; height: 2.6em; border-radius: 50%; display: grid; place-items: center; background: rgb(245 166 35 / .16); border: 2px solid var(--amber); color: var(--amber); font: 900 .8em/1 var(--font-display); }
.cast-tv__steps b { color: #fff; }
.cast-tv__code { display: grid; justify-items: center; gap: 2vh; padding: 3.4vh 2.4vw; border-radius: 28px; background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .12); }
.cast-tv__k { font: 800 clamp(.8rem, 1.2vw, 1.5rem)/1 var(--font-display); letter-spacing: .2em; text-transform: uppercase; color: #b9ae9b; }
.cast-tv__code > b { font: 900 clamp(2.6rem, 6.4vw, 8rem)/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; color: #fff; text-shadow: 0 0 40px rgb(245 166 35 / .35); white-space: nowrap; }
.cast-tv__qr { width: clamp(120px, 15vw, 260px); aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #fff; }
.cast-tv__qr svg { display: block; width: 100%; height: 100%; }
.cast-tv__go { justify-self: start; display: inline-flex; align-items: center; gap: 1vw; padding: 2.2vh 2.6vw; border: 0; border-radius: 999px; background: var(--amber); color: #141414; font: 900 clamp(1rem, 1.8vw, 2.2rem)/1 var(--font-display); cursor: pointer; }
.cast-tv__go svg { width: 1.3em; height: 1.3em; }
.cast-tv__go:focus-visible { outline: 6px solid #fff; outline-offset: 6px; }
.cast-tv__s { margin: 0; font: 600 clamp(.9rem, 1.4vw, 1.7rem)/1.3 var(--font-body); color: #cfc6b6; }

.cast-chip { position: fixed; z-index: 2147480400; right: 3vw; top: 4vh; display: flex; align-items: center; gap: .8vw; padding: 1.2vh 1.4vw; border-radius: 999px;
  background: rgb(0 0 0 / .72); color: #fff; font: 700 clamp(.8rem, 1.2vw, 1.5rem)/1 var(--font-body); opacity: 0; transform: translateY(-8px); transition: opacity .4s, transform .4s; pointer-events: none; }
.cast-chip.is-on { opacity: 1; transform: none; }
.cast-chip span { color: var(--amber); display: grid; }
.cast-chip span svg { width: 1.4em; height: 1.4em; }
.cast-chip b { font: 900 1.2em/1 ui-monospace, Menlo, monospace; letter-spacing: .08em; }
.cast-chip small { color: #cfc6b6; font-size: .9em; }
.cast-vol { position: fixed; z-index: 2147480400; left: 50%; bottom: 8vh; transform: translate(-50%, 20px); display: flex; align-items: center; gap: 1.4vw; padding: 1.8vh 2.2vw; border-radius: 999px;
  background: rgb(0 0 0 / .78); color: #fff; font: 800 clamp(.9rem, 1.4vw, 1.8rem)/1 var(--font-display); opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.cast-vol.is-on { opacity: 1; transform: translate(-50%, 0); }
.cast-vol i { width: 28vw; height: 1.2vh; min-height: 8px; border-radius: 99px; background: rgb(255 255 255 / .2); overflow: hidden; }
.cast-vol b { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), #ffcf7a); transition: width .2s; }
.cast-vol em { font-style: normal; min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- phone: Cast to TV button and sheet ---------- */
.tv-btn--cast { background: linear-gradient(135deg, var(--amber), #ffbe55) !important; color: #141414 !important; border-color: transparent !important; font-weight: 800; }
.cast-sheet { position: fixed; inset: 0; z-index: 2147481000; display: grid; align-items: end; padding: 12px; background: rgb(0 0 0 / .6); }
.cast-sheet[hidden] { display: none; }
.cast-sheet__box { position: relative; width: min(560px, 100%); margin: 0 auto; padding: 22px 20px 20px; border-radius: 24px; background: #141518; color: #f3f1ec; border: 1px solid rgb(255 255 255 / .1); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-height: 90vh; overflow: auto; box-shadow: 0 -10px 40px rgb(0 0 0 / .5); box-sizing: border-box; }
.cast-sheet__box > * { min-width: 0; }
.cast-form input, .cast-form .btn { width: 100%; box-sizing: border-box; }
.cast-x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgb(255 255 255 / .08); color: #fff; cursor: pointer; }
.cast-sheet__k { margin: 0; display: inline-flex; align-items: center; gap: 8px; font: 800 .74rem/1 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--amber); }
.cast-sheet__h { margin: 0; padding-right: 44px; font: 900 1.45rem/1.15 var(--font-display); overflow-wrap: anywhere; }
.cast-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; color: #d8d2c6; line-height: 1.45; }
.cast-url { display: block; margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: #0a0b0d; border: 1px dashed rgb(245 166 35 / .5); color: #ffcf7a; font: 700 .95rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; user-select: all; }
.cast-form { display: grid; grid-template-columns: 1fr; gap: 10px; }
.cast-form input { min-height: 60px; padding: 0 16px; border-radius: 14px; border: 2px solid rgb(255 255 255 / .16); background: #0a0b0d; color: #fff; font: 900 1.9rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; text-align: center; text-transform: uppercase; }
.cast-form input:focus-visible { outline: none; border-color: var(--amber); }
.cast-form .btn { min-height: 52px; }
.cast-err { margin: 0; color: #ff9b8a; font-weight: 600; font-size: .92rem; }
.cast-err:empty { display: none; }
.cast-help summary { cursor: pointer; font-weight: 700; color: #ffcf7a; min-height: 32px; }
.cast-help p { margin: 8px 0 0; color: #c9c3b7; font-size: .9rem; line-height: 1.5; }

.cast-pill { position: fixed; z-index: 2147480800; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--amber); color: #141414; font: 900 .95rem/1 var(--font-display); box-shadow: 0 10px 30px rgb(0 0 0 / .35); cursor: pointer; }
.cast-pill[hidden] { display: none; }

/* ---------- phone: the smart remote ---------- */
html.cast-open, html.cast-open body { overflow: hidden; }
.cast-remote { position: fixed; inset: 0; z-index: 2147481100; overflow-y: auto; overscroll-behavior: contain; padding: calc(10px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 60% at 50% -10%, #2b1a06 0%, #0c0b0a 55%, #060606 100%); color: #f4efe6; font-family: var(--font-body);
  display: flex; flex-direction: column; gap: 12px; -webkit-user-select: none; user-select: none; }
.cast-remote[hidden] { display: none; }
.cast-remote > * { flex-shrink: 0; }
.cast-remote button { -webkit-tap-highlight-color: transparent; font-family: inherit; }
.cr-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cr-ic { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgb(255 255 255 / .08); color: #fff; cursor: pointer; }
.cr-ic--off { color: #ff8a73; }
.cr-conn { margin: 0; display: inline-flex; align-items: center; gap: 8px; font: 700 .85rem/1 var(--font-body); color: #cfc6b6; }
.cr-conn i { width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 4px rgb(61 220 132 / .18); }
.cr-conn.is-off i { background: #ffb020; box-shadow: 0 0 0 4px rgb(255 176 32 / .18); animation: crBlink 1.2s infinite; }
@keyframes crBlink { 50% { opacity: .3; } }
.cr-now { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 20px; background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .08); }
.cr-now__n { font: 900 2.4rem/1 var(--font-display); color: #3ddc84; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgb(61 220 132 / .45); min-width: 2.2ch; }
.cr-now__t { min-width: 0; display: grid; gap: 3px; }
.cr-now__t strong { font: 800 1.1rem/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-now__t small { color: #bdb5a6; font-size: .86rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cr-now__live { justify-self: start; font: 800 .62rem/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; padding: 4px 7px; border-radius: 6px; background: #e5322d; color: #fff; }
.cr-now__live[hidden] { display: none; }
.cr-prog { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font: 700 .8rem/1 var(--font-body); color: #bdb5a6; font-variant-numeric: tabular-nums; }
.cr-prog[hidden] { display: none; }
.cr-prog input { width: 100%; accent-color: var(--amber); min-height: 32px; }
.cr-warn { margin: 0; padding: 10px 12px; border-radius: 14px; background: rgb(255 176 32 / .12); border: 1px solid rgb(255 176 32 / .4); color: #ffd99a; font-size: .86rem; line-height: 1.4; }
.cr-warn[hidden] { display: none; }
.cr-warn button { margin-left: 4px; border: 0; background: none; color: #fff; font-weight: 800; text-decoration: underline; cursor: pointer; padding: 6px 2px; }
.cr-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 16px; background: rgb(255 255 255 / .06); }
.cr-tabs button { min-height: 42px; border: 0; border-radius: 12px; background: none; color: #cfc6b6; font: 800 .92rem/1 var(--font-display); cursor: pointer; }
.cr-tabs [aria-selected="true"] { background: #f4efe6; color: #141414; }
.cr-pane { display: grid; gap: 14px; align-content: start; }
.cr-pane[hidden] { display: none; }
.cr-deck { display: grid; grid-template-columns: 68px 1fr 68px; gap: 12px; align-items: stretch; }
.cr-rocker { display: grid; grid-template-rows: 1fr auto 1fr; border-radius: 999px; background: linear-gradient(180deg, #2a2724, #171513); border: 1px solid rgb(255 255 255 / .1); box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 10px 24px rgb(0 0 0 / .4); overflow: hidden; }
.cr-rocker button { border: 0; background: none; color: #fff; display: grid; place-items: center; min-height: 84px; cursor: pointer; transition: background .15s; }
.cr-rocker button:active, .cr-rocker button.is-hit { background: rgb(245 166 35 / .22); }
.cr-rocker__k { display: grid; justify-items: center; gap: 4px; padding: 6px 0; font: 900 .72rem/1 var(--font-display); letter-spacing: .14em; color: #a89f8f; }
.cr-rocker__k em { font-style: normal; color: #fff; font-size: .9rem; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.cr-pad { position: relative; min-height: 230px; border-radius: 28px; background: radial-gradient(circle at 50% 40%, rgb(255 255 255 / .09), rgb(255 255 255 / .02) 70%), #121110;
  border: 1px solid rgb(255 255 255 / .1); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .4), inset 0 20px 40px rgb(0 0 0 / .35); touch-action: none; display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.cr-pad:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.cr-pad__hint { text-align: center; color: #8d8577; font: 600 .86rem/1.6 var(--font-body); pointer-events: none; }
.cr-pad__hint b { color: #d6cdbd; }
.cr-pad__fx { position: absolute; transform: translate(-50%, -50%) scale(.6); padding: 10px 16px; border-radius: 999px; background: var(--amber); color: #141414; font: 900 1.1rem/1 var(--font-display); opacity: 0; pointer-events: none; white-space: nowrap; }
.cr-pad__fx.is-on { animation: crFx .7s ease-out; }
@keyframes crFx { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 100% { opacity: 0; transform: translate(-50%, -90%) scale(1); } }
.cr-keys { display: grid; grid-template-columns: 1fr 88px 1fr; gap: 14px; align-items: center; }
.cr-keys button { min-height: 62px; border: 1px solid rgb(255 255 255 / .1); border-radius: 20px; background: #1b1917; color: #fff; display: grid; place-items: center; cursor: pointer; }
.cr-keys .cr-play { width: 88px; height: 88px; min-height: 0; padding: 0; border-radius: 50%; background: linear-gradient(135deg, var(--amber), #ffbe55); color: #141414; border: 0; box-shadow: 0 10px 30px rgb(245 166 35 / .3); }
.cr-keys button.is-hit, .cr-row button.is-hit, .cr-num button.is-hit { transform: scale(.96); }
.cr-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cr-row button { flex: 1 1 0; min-width: 64px; min-height: 62px; display: grid; justify-items: center; align-content: center; gap: 4px; border: 1px solid rgb(255 255 255 / .1); border-radius: 18px; background: #1b1917; color: #f4efe6; font: 700 .74rem/1 var(--font-body); cursor: pointer; }
.cr-row button[hidden] { display: none; }
.cr-row button[aria-pressed="true"] { background: #3a2a10; border-color: var(--amber); color: #ffcf7a; }
.cr-mic.is-on { background: #e5322d !important; border-color: #e5322d !important; color: #fff !important; animation: crMic 1s ease-in-out infinite; }
@keyframes crMic { 50% { box-shadow: 0 0 0 8px rgb(229 50 45 / .25); } }
.cr-heard { margin: 0; min-height: 1.3em; text-align: center; color: #cfc6b6; font-size: .9rem; }
.cr-find { min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid rgb(255 255 255 / .14); background: #0d0c0b; color: #fff; font: 600 1rem/1 var(--font-body); }
.cr-find:focus-visible { outline: 2px solid var(--amber); }
.cr-guide { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cr-guide button { width: 100%; min-height: 54px; display: grid; grid-template-columns: 3ch 1fr auto; gap: 12px; align-items: center; padding: 0 14px; border: 1px solid rgb(255 255 255 / .08); border-radius: 14px; background: #161412; color: #f4efe6; text-align: left; cursor: pointer; font: 700 .95rem/1.2 var(--font-body); }
.cr-guide b { color: #3ddc84; font: 900 1rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.cr-guide span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-guide i { font: 800 .6rem/1 var(--font-display); font-style: normal; letter-spacing: .12em; text-transform: uppercase; padding: 4px 6px; border-radius: 6px; background: #e5322d; color: #fff; }
.cr-guide [aria-current="true"] { border-color: var(--amber); background: #2a1e0b; }
.cr-empty { color: #a89f8f; padding: 18px 4px; text-align: center; }
.cr-dial { margin: 0; text-align: center; color: #a89f8f; font: 800 .9rem/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.cr-dial b { display: block; margin-top: 8px; color: #3ddc84; font-size: 3rem; letter-spacing: .06em; text-shadow: 0 0 18px rgb(61 220 132 / .45); }
.cr-num { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cr-num button { min-height: 66px; border: 1px solid rgb(255 255 255 / .1); border-radius: 20px; background: #1b1917; color: #fff; font: 900 1.5rem/1 var(--font-display); cursor: pointer; }
.cr-num .cr-num__go { background: var(--amber); color: #141414; border: 0; font-size: 1.1rem; }
.cr-foot { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 4px; }
.cr-foot button { min-height: 50px; border-radius: 14px; border: 1px solid rgb(255 255 255 / .14); background: none; color: #f4efe6; font: 800 .9rem/1 var(--font-display); cursor: pointer; }
.cr-foot [data-r-stop2] { color: #ff9b8a; border-color: rgb(255 138 115 / .4); }
.cast-remote :focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .cr-pad__fx.is-on, .cr-mic.is-on, .cr-conn.is-off i { animation: none; } .cast-chip, .cast-vol { transition: none; } }
@media (min-width: 720px) { .cast-remote { padding-left: max(16px, calc(50vw - 260px)); padding-right: max(16px, calc(50vw - 260px)); } }
