/* TV launcher — a 10-foot interface. Everything is sized in rem, and 1rem scales with the screen
   (16px on a 1920×1080 TV), so the layout looks the same on the TV and on a laptop preview. */

:root {
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, .78);
  --ink-3: rgba(255, 255, 255, .55);
  --glass: rgba(8, 10, 18, .52);
  --glass-edge: rgba(255, 255, 255, .14);
  --accent: #ffd27a;
  --radius: 1.1rem;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* A big, high-contrast pointer for the air mouse. */
  --cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M6 4l30 16-13 3-6 13z' fill='%23fff' stroke='%23000' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 4, auto;
}

* { box-sizing: border-box; }
html { font-size: min(calc(100vw / 120), calc(100vh / 67.5)); }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Figtree', system-ui, sans-serif;
  color: var(--ink);
  background: #05070d;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: var(--cursor);
}
body * { cursor: inherit; }
body.cursor-hidden, body.cursor-hidden * { cursor: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus { outline: none; }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-photo { position: absolute; inset: 0; background-size: cover; background-position: center; animation: drift 90s ease-in-out infinite alternate; }
.bg-art, .bg-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg-glow { position: absolute; inset: 0; }
.bg-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.2) 55%, rgba(0,0,0,.5) 100%), linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.45)); }
@keyframes drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.08) translate(-1%, -1%); } }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 1fr 28rem; gap: 3rem; height: 100vh; padding: 3rem 3.5rem 3rem 4.5rem; }
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar { display: flex; align-items: center; gap: 2rem; margin-bottom: 2.75rem; }
.search-pill {
  display: inline-flex; align-items: center; gap: .9rem;
  padding: 1rem 2rem 1rem 1.5rem; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 2px solid var(--glass-edge);
  backdrop-filter: blur(20px);
  font-size: 1.75rem; font-weight: 600; color: var(--ink);
  transition: transform .25s var(--ease), background .25s, box-shadow .25s;
}
.search-pill svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.search-pill:hover, .search-pill:focus-visible, .search-pill:focus { background: #fff; color: #111; transform: scale(1.08); box-shadow: 0 1rem 2.5rem rgba(0,0,0,.45); }
.theme-label { font-size: 1.5rem; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; }
.edit-link { margin-left: auto; font-size: 1.2rem; color: var(--ink-3); padding: .5rem 1rem; border-radius: .6rem; }
.edit-link:hover { color: var(--ink); background: rgba(255,255,255,.1); }

/* ---------- tiles ---------- */
.tiles { display: grid; perspective: 70rem; }
.tiles.big { grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 3.4rem 3rem; padding: .5rem; }
.tiles.small { grid-template-columns: repeat(6, 1fr); gap: 2.4rem 2rem; margin-top: auto; padding: 2.5rem .5rem .5rem; }

.tile { display: flex; flex-direction: column; align-items: center; gap: 1rem; transform-style: preserve-3d; }
.face {
  --rx: 0deg; --ry: 0deg; --hx: 50%; --hy: 0%;
  position: relative; width: 100%; aspect-ratio: 5 / 3; border-radius: var(--radius);
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 .6rem 1.4rem rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.08);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  will-change: transform;
}
.tile-small .face { border-radius: .8rem; }
.sheen { position: absolute; inset: 0; opacity: 0; transition: opacity .3s; background: radial-gradient(70% 90% at var(--hx) var(--hy), rgba(255,255,255,.38), rgba(255,255,255,0) 60%); pointer-events: none; }
.logo-svg { width: auto; height: 46%; max-width: 70%; }
.tile-small .logo-svg { height: 44%; }
.logo-img { max-width: 72%; max-height: 62%; object-fit: contain; }
.wordmark { font-size: 3.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; text-align: center; padding: 0 1rem; }
.tile-small .wordmark { font-size: 1.9rem; }
.wm-prime { text-transform: lowercase; font-weight: 700; letter-spacing: -.02em; position: relative; padding-bottom: .5rem; }
.wm-prime::after { content: ''; position: absolute; left: 22%; right: 30%; bottom: 0; height: .35rem; border-radius: 0 0 1rem 1rem; border-bottom: .3rem solid #1a98ff; }
.wm-disney { font-style: italic; font-weight: 700; letter-spacing: -.01em; }
.wm-hulu { text-transform: lowercase; font-weight: 800; font-size: 4rem; }
.wm-peacock { text-transform: lowercase; font-weight: 800; }

.label { font-size: 1.6rem; font-weight: 600; color: var(--ink-2); text-shadow: 0 2px 8px rgba(0,0,0,.6); transition: color .25s, transform .3s var(--ease); white-space: nowrap; }
.tile-small .label { font-size: 1.3rem; }

/* Focus = hover = selected. Lifts, tilts, glows, and gets a bright ring for couch visibility. */
.tile:focus .face, .tile:hover .face {
  transform: translateY(-.6rem) scale(1.1) rotateX(var(--rx)) rotateY(var(--ry));
  box-shadow: 0 2.2rem 3.5rem rgba(0,0,0,.55), 0 0 0 .3rem rgba(255,255,255,.95), 0 0 2.5rem .4rem color-mix(in srgb, var(--accent) 45%, transparent);
}
.tile:focus .sheen, .tile:hover .sheen { opacity: 1; }
.tile:focus .label, .tile:hover .label { color: #fff; transform: translateY(.6rem); }
.tile:active .face { transform: translateY(-.2rem) scale(1.04); transition-duration: .08s; }

/* ---------- sidebar + widgets ---------- */
.side {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  padding: 2.2rem 2.2rem 2rem; border-radius: 1.8rem;
  background: var(--glass); border: 1px solid var(--glass-edge); backdrop-filter: blur(28px) saturate(1.2);
  box-shadow: 0 1.5rem 3rem rgba(0,0,0,.35);
}
.w { flex: none; }
.w + .w { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--glass-edge); }
.w-clock + .w-countdown { margin-top: .5rem; padding-top: 0; border-top: 0; }
.w-grow { flex: 1 1 0; min-height: 11rem; display: flex; flex-direction: column; }
.w-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: 1.45rem; font-weight: 700; margin-bottom: .8rem; }
.w-sub { font-size: 1.15rem; font-weight: 600; color: var(--ink-3); }
.w-credit { font-size: .85rem; color: var(--ink-3); margin-top: .5rem; }

