/* Maximally-compatible plain CSS — no Grid, no custom properties reliance,
   no modern selectors (:is/:has/:focus-visible) that old TV WebKit may not
   parse. Flexbox only (broadly supported since ~2013-era engines). */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  background: #0d0b16;
  color: #f2f0fa;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

/* TV safe-area padding — old sets overscan, avoid content touching edges */
body {
  padding: 4vh 4vw;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 8vh;
}

.brand-mark {
  font-size: 2.2vh;
  font-weight: bold;
  letter-spacing: 0.2em;
  color: #8b7bff;
}

.status {
  font-size: 1.6vh;
  color: #9a94b8;
}

.view {
  height: 84vh;
}

.hidden {
  display: none;
}

.title {
  font-size: 3vh;
  margin-bottom: 3vh;
  color: #f2f0fa;
}

.grid {
  display: flex;
  flex-wrap: wrap;
}

.tile {
  width: 18vw;
  height: 18vw;
  max-width: 220px;
  max-height: 220px;
  margin: 0 2vh 2vh 0;
  background: #1c1830;
  border: 0.4vh solid #2c2650;
  border-radius: 1.2vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5vh;
  outline: none;
}

.tile img {
  max-width: 70%;
  max-height: 50%;
  margin-bottom: 1.2vh;
}

.tile .name {
  font-size: 1.6vh;
  color: #e6e2f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.tile.focused {
  border-color: #8b7bff;
  background: #2a2350;
  box-shadow: 0 0 0 0.5vh #8b7bff;
}

.empty {
  color: #9a94b8;
  font-size: 2vh;
}

.player-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

.video {
  width: 100%;
  height: 100%;
  background: #000;
}

.player-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2vh 3vw;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: space-between;
}

.player-label {
  font-size: 2vh;
  color: #f2f0fa;
}

.player-hint {
  font-size: 1.5vh;
  color: #9a94b8;
}
