:root {
  --bg: #0f1419;
  --rail: #121a21;
  --text: #f2f5f7;
  --muted: #9aa6b0;
  --accent: #3dd9c4;
  --accent-ink: #06201c;
  --live: #e5364b;
  --card: #1c252d;
  --focus: #ffffff;
}
* { box-sizing: border-box; }
/* 1rem = 16px on a 1920px-wide screen; everything scales with the TV. */
html { font-size: 0.8333vw; background: var(--bg); color-scheme: dark; }
body {
  margin: 0; height: 100vh; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", Roboto, system-ui, sans-serif; cursor: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: none; }
button:focus { outline: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Backdrop of the focused title */
#backdrop { position: fixed; inset: 0; z-index: 0; }
#backdrop .img { position: absolute; inset: 0; background-size: cover; background-position: center top; opacity: 0; transition: opacity .6s; }
#backdrop .img.on { opacity: .55; }
#backdrop .shade { position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(15,20,25,.92) 0%, rgba(15,20,25,.55) 45%, rgba(15,20,25,.15) 100%),
              linear-gradient(0deg, rgba(15,20,25,1) 0%, rgba(15,20,25,.7) 40%, rgba(15,20,25,0) 75%); }

/* Left menu */
#rail { position: fixed; left: 0; top: 0; bottom: 0; width: 8.6rem; z-index: 3; background: var(--rail);
  display: flex; flex-direction: column; align-items: center; padding-top: 1.2rem; gap: .5rem; }
#rail .brand { color: var(--accent); font-weight: 600; font-size: 1.5rem; letter-spacing: .05em; margin-bottom: 1.2rem; }
.rail-btn { width: 7.6rem; padding: .9rem 0 .7rem; border-radius: 1.2rem; display: flex; flex-direction: column; align-items: center; gap: .35rem; color: #c9d2d9; position: relative; transition: background .15s, color .15s; }
.rail-btn svg { width: 2.2rem; height: 2.2rem; }
.rail-btn span { font-size: 1.25rem; }
.rail-btn.current { color: var(--accent); }
.rail-btn.current::before { content: ""; position: absolute; left: -.5rem; top: 1.2rem; bottom: 1.2rem; width: .35rem; border-radius: .2rem; background: var(--accent); }
.rail-btn.focused { background: #f2f5f7; color: #0f1419; }

/* Content area */
#content { position: absolute; left: 8.6rem; right: 0; top: 0; bottom: 0; z-index: 1; overflow: hidden; }
#top { display: flex; align-items: baseline; gap: 3rem; padding: 2rem 4rem 0 4rem; }
#clock { font-size: 6.4rem; font-weight: 500; letter-spacing: -.02em; line-height: 1; }
#date, #weather { font-size: 2.4rem; }
#weather-next { font-size: 1.7rem; color: var(--accent); margin-left: -1.5rem; }
#page { position: absolute; left: 0; right: 0; top: 10rem; bottom: 0; overflow: hidden; }
#scroller { padding: 0 4rem 6rem; transition: transform .25s ease; }

/* Featured title */
.hero h1 { font-size: 3.4rem; font-weight: 400; margin: 1.2rem 0 .6rem; }
.hero .meta { font-size: 1.6rem; color: #cfd6dc; }
.hero .mine { font-size: 1.6rem; color: var(--accent); margin-top: .5rem; min-height: 2rem; }
.hero .actions { display: flex; align-items: center; gap: 1.6rem; margin-top: 1.4rem; }
.pill { display: inline-flex; align-items: center; gap: 1rem; background: var(--accent); color: var(--accent-ink); font-size: 1.8rem; padding: 1.1rem 2.4rem; border-radius: 3rem; }
.pill svg { width: 2rem; height: 2rem; }
.pill.ghost { background: rgba(255,255,255,.12); color: var(--text); }
.pill.focused { box-shadow: 0 0 0 .3rem var(--focus); transform: scale(1.04); }
.hero .hint { color: var(--muted); font-size: 1.5rem; }

/* Rows */
.row { margin-top: 2.2rem; }
.row h2 { font-size: 2.6rem; font-weight: 500; margin: 0 0 1.1rem; }
.strip { display: flex; gap: 1.6rem; transition: transform .25s ease; }
.row { clip-path: inset(-3rem -100vw -3rem -1.5rem); }
.card { flex: none; text-align: left; position: relative; border-radius: 1rem; overflow: hidden; background: var(--card); transition: transform .15s, box-shadow .15s; }
.card .art { position: absolute; inset: 0; background-size: cover; background-position: center; }
.card.demo .ph { z-index: 1; }
.card.wide.demo .ph { display: none; }
.card .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 1rem; text-align: center; font-size: 1.6rem; color: #d8dfe4; }
.card.focused { box-shadow: 0 0 0 .35rem var(--focus); transform: scale(1.04); z-index: 2; }
.card.poster { width: 12rem; height: 18rem; }
.card.wide { width: 31.2rem; height: 17.4rem; }
.card.wide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.2) 55%, rgba(0,0,0,0) 100%); }
.card .label { position: absolute; z-index: 1; left: .9rem; top: .9rem; background: var(--accent); color: var(--accent-ink); font-size: 1.15rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .3rem .7rem; border-radius: .4rem; }
.card .label.live { background: var(--live); color: #fff; }
.card .cap { position: absolute; z-index: 1; left: 1.2rem; right: 1.2rem; bottom: 1rem; }
.card .cap b { display: block; font-weight: 400; font-size: 1.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cap small { display: block; font-size: 1.4rem; color: #c3ccd3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .badge { position: absolute; z-index: 1; right: .6rem; top: .6rem; background: var(--accent); color: var(--accent-ink); font-size: 1.2rem; font-weight: 700; padding: .15rem .5rem; border-radius: .4rem; }
.card .seen { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.7); font-size: 1.3rem; text-align: center; padding: .3rem; }
.card .bar { position: absolute; z-index: 1; left: 0; bottom: 0; height: .4rem; background: var(--accent); }
.empty { color: var(--muted); font-size: 1.7rem; }

/* Panels: details, settings, sign-in */
.panel { max-width: 90rem; }
.panel h1 { font-size: 3.4rem; font-weight: 400; margin: 1rem 0 .6rem; }
.panel p { font-size: 1.8rem; line-height: 1.5; color: #d3dade; max-width: 75rem; }
.panel .code { font-size: 5rem; letter-spacing: .3em; color: var(--accent); margin: 1.5rem 0; }
.field { display: flex; align-items: center; gap: 1.5rem; margin: 1.1rem 0; font-size: 1.7rem; }
.field label { width: 22rem; color: var(--muted); }
.field input { width: 46rem; font: inherit; font-size: 1.7rem; color: var(--text); background: rgba(255,255,255,.08); border: .15rem solid transparent; border-radius: .6rem; padding: .7rem 1rem; outline: none; }
.field input.focused { border-color: var(--focus); }
.search-box { margin-top: 1rem; }

#toast { position: fixed; z-index: 9; left: 50%; bottom: 3rem; transform: translateX(-50%); background: #26313a; color: var(--text); padding: 1rem 2rem; border-radius: .8rem; font-size: 1.6rem; opacity: 0; transition: opacity .2s; pointer-events: none; }
#toast.on { opacity: 1; }
