/* Bzz TV, phone app. The look follows bzz.georgeolaru.com (George's Bzz app). */
@font-face {
  font-family: Bricolage;
  src: url("/static/bricolage.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
:root {
  color-scheme: light;
  font-family: Bricolage, ui-sans-serif, system-ui, sans-serif;
  color: #242328;
  background: #e4e0d7;
  --ink: #242328;
  --paper: #f6f3eb;
  --white: #fffdf7;
  --line: #ded8cb;
  --muted: #625e59;
  --focus: #583b99;
  --error: #9c2a24;
  --green: #2f6344;
  --lime: #d7ed9f;
  --purple: #d8ccf8;
  --peach: #ffb5a4;
  --gold: #ffdc86;
  --blue: #accbfa;
  --radius: 24px;
  --gutter: clamp(16px, 5vw, 24px);
  --left-edge: max(var(--gutter), env(safe-area-inset-left));
  --right-edge: max(var(--gutter), env(safe-area-inset-right));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); }
button, input, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button { min-height: 44px; }
button:disabled { opacity: .56; cursor: not-allowed; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button, a { transition: background-color 160ms ease, color 160ms ease, transform 160ms ease; }
button:active:not(:disabled) { transform: translateY(1px); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
p { line-height: 1.45; }
h1, h2, h3 { letter-spacing: -.035em; overflow-wrap: anywhere; }
h1 { font-size: clamp(40px, 11vw, 56px); font-weight: 800; line-height: .96; }
h2 { font-size: 24px; font-weight: 760; line-height: 1.06; }
h3 { font-size: 17px; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle;
}
.icon.fill { fill: currentColor; stroke: none; }

/* frame */
.app { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; width: 100%; height: 100dvh; max-width: 720px; margin-inline: auto; background: var(--paper); overflow: hidden; }
.top {
  min-height: 70px;
  padding: calc(10px + env(safe-area-inset-top)) var(--right-edge) 6px var(--left-edge);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.brand { display: inline-flex; align-items: center; min-height: 44px; gap: 9px; color: var(--ink); text-decoration: none; font-size: 31px; font-weight: 800; letter-spacing: -.08em; line-height: 1; }
.brand small { font-size: 13px; letter-spacing: .06em; font-weight: 760; text-transform: uppercase; background: var(--ink); color: var(--white); border-radius: 8px; padding: 4px 6px 3px; margin-left: 2px; }
.key-mark { display: grid; grid-template-columns: repeat(3, 7px); place-content: center; gap: 2px; width: 34px; height: 34px; flex: none; background: var(--ink); border-radius: 10px; }
.key-mark i { width: 7px; height: 7px; background: var(--peach); border-radius: 50%; }
.key-mark i:nth-child(2) { border-radius: 1.5px; background: var(--gold); }
.key-mark i:nth-child(3) { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: var(--lime); }
.key-mark i:nth-child(4) { border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: var(--blue); }
.key-mark i:nth-child(5) { border-radius: 0; clip-path: polygon(50% 0, 100% 38%, 81% 100%, 19% 100%, 0 38%); background: var(--purple); }
.device-link {
  display: inline-flex; align-items: center; gap: 7px; max-width: 58vw;
  padding: 8px 10px 8px 12px; border: 1px solid var(--line); border-radius: 30px;
  background: var(--white); color: var(--ink); font-size: 14px; font-weight: 700;
}
.device-link span:not(.status-dot) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-link .icon { width: 16px; height: 16px; }
.status-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #827c70; }
[data-state="online"] .status-dot { background: var(--green); }
[data-state="offline"] .status-dot { background: var(--error); }
[data-state="phone"] .status-dot { background: var(--ink); }

.view-panel, .login { min-width: 0; overflow: auto; overscroll-behavior-y: contain; padding: 8px var(--right-edge) 40px var(--left-edge); -webkit-overflow-scrolling: touch; }
.page-heading { margin: 8px 0 22px; }
.page-heading > p:not(.kicker) { color: var(--muted); margin-top: 12px; }
.kicker { font-size: 13px; font-weight: 740; text-transform: uppercase; letter-spacing: .085em; }
.page-heading .kicker { margin-bottom: 10px; color: var(--muted); }
.back-button { margin: 0 0 4px -10px; color: var(--muted); padding-inline: 10px; border: 0; background: transparent; display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.back-button .icon { transform: rotate(180deg); width: 18px; height: 18px; }

/* buttons */
.primary, .secondary, .quiet {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 15px; padding: 10px 14px; font-weight: 720; line-height: 1.2;
}
.primary { background: var(--ink); color: var(--white); }
.secondary { border-color: #9b9385; background: var(--white); color: var(--ink); }
.quiet { color: var(--ink); background: transparent; }
.danger { color: var(--error); }
.full { width: 100%; }
.big { min-height: 56px; font-size: 18px; border-radius: 18px; }
@media (hover: hover) {
  .primary:hover:not(:disabled) { background: #424047; }
  .secondary:hover:not(:disabled), .quiet:hover:not(:disabled), .device-link:hover, .tabs button:hover, .row-button:hover { background: #ece6da; }
}

/* tabs */
.tabs {
  position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px;
  padding: 8px var(--right-edge) calc(8px + env(safe-area-inset-bottom)) var(--left-edge);
  border-top: 1px solid var(--line); background: var(--white);
}
.tabs button { display: grid; place-items: center; align-content: center; gap: 3px; min-height: 57px; border: 0; border-radius: 15px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 740; }
.tabs button[aria-current] { color: var(--ink); background: var(--lime); }
.tabs button[data-view="films"][aria-current] { background: var(--gold); }
.tabs button[data-view="tv"][aria-current] { background: var(--purple); }

/* cards */
.program-card { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--lime); padding: 20px; margin-bottom: 18px; display: grid; gap: 6px; }
.program-card h2 { font-size: clamp(24px, 7vw, 32px); }
.program-card .detail { font-size: 15px; font-weight: 650; }
.program-card .actions { margin-top: 10px; }
.show-list { display: grid; gap: 14px; }
.show-card {
  display: grid; text-align: left; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); color: var(--ink); overflow: hidden;
}
.show-card img, .film-card img, .hero { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--line); }
.show-card .body { padding: 14px 16px 16px; display: grid; gap: 4px; }
.show-card h2 { font-size: 23px; }
.meta { color: var(--muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.about { color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin: 12px 0 0; padding: 0; }
.chips li { border-radius: 20px; background: var(--lime); padding: 4px 10px; font-size: 13px; font-weight: 650; }
.film-card { border-color: transparent; background: var(--gold); }
.film-card .body { padding-top: 12px; }

.season { margin-top: 22px; }
.season h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .085em; color: var(--muted); margin-bottom: 6px; }
.episodes { list-style: none; margin: 0; padding: 0; }
.episodes li + li { border-top: 1px solid var(--line); }
.row-button {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%;
  padding: 10px 6px 10px 0; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left;
}
.row-button img, .row-button .ph { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--line); display: block; }
.row-button strong { display: block; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.row-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 600; }
.thumb { position: relative; }
.thumb .bar { position: absolute; left: 6px; right: 6px; bottom: 5px; height: 4px; border-radius: 2px; background: #fffdf7b3; overflow: hidden; }
.thumb .bar span { display: block; height: 100%; background: var(--ink); }
.watched { color: var(--green) !important; }

/* sheet */
.sheet {
  width: min(100%, 720px); max-width: 100%; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0;
  border-radius: 26px 26px 0 0; background: var(--paper); color: var(--ink); overflow: hidden;
}
.sheet[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.sheet::backdrop { background: #1b18256b; }
.sheet-bar { display: flex; justify-content: flex-end; padding: 6px 10px 0; }
.sheet-body { overflow: auto; overscroll-behavior: contain; padding: 4px var(--gutter) calc(24px + env(safe-area-inset-bottom)); }
.sheet .hero { border-radius: 18px; }
.sheet-heading { margin: 14px 0 6px; }
.sheet-heading .kicker { color: var(--muted); margin-bottom: 6px; }
.sheet-heading h2 { font-size: clamp(26px, 8vw, 32px); }
.summary { margin-top: 10px; }
.where { margin: 18px 0 10px; }
.where > p:first-child { font-size: 13px; font-weight: 740; text-transform: uppercase; letter-spacing: .085em; color: var(--muted); margin-bottom: 8px; }
.targets { display: flex; flex-wrap: wrap; gap: 6px; }
.target {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 13px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--white); font-weight: 700; font-size: 15px;
}
.target[aria-pressed="true"] { background: var(--purple); border-color: var(--focus); }
.target .icon { width: 18px; height: 18px; }
.target[data-offline] { color: var(--muted); }
.play-actions { display: grid; gap: 6px; margin-top: 14px; }
.hint { color: var(--muted); font-size: 14px; margin-top: 8px; }
.chapters { list-style: none; padding: 0; margin: 18px 0 0; }
.chapters li + li { border-top: 1px solid var(--line); }
.chapters button { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 0; color: var(--ink); }
.chapters time { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 650; }
.chapters [aria-current="true"] { font-weight: 760; }
.chapters [aria-current="true"] time { color: var(--ink); }

/* remote (a TV on the code) */
.now-card { border-radius: var(--radius); background: var(--blue); padding: 18px; margin-bottom: 16px; }
.now-card[data-phase="playing"] { background: var(--lime); }
.now-card[data-phase="idle"] { background: var(--white); border: 1px solid var(--line); }
.now-card[data-phase="blocked"] { background: var(--peach); }
.now-kicker { display: flex; align-items: center; gap: 7px; }
.now-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.now-card[data-phase="playing"] .now-dot { background: #d2382b; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .now-card[data-phase="playing"] .now-dot { animation: none; } }
.now-card h2 { margin: 6px 0 2px; font-size: clamp(24px, 7.5vw, 32px); }
.now-detail { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; }
.scrub { width: 100%; margin: 10px 0 2px; accent-color: var(--ink); height: 28px; }
.controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.controls button { min-height: 54px; border-radius: 16px; border: 1px solid #1d1b1633; background: #fffdf7cc; font-weight: 760; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 15px; }
.controls button.main { background: var(--ink); color: var(--white); border-color: var(--ink); }
.controls .icon { width: 24px; height: 24px; }

.paper { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.paper h2 { font-size: 21px; margin-bottom: 6px; }
.paper p + p, .paper ol { margin-top: 8px; }
.paper ol { padding-left: 20px; line-height: 1.45; }
.paper .muted { color: var(--muted); }
.pair-card { background: var(--purple); border: 0; }
.pair-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; }
.code-input { min-height: 54px; border: 1px solid #9b9385; border-radius: 15px; background: var(--white); padding: 8px 14px; font-size: 26px; font-weight: 760; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; width: 100%; }
.screen-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 12px 0; }
.screen-row + .screen-row { border-top: 1px solid var(--line); }
.screen-row strong { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.screen-row small { display: block; color: var(--muted); margin-top: 3px; font-size: 13px; font-weight: 600; }
.screen-row .row-actions { display: flex; gap: 4px; }
.small-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.small-actions button { min-height: 40px; padding: 7px 12px; font-size: 14px; }
.people { list-style: none; padding: 0; margin: 8px 0 0; }
.people li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.people small { display: block; color: var(--muted); font-size: 13px; }
.code-box { margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--lime); }
.code-box strong { font-size: 24px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.field { width: 100%; min-height: 48px; border: 1px solid #9b9385; border-radius: 14px; background: var(--white); padding: 8px 12px; font-size: 17px; }

/* now bar: a TV is playing */
.now-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 8px var(--right-edge) 8px var(--left-edge); background: var(--lime); border-top: 1px solid #1d1b1622;
}
.now-bar button.open { text-align: left; border: 0; background: transparent; padding: 0; min-height: 44px; color: var(--ink); min-width: 0; }
.now-bar strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.now-bar small { display: block; font-size: 12px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.now-bar .toggle { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--ink); color: var(--white); display: grid; place-items: center; }
.now-bar .icon { width: 22px; height: 22px; }

/* login */
.login { display: grid; align-content: center; gap: 26px; min-height: 100dvh; max-width: 560px; margin-inline: auto; }
.login a { color: var(--focus); font-weight: 700; }
.login-title { display: grid; gap: 12px; }
.login-title p { color: var(--muted); font-size: 18px; }
.login form { display: grid; gap: 10px; }
.login label { font-weight: 720; }
.login input { min-height: 56px; border: 1px solid #9b9385; border-radius: 15px; background: var(--white); padding: 8px 14px; font-size: 22px; letter-spacing: .08em; text-transform: uppercase; }
.error { color: var(--error); font-weight: 650; }
.set-art { position: relative; width: 140px; height: 96px; border-radius: 21px; background: var(--white); border: 1px solid var(--line); }
.set-art span { position: absolute; inset: 12% 25% 14% 9%; border-radius: 13px; background: var(--ink); }
.set-art span::after { content: ""; position: absolute; left: 18%; top: 28%; width: 30%; height: 40%; border-radius: 2px; background: var(--lime); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.set-art i { position: absolute; right: 8%; top: 22%; width: 13%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #77736c 1px, transparent 1.4px) center / 4px 4px; }

/* phone player */
.player { position: fixed; inset: 0; z-index: 10; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #111012; color: #fffdf7; }
.player-top { display: flex; align-items: center; gap: 10px; padding: calc(6px + env(safe-area-inset-top)) var(--right-edge) 6px var(--left-edge); }
.player-top strong { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-top button { border: 0; background: #ffffff1f; color: inherit; border-radius: 14px; padding: 8px 12px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.player video { width: 100%; height: 100%; min-height: 0; background: #000; object-fit: contain; }
.player-foot { padding: 10px var(--right-edge) calc(12px + env(safe-area-inset-bottom)) var(--left-edge); display: grid; gap: 8px; }
.player-foot p { color: #d9d4c8; font-size: 14px; }
.wireless { display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; padding: 30px; }
.wireless h2 { font-size: 30px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; background: var(--ink); color: var(--white); padding: 12px 16px; border-radius: 14px; font-weight: 650; max-width: calc(100% - 32px); box-shadow: 0 8px 30px #0003; }
.empty { color: var(--muted); padding: 20px 0; }
.loading { color: var(--muted); padding: 30px 0; text-align: center; }
.now-card .next { margin-top: 10px; background: #fffdf7cc; }