.clock { font-size: 7rem; font-weight: 700; line-height: .95; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.clock::after { content: attr(data-ampm); font-size: 2rem; font-weight: 600; letter-spacing: 0; margin-left: .6rem; color: var(--ink-2); }
.date { font-size: 2rem; font-weight: 600; margin-top: .8rem; color: var(--ink); }
.countdown { font-size: 1.5rem; font-weight: 600; color: color-mix(in srgb, var(--accent) 45%, white); min-height: 1.8rem; }

.wx-now { display: flex; align-items: center; gap: 1.2rem; }
.wx-icon { width: 5rem; height: 5rem; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wx-icon.sm { width: 2.4rem; height: 2.4rem; stroke-width: 1.8; }
.wx-temp { font-size: 5.5rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.wx-desc { font-size: 1.8rem; font-weight: 600; margin-top: .4rem; }
.wx-hilo { font-size: 1.35rem; color: var(--ink-2); margin-top: .4rem; white-space: pre; }
.wx-place { font-size: 1.1rem; color: var(--ink-3); margin-top: .9rem; }
.wx-loading { font-size: 1.4rem; color: var(--ink-3); }
.fc { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1.2rem; }
.fc-day { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .7rem .4rem; border-radius: .8rem; background: rgba(255,255,255,.07); font-size: 1.25rem; }
.fc-day span { color: var(--ink-2); font-weight: 600; }
.fc-day b { font-size: 1.5rem; }
.fc-day i { font-style: normal; color: var(--ink-3); }

/* map widgets (radar) */
.w-radar { position: relative; border-radius: 1.1rem; overflow: hidden; }
.w-radar.w-grow { padding-top: 0; }
.w + .w-radar { padding-top: 0; border-top: 0; }
.map { flex: 1; min-height: 0; background: #0d1117; border-radius: 1.1rem; border: 1px solid var(--glass-edge); }
.map-label { position: absolute; top: .7rem; left: .8rem; z-index: 500; font-size: 1.1rem; font-weight: 700; padding: .3rem .7rem; border-radius: .5rem; background: rgba(0,0,0,.55); }
.map .leaflet-control-attribution { font-size: .7rem; background: rgba(0,0,0,.5) !important; color: rgba(255,255,255,.6); }
.map .leaflet-control-attribution a { color: rgba(255,255,255,.7); }
.leaflet-container { cursor: inherit !important; }

/* planes overhead */
.fl-scope { position: relative; flex: 1; min-height: 6rem; border-radius: 1rem; overflow: hidden;
  background: radial-gradient(circle at center, rgba(20, 70, 45, .55), rgba(5, 20, 14, .75) 70%); border: 1px solid rgba(120,255,170,.18); }
.fl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fl-sweep { position: absolute; left: 50%; top: 50%; width: 140%; aspect-ratio: 1; translate: -50% -50%; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(120,255,170,.22), rgba(120,255,170,0) 50deg, transparent 360deg); border-radius: 50%; animation: sweep 8s linear infinite; }
@keyframes sweep { to { rotate: 360deg; } }
.fl-card { margin-top: .8rem; flex: none; }
.fl-top { display: flex; align-items: baseline; gap: .8rem; }
.fl-call { font-size: 2.1rem; letter-spacing: -.01em; }
.fl-air { font-size: 1.3rem; color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-route { display: flex; align-items: baseline; gap: .6rem; font-size: 1.35rem; margin-top: .3rem; white-space: nowrap; overflow: hidden; }
.fl-route span { overflow: hidden; text-overflow: ellipsis; }
.fl-route b { font-size: 1.6rem; }
.fl-route.dim { color: var(--ink-2); }
.fl-arrow { color: #ffd27a; font-weight: 700; flex: none; }
.fl-bar { height: .35rem; border-radius: 1rem; background: rgba(255,255,255,.15); margin-top: .5rem; overflow: hidden; }
.fl-bar i { display: block; height: 100%; background: #ffd27a; border-radius: 1rem; }
.fl-stats { font-size: 1.25rem; color: var(--ink-2); margin-top: .5rem; font-variant-numeric: tabular-nums; }
.fl-type { font-size: 1.1rem; color: var(--ink-3); margin-top: .2rem; }

/* sun & moon */
.sun-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: .8rem; align-items: center; }
.sun-row small { display: block; font-size: 1.1rem; color: var(--ink-3); font-weight: 600; }
.sun-row b { font-size: 1.7rem; }
.moon-cell { display: flex; align-items: center; gap: .7rem; }
.moon { width: 3.6rem; height: 3.6rem; flex: none; }
.moon-cell small { color: var(--ink-2); }

/* want to watch */
.wl { display: flex; flex-direction: column; gap: .5rem; }
.wl-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem .8rem; border-radius: .7rem; background: rgba(255,255,255,.07); font-size: 1.35rem; font-weight: 600; transition: background .2s, transform .2s var(--ease); }
.wl-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-row .chip { font-size: 1rem; font-weight: 700; padding: .2rem .5rem; border-radius: .4rem; flex: none; }
.wl-row:hover, .wl-row:focus { background: #fff; color: #111; transform: scale(1.03); }

/* ---------- PIN screen ---------- */
.pin-body { display: grid; place-items: center; }
.pin { text-align: center; padding: 3rem 4rem; border-radius: 2rem; background: var(--glass); border: 1px solid var(--glass-edge); backdrop-filter: blur(28px); }
.pin h1 { font-size: 3.4rem; margin: 0 0 1rem; }
.pin-msg { font-size: 1.5rem; color: var(--ink-2); margin: .4rem 0; min-height: 1.8rem; }
.pin-error { color: #ff8a80; font-weight: 600; }
#pin { position: absolute; opacity: 0; pointer-events: none; width: 1px; }
.dots { display: flex; justify-content: center; gap: 1.2rem; height: 2.4rem; margin: 1.4rem 0 2rem; }
.dots i { width: 2rem; height: 2rem; border-radius: 50%; background: #fff; }
.pad { display: grid; grid-template-columns: repeat(3, 8.5rem); gap: 1.4rem; }
.key { height: 7rem; border-radius: 1.4rem; border: 2px solid var(--glass-edge); background: rgba(255,255,255,.12); font-size: 3rem; font-weight: 700; transition: transform .2s var(--ease), background .2s; }
.key-sm { font-size: 1.6rem; }
.key-go { background: rgba(255,255,255,.28); font-size: 2.2rem; }
.key:hover, .key:focus { background: #fff; color: #111; transform: scale(1.08); }
