/* TV ("10-foot") layer for World Through Time. Loaded after the map's own styles.
   Designed for a 1920x1080 screen viewed from a sofa, driven by a remote's D-pad. */
html.tv{font-size:22px}
html.tv body{font-size:22px;padding:3.2vh 4vw 2.4vh;overflow:hidden;height:100vh}
html.tv .wrap{max-width:none;gap:1.4vh;height:100%;grid-template-rows:auto 1fr auto auto}
html.tv h1{font-size:44px}
html.tv .year{font-size:56px}
html.tv .era{font-size:22px}
html.tv .worldpop{font-size:20px}
html.tv footer,html.tv .zoombar,html.tv .timeline .row:nth-child(2),html.tv #play,html.tv .region,html.tv #count{display:none}
html.tv .plate{min-height:0;display:flex;flex-direction:column}
html.tv .plate-inner{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;background:var(--sea)}
html.tv .mapbox{height:100%;width:auto;max-height:100%;aspect-ratio:1000/394.44}
html.tv .caption{padding:8px 8px 2px;font-size:24px}
html.tv #hover{font-family:var(--display);font-size:28px}
html.tv .timeline{padding:10px 18px}
html.tv .timeline .row{gap:0}
html.tv .ticks{font-size:18px}

/* Info panel: larger type, thick focus rings. */
html.tv .info{width:min(640px,44%);left:16px;top:16px;bottom:16px}
html.tv .info h2{font-size:34px}
html.tv .info-dates,html.tv .info-pop{font-size:20px}
html.tv .info-pop .src{font-size:16px}
html.tv .follow-hint{font-size:17px}
html.tv .info-body{font-size:22px;line-height:1.5}
html.tv .info-body h3{font-size:22px}
html.tv .info-foot{font-size:15px}
html.tv .info-actions button{font-size:21px;padding:10px 18px}
html.tv .info-close{width:48px;height:48px;font-size:30px}
html.tv .follow-q{font-size:30px}
html.tv .f-year{font-size:18px}
html.tv .f-text{font-size:20px}
html.tv :focus{outline:none}
html.tv .tv-focusable:focus,html.tv .info button:focus,html.tv .tvmenu button:focus,html.tv .gate button:focus{
  outline:4px solid var(--accent);outline-offset:3px;box-shadow:0 0 0 9px rgba(126,52,24,.18)}
html.tv .f-list button:focus{outline-offset:-4px}

/* The territory chosen with up/down. */
.hit.tv-focus{stroke:var(--accent);stroke-width:3px;stroke-opacity:1;vector-effect:non-scaling-stroke;fill:rgba(126,52,24,.10)}

/* Bottom hint bar. */
.tvhint{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 34px;font-size:19px;color:var(--inkSoft);padding:2px 0 0}
.tvhint kbd{font:inherit;font-family:var(--display);color:var(--ink);border:1.5px solid var(--rule);border-radius:6px;padding:0 9px;margin-right:8px;background:var(--paper)}

/* Menu opened with Back. */
.tvmenu{position:fixed;inset:0;z-index:20;background:rgba(59,49,35,.55);display:flex;align-items:center;justify-content:center}
.tvmenu[hidden]{display:none}
.tvmenu .sheet{background:var(--paper);border:2px solid var(--ink);outline:1px solid var(--ink);outline-offset:5px;padding:34px 40px 30px;width:min(1240px,88vw);max-height:88vh;overflow:auto;box-shadow:0 20px 60px rgba(0,0,0,.35)}
.tvmenu h2{font-family:var(--display);font-weight:400;font-size:38px;margin:0 0 4px}
.tvmenu .sub{font-style:italic;color:var(--inkSoft);margin:0 0 20px;font-size:20px}
.tvmenu .group{font-family:var(--display);color:var(--accent);font-size:20px;letter-spacing:.06em;margin:18px 0 8px}
.tvmenu .grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.tvmenu button{font:21px var(--body);color:var(--ink);background:var(--chip);border:1.5px solid var(--rule);padding:12px 14px;text-align:left;cursor:pointer;border-radius:2px}
.tvmenu button[aria-pressed="true"]{background:var(--ink);color:var(--paper);border-color:var(--ink)}
.tvmenu button.exit{background:transparent}

