:root {
  --navy: #07122a;
  --navy-2: #0a1630;
  --cyan: #4ec9f5;
  --blue: #2b7bff;
  --text: #eef7ff;
  --muted: #9bb3c9;
  --focus: 0 0 0 3px #4ec9f5, 0 0 24px rgba(78,201,245,.45);
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: Inter, Segoe UI, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, #16345f 0, transparent 28%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 18px, transparent 18px 72px),
    linear-gradient(180deg, #0a1630, #07122a);
  overflow: hidden;
}
button, input { font: inherit; }
.screen { display: none; height: calc(100% - 86px); padding: 12px 28px 18px; }
.screen.active { display: block; }
.topbar { height: 86px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.logo { height: 58px; cursor: pointer; }
.top-right { display: flex; align-items: center; gap: 10px; }
#clock { font-weight: 700; letter-spacing: .04em; margin-right: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; background: #123; color: #fff;
}
.icon-btn.cyan { background: #1aa3d8; }
.icon-btn.orange { background: #e38b3a; }
.icon-btn:focus, [data-nav]:focus { outline: none; box-shadow: var(--focus); }

.home-tiles {
  display: grid;
  grid-template-columns: 1.18fr 1fr 1fr;
  grid-template-rows: minmax(220px, 1fr) 92px;
  gap: 16px;
  height: calc(100% - 110px);
}
.tile {
  border: 0; border-radius: 22px; color: #fff; font-size: 28px; font-weight: 800;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
}
.tile svg { width: 72px; height: 72px; }
.tile.live { grid-row: 1 / 3; background: linear-gradient(180deg, #5ad0ff, #2b7bff); }
.tile.movies { background: linear-gradient(135deg, #ff7eb3, #f5c16c); }
.tile.series { background: linear-gradient(135deg, #b07cff, #4ea3ff); }
.tile.epg { background: #2ec4b6; }
.tile.playlists { background: #3ddc97; color: #053321; }
.home-bar { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; }
.user-card, .meta-card { background: rgba(8,16,36,.72); border-radius: 14px; padding: 10px 14px; min-width: 240px; }
.status { color: #8dffb0; }

.browser-grid {
  display: grid;
  grid-template-columns: 240px 1fr 1.15fr 92px;
  gap: 10px; height: 100%;
}
.groups, .titles, .preview-pane, .epg-days {
  background: rgba(8,16,36,.78); border-radius: 16px; overflow: auto;
}
.group, .title-row, .day {
  padding: 12px 14px; display: flex; justify-content: space-between; cursor: pointer; border: 0;
  width: 100%; background: transparent; color: inherit; text-align: left;
}
.group.selected, .title-row.selected { background: #1a4a9a; }
.title-row.selected { background: #d7c14a; color: #111; }
.preview-video { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; }
video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.preview-hint { position: absolute; left: 8px; bottom: 8px; font-size: 12px; background: rgba(0,0,0,.5); padding: 4px 8px; border-radius: 8px; }
.preview-meta { display: flex; gap: 12px; align-items: center; padding: 10px; }
.preview-num { font-size: 28px; font-weight: 800; }
.epg-list { list-style: none; margin: 0; padding: 0 12px 12px; color: var(--muted); }
.panel-screen { overflow: auto; }
.panel-screen h1 { margin-top: 8px; }
.btn {
  background: linear-gradient(180deg, var(--cyan), var(--blue)); color: #041018;
  border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 800; cursor: pointer;
}
.btn.secondary { background: #123; color: #fff; }
form { display: grid; gap: 8px; max-width: 560px; }
select { padding: 10px 12px; border-radius: 10px; border: 1px solid #335; background: #07101f; color: #fff; }
.hidden { display: none !important; }
input { padding: 10px 12px; border-radius: 10px; border: 1px solid #335; background: #07101f; color: #fff; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; }
.fullscreen { position: fixed; inset: 0; background: #000; z-index: 20; }
.fullscreen.hidden { display: none; }
.fs-close { position: absolute; top: 16px; right: 16px; }
.lock-mac { font-size: 28px; }

@media (max-width: 900px) {
  .home-tiles, .browser-grid { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
  .tile.live { grid-row: auto; min-height: 180px; }
  .epg-days { display: none; }
  body { overflow: auto; }
  .screen { height: auto; min-height: calc(100% - 86px); }
}
