/* TUBE web. Kids mode: black background, rounded rectangles, no text anywhere but the search bar. */
:root {
  --bg: #000;
  --tile: #1c1c1e;
  --radius: 18px;
  --gap: 16px;
  --rail: 320px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: #fff; font: 20px -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; }
#app { min-height: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }

/* Launch page */
.launch { max-width: 1100px; margin: 0 auto; padding: var(--gap); display: flex; flex-direction: column; gap: var(--gap); }
.search { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 20px; border-radius: 999px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15); }
.search:focus-within { border-color: rgba(255,255,255,.35); }
.search svg { width: 26px; height: 26px; flex: none; opacity: .7; }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: #fff; font: 22px inherit; caret-color: #e00; }
.search input::placeholder { color: rgba(255,255,255,.4); }
.search .clear { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.5); color: #000; display: none; place-items: center; }
.search .clear svg { width: 14px; height: 14px; opacity: 1; }
.search.has-text .clear { display: grid; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--gap); }
.card { aspect-ratio: 1; border-radius: 28px; overflow: hidden; background: var(--tile); transition: transform .12s ease; }
.card img { width: 100%; height: 100%; object-fit: cover; }
.card:hover { transform: scale(1.03); }
.card:active { transform: scale(.97); }

/* Thumbnail grids (channel, search) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); padding: var(--gap); padding-left: 96px; }
.tile { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--tile); transition: transform .12s ease; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile:hover { transform: scale(1.03); }
.tile:active { transform: scale(.97); }
.sentinel { height: 1px; }

/* Round home button: fixed top-left on grids, top of the rail on the watch page */
.home { position: fixed; top: var(--gap); left: var(--gap); width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255,255,255,.14); backdrop-filter: blur(12px); display: grid; place-items: center; z-index: 5; }
.home:hover { background: rgba(255,255,255,.24); }
.home svg { width: 30px; height: 30px; }

/* Watch page: player fills the stage, same-channel rail on the right */
.watch { display: flex; height: 100vh; }
.stage { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.frame { width: min(100%, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; background: #000; }
.frame iframe, .frame > div { width: 100%; height: 100%; border: 0; }
.rail { width: var(--rail); flex: none; overflow-y: auto; padding: var(--gap); display: flex; flex-direction: column; gap: var(--gap); }
.rail .home { position: sticky; top: 0; align-self: center; flex: none; }
.rail .tile { flex: none; }
.rail .tile.current { display: none; }

.spinner { position: fixed; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .8s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 120px var(--gap); text-align: center; opacity: .3; font-size: 64px; }