/* Subscription gate and loading screen. */
.gate{position:fixed;inset:0;z-index:30;background:var(--page);display:flex;align-items:center;justify-content:center;padding:6vh 8vw}
.gate[hidden]{display:none}
.gate .card{max-width:1100px;display:grid;grid-template-columns:1.1fr 1fr;gap:56px;align-items:center}
.gate h1{font-size:64px;margin:0 0 16px}
.gate p{font-size:24px;line-height:1.5;margin:0 0 14px;color:var(--ink);max-width:36ch}
.gate .price{font-family:var(--display);font-size:30px;color:var(--accent);margin:22px 0 6px}
.gate .terms{font-size:18px;color:var(--inkSoft);font-style:italic;max-width:46ch}
.gate .buttons{display:flex;gap:18px;margin-top:26px;flex-wrap:wrap}
.gate button{font:24px var(--body);padding:14px 28px;border:2px solid var(--ink);background:var(--ink);color:var(--paper);cursor:pointer}
.gate button.secondary{background:transparent;color:var(--ink)}
.gate .art{aspect-ratio:1000/394;border:2px solid var(--ink);outline:1px solid var(--ink);outline-offset:4px;background:
  radial-gradient(ellipse at 30% 40%,#d9c08f 0 18%,transparent 19%),radial-gradient(ellipse at 62% 35%,#c9a46e 0 22%,transparent 23%),
  radial-gradient(ellipse at 75% 62%,#d6b383 0 12%,transparent 13%),radial-gradient(ellipse at 22% 70%,#cfb184 0 10%,transparent 11%),var(--sea)}
.gate .status{font-size:22px;font-style:italic;color:var(--inkSoft);min-height:1.5em;margin-top:18px}
.gate.loading .card{display:block;text-align:center}
.gate.loading .art,.gate.loading .buttons,.gate.loading .price,.gate.loading .terms,.gate.loading .pitch{display:none}
.gate .coderow{display:flex;gap:14px;margin-top:18px}
.gate .coderow[hidden]{display:none}
.gate input{font:26px var(--body);padding:12px 16px;border:2px solid var(--ink);background:var(--paper);color:var(--ink);width:12em}
html.tv .gate input:focus{outline:4px solid var(--accent);outline-offset:3px}

/* On-screen pointer driven by the D-pad. */
.tvptr{position:fixed;left:0;top:0;z-index:15;pointer-events:none;width:0;height:0}
.tvptr[hidden]{display:none}
.tvptr::before{content:"";position:absolute;left:-18px;top:-18px;width:30px;height:30px;border-radius:50%;
  border:3px solid var(--ink);background:rgba(244,234,210,.35)}
.tvptr::after{content:"";position:absolute;left:-5px;top:-5px;width:10px;height:10px;border-radius:50%;background:var(--accent)}
.tvptr.over::before{border-color:var(--accent);background:rgba(126,52,24,.18)}
/* The timeline while ◀ ▶ are adjusting the year. */
html.tv .timeline.tv-grab{outline:4px solid var(--accent);outline-offset:3px;box-shadow:0 0 0 9px rgba(126,52,24,.18)}

/* Screen fit: the map fills its frame without blue bars where the frame allows. */
html.tv .plate-inner{container-type:size}
html.tv .mapbox{height:auto;width:min(100cqw,calc(100cqh * 1000 / 394.44));max-height:none}
/* Territory panel: keep the title clear of the close button, and the text inside the panel. */
html.tv .info{overflow:hidden}
html.tv .info-head{gap:16px}
html.tv .info-title h2{overflow-wrap:anywhere}
html.tv .info-close{flex:none}

/* Subscription screen: one screen, no scrolling, buttons stacked for the remote. */
html.tv .gate{padding:5vh 6vw}
html.tv .gate .card{max-width:1560px;width:100%;grid-template-columns:1fr 1.15fr;gap:72px}
html.tv .gate h1{font-size:60px}
html.tv .gate .buttons{flex-direction:column;align-items:stretch;max-width:460px;gap:14px}
html.tv .gate button{text-align:center}
html.tv .gate .status{grid-column:1 / -1}

/* Error message, shown only when something goes wrong. */
.tverror{position:fixed;left:24px;bottom:24px;z-index:40;max-width:80vw;background:#7e3418;color:#fff;font:20px/1.4 var(--body);padding:12px 18px;border-radius:4px}
.tverror[hidden]{display:none}
.tvmenu .ver{font-size:16px;color:var(--inkSoft);margin:-12px 0 8px}

/* Website sign-in screen on laptops and phones (not TV). */
html:not(.tv) .gate{padding:24px;overflow:auto;align-items:center}
html:not(.tv) .gate .card{max-width:1100px;width:100%;grid-template-columns:1.1fr 1fr;gap:40px}
html:not(.tv) .gate h1{font-size:clamp(34px,5vw,56px)}
html:not(.tv) .gate p{font-size:clamp(17px,1.8vw,21px)}
html:not(.tv) .gate .price{font-size:clamp(20px,2.2vw,26px)}
html:not(.tv) .gate .status{grid-column:1 / -1}
html:not(.tv) .gate input{font-size:20px;width:100%;min-width:0}
html:not(.tv) .gate button{font-size:20px}
html:not(.tv) .gate .coderow{flex-wrap:nowrap}
html:not(.tv) .gate input:focus,html:not(.tv) .gate button:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
@media (max-width:760px){
  html:not(.tv) .gate .card{grid-template-columns:1fr;gap:20px}
  html:not(.tv) .gate .art{order:-1;max-width:420px}
}
html:not(.tv) .gate .coderow input{flex:1}
html:not(.tv) .gate .coderow button{flex:none;padding:12px 22px}
