:root {
  --night: #0f1a3c;
  --panel: #16244e;
  --line: #24356a;
  --text: #eef1f8;
  --muted: #93a0c2;
  --ba: #fecb00;
  --hr: #e2363d;
  --ok: #3ccf8e;
  --osd: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--night);
  color: var(--text);
  font: 16px/1.45 var(--body);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ba); outline-offset: 2px; }

.app { display: grid; grid-template-rows: auto 1fr; height: 100%; }
@media (min-width: 900px) {
  .app { grid-template-columns: 1fr 360px; grid-template-rows: 1fr; }
}

.stage { position: relative; background: #000; aspect-ratio: 16 / 9; width: 100%; }
@media (min-width: 900px) { .stage { aspect-ratio: auto; height: 100%; } }
video { width: 100%; height: 100%; display: block; background: #000; }

/* On-screen display kao na starom televizoru pri promjeni kanala */
.osd {
  position: absolute; top: 18px; right: 22px;
  display: flex; align-items: baseline; gap: 14px;
  font-family: var(--osd); color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 18px rgba(0,0,0,.5);
  pointer-events: none;
}
.osd-num { font-size: clamp(48px, 9vw, 112px); font-weight: 700; line-height: .9; color: var(--ba); }
.osd-name { font-size: clamp(18px, 2.6vw, 32px); font-weight: 500; }
.osd.show { animation: osd 3s ease forwards; }
@keyframes osd { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

.status {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; padding: 12px 18px; max-width: 80%;
  background: rgba(15, 26, 60, .92); border-left: 4px solid var(--hr);
  text-align: left;
}

.guide { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  background: none; border: 0; padding: 10px 12px; cursor: pointer;
  color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--ba); }

.list { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; flex: 1; }
.ch {
  display: grid; grid-template-columns: 52px 44px 1fr auto; align-items: center; gap: 12px;
  width: 100%; padding: 10px 14px; background: none; border: 0; text-align: left; cursor: pointer;
}
.ch:hover { background: rgba(255,255,255,.04); }
.ch[aria-current="true"] { background: rgba(254, 203, 0, .1); box-shadow: inset 4px 0 0 var(--ba); }
.ch-num { font: 700 26px/1 var(--osd); color: var(--muted); text-align: right; }
.ch[aria-current="true"] .ch-num { color: var(--ba); }
.ch-logo { width: 44px; height: 32px; object-fit: contain; background: rgba(255,255,255,.06); border-radius: 4px; }
.ch-name { font-weight: 500; }
.ch-meta { display: block; font-size: 13px; color: var(--muted); }
.ch-meta .ba { color: var(--ba); }
.ch-meta .hr { color: #ff7a7f; }
.ch-meta .down { color: var(--hr); }
.fav { background: none; border: 0; padding: 6px; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }
.fav[aria-pressed="true"] { color: var(--ba); }

.empty { padding: 24px 18px; color: var(--muted); margin: 0; }
.foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.foot a { color: var(--text); }
@media (max-width: 899px) { .foot span { display: none; } }

/* Prijava */
.login { display: grid; place-items: center; min-height: 100%; }
.login-box { width: min(360px, 90vw); display: grid; gap: 14px; }
.login-box h1 { font: 700 44px/1 var(--osd); margin: 0 0 8px; }
.login-box label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
.login-box input { padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.login-box button { padding: 12px; background: var(--ba); color: var(--night); border: 0; border-radius: 6px; font-weight: 600; cursor: pointer; }
.err { color: #ff7a7f; margin: 0; }

@media (prefers-reduced-motion: reduce) { .osd.show { animation: none; } }
