/* OliverTV – TV obrazovka. Vše ve vw/vh, aby to sedělo na 1080p i 4K.
   Pozor: Tizen 5.0 = Chromium ~63 → žádný flex "gap", jen grid-gap. */
:root {
  --ink: #3d2c6b;
  --ink-soft: #6b5c96;
  --card: #ffffff;
  --focus: #ffc93c;
  --accent: #ff8a5c;
  --sky1: #bfe6ff;
  --sky2: #e9dcff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 100%);
  cursor: default;
}
.hidden { display: none !important; }

/* mraky */
#sky { position: fixed; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; overflow: hidden; }
.cloud { position: absolute; background: rgba(255,255,255,.75); border-radius: 50vw; }
.cloud:before, .cloud:after { content: ''; position: absolute; background: inherit; border-radius: 50%; }
.c1 { width: 16vw; height: 4vw; top: 14vh; left: -18vw; animation: drift 90s linear infinite; }
.c2 { width: 11vw; height: 3vw; top: 62vh; left: -14vw; animation: drift 120s linear infinite 30s; opacity: .6; }
.c3 { width: 20vw; height: 5vw; top: 84vh; left: -22vw; animation: drift 150s linear infinite 60s; opacity: .5; }
.cloud:before { width: 45%; height: 160%; top: -80%; left: 15%; }
.cloud:after { width: 35%; height: 130%; top: -55%; left: 50%; }
@keyframes drift { to { transform: translateX(140vw); } }

/* horní lišta */
#top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 3.2vh 4.5vw 0;
  height: 14vh;
}
.brand { display: flex; align-items: center; font-weight: 900; font-size: 2.6vw; letter-spacing: .02em; }
.brand-ico { width: 4vw; height: 4vw; margin-right: 1.2vw; }
.timebox {
  display: flex; align-items: center;
  background: rgba(255,255,255,.85); border-radius: 3vw;
  padding: 1vh 1.6vw; font-weight: 800; font-size: 1.5vw;
  box-shadow: 0 .4vw 1.2vw rgba(61,44,107,.12);
}
.timebox .sun { width: 2.4vw; height: 2.4vw; margin-right: 1vw; }
.timebox .bar { width: 12vw; height: 1.1vw; background: #efe8ff; border-radius: 1vw; overflow: hidden; margin-right: 1vw; }
.timebox .fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ffc93c, #ff8a5c); border-radius: 1vw; transition: width .6s; }
.timebox.low .fill { background: #ff6b6b; }

/* mřížka dlaždic */
#gridWrap { position: relative; z-index: 1; height: 86vh; overflow: hidden; padding: 0 4.5vw; }
#grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 3.2vw 2.6vw;
  padding: 3vh 0 8vh;
  transition: transform .35s ease;
}
.tile {
  position: relative;
  background: var(--card);
  border-radius: 1.6vw;
  overflow: hidden;
  box-shadow: 0 .5vw 1.6vw rgba(61,44,107,.14);
  transform: scale(1);
  transition: transform .18s ease, box-shadow .18s ease;
  border: .35vw solid transparent;
  cursor: pointer;
}
.tile .thumb {
  width: 100%; padding-top: 56.25%;
  background: #d9ccff center / cover no-repeat;
  position: relative;
}
.tile .thumb .ph {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 5vw; font-weight: 900; color: rgba(255,255,255,.9);
}
.tile .name {
  font-weight: 800; font-size: 1.55vw; line-height: 1.2;
  margin: 1.1vw 1.2vw 1.3vw;
  height: 3.72vw; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tile .badge {
  position: absolute; top: .8vw; left: .8vw;
  background: rgba(61,44,107,.85); color: #fff;
  font-weight: 900; font-size: 1vw; padding: .25vw .7vw; border-radius: .6vw;
}
.tile .badge.uk { background: #0057b7; }
.tile .badge.uk:after { content: ''; display: inline-block; width: 1.4vw; height: .9vw; margin-left: .4vw; vertical-align: -.05vw; background: linear-gradient(#0057b7 50%, #ffd700 50%); border-radius: .15vw; }
.tile .dur { position: absolute; bottom: .8vw; right: .8vw; background: rgba(0,0,0,.6); color: #fff; font-weight: 800; font-size: 1vw; padding: .2vw .6vw; border-radius: .5vw; }
.tile.focus {
  transform: scale(1.07);
  border-color: var(--focus);
  box-shadow: 0 0 0 .5vw rgba(255,201,60,.45), 0 1.2vw 3vw rgba(61,44,107,.3);
  z-index: 2;
}

#empty { text-align: center; margin-top: 18vh; font-size: 1.8vw; color: var(--ink-soft); }
.big { font-size: 3vw; font-weight: 900; color: var(--ink); margin: 0 0 1.5vh; }

#hint {
  position: fixed; right: 2vw; bottom: 1.6vh; z-index: 3;
  font-size: 1vw; font-weight: 800; color: var(--ink-soft);
  background: rgba(255,255,255,.7); padding: .3vw .9vw; border-radius: 1vw;
}
:fullscreen #hint, :-webkit-full-screen #hint { display: none; }
body.fs #hint { display: none; }

/* přehrávač */
#player { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: #000; z-index: 10; }
#player video { width: 100%; height: 100%; background: #000; transition: opacity 1.5s; }
#player.fade video { opacity: .1; }
#osd {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 6vh 4vw 5vh;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  color: #fff;
}
.osd-title { font-size: 2.2vw; font-weight: 900; margin-bottom: 2vh; }
.osd-row { display: flex; align-items: center; }
#osdIcon { width: 3vw; height: 3vw; margin-right: 1.5vw; }
.osd-bar { flex: 1; height: 1vw; background: rgba(255,255,255,.25); border-radius: 1vw; overflow: hidden; margin-right: 1.5vw; }
.osd-fill { height: 100%; width: 0; background: var(--focus); }
#osdTime { font-size: 1.4vw; font-weight: 800; min-width: 12vw; text-align: right; }

/* upozornění */
#toast {
  position: fixed; left: 50%; top: 6vh; z-index: 20;
  transform: translateX(-50%);
  background: #fff; color: var(--ink);
  font-size: 2vw; font-weight: 900;
  padding: 1.6vh 2.6vw; border-radius: 3vw;
  box-shadow: 0 1vw 3vw rgba(0,0,0,.3);
}

/* noc */
#night, #pair {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
#night { background: radial-gradient(ellipse at 50% 30%, #3b3486 0%, #1a1645 70%); color: #e9e4ff; font-size: 2vw; }
#night .big { color: #fff; font-size: 3.6vw; }
#night .moon { width: 13vw; height: 13vw; margin-bottom: 4vh; animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-1.5vh) rotate(-4deg); } }
.stars {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(.25vw .25vw at 10% 20%, #fff 50%, transparent 51%),
    radial-gradient(.2vw .2vw at 25% 70%, #fff 50%, transparent 51%),
    radial-gradient(.3vw .3vw at 40% 15%, #fff 50%, transparent 51%),
    radial-gradient(.2vw .2vw at 62% 80%, #fff 50%, transparent 51%),
    radial-gradient(.25vw .25vw at 78% 25%, #fff 50%, transparent 51%),
    radial-gradient(.2vw .2vw at 88% 60%, #fff 50%, transparent 51%),
    radial-gradient(.3vw .3vw at 55% 45%, #fff 50%, transparent 51%),
    radial-gradient(.2vw .2vw at 15% 88%, #fff 50%, transparent 51%);
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: .5; } }
#pair { background: linear-gradient(180deg, var(--sky1), var(--sky2)); font-size: 1.8vw; }
