:root {
  color-scheme: dark;
  --tv-accent: #65a58a;
  --tv-focus: #b8f1da;
  --tv-page: #151f27;
  --tv-surface: #23313b;
  --tv-line: #52636d;
  --tv-text: #f2f7f5;
  --tv-muted: #becbd1;
  font: 18px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  padding: 32px 24px;
  color: var(--tv-text);
  background: #0d141a;
}

.tv-shell {
  max-width: 1520px;
  margin: 0 auto;
  padding: 30px;
  padding: clamp(20px, 4vw, 52px);
  background: var(--tv-page);
  border: 1px solid #33434e;
  border-radius: 8px;
}

.tv-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tv-brand { display: flex; align-items: center; min-width: 0; margin: 0; font-size: 17px; font-weight: 750; overflow-wrap: anywhere; }
.tv-brand img { flex: none; margin-right: 8px; }
.tv-brand span { margin-left: 10px; color: var(--tv-muted); font-size: 15px; font-weight: 500; }
.tv-home { padding: 8px; color: var(--tv-muted); font-size: 16px; }
h1 { margin: 16px 0 18px; font-size: 42px; font-size: clamp(30px, 4vw, 56px); line-height: 1.12; }
h2 { margin: 24px 0 9px; font-size: 22px; }

button {
  min-height: 56px;
  padding: 8px 16px;
  color: var(--tv-text);
  background: var(--tv-surface);
  border: 1px solid var(--tv-line);
  border-radius: 6px;
  font: inherit;
  font-weight: 660;
  cursor: pointer;
}

button:hover, button[aria-pressed="true"] { background: #304b42; border-color: var(--tv-accent); }
button:focus, a:focus { outline: 3px solid var(--tv-focus); outline-offset: 3px; }

#tv-resume {
  min-height: 64px;
  padding: 9px 22px;
  color: #111c17;
  background: #b4ddca;
  border-color: var(--tv-accent);
  font-size: 23px;
}

.tv-play-icon {
  display: inline-block;
  margin-right: 8px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
}

.tv-grid { display: grid; grid-gap: 10px; }
.tv-grid button { min-width: 0; padding: 7px; font-size: 23px; }
.tv-seasons { grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); }
.tv-episodes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tv-hint { margin: 20px 0 0; color: var(--tv-muted); font-size: 16px; }
.tv-hint span { margin-right: 6px; color: var(--tv-focus); }

.tv-player-title { margin: 0; color: var(--tv-muted); }
.tv-player h2 { margin: 2px 0 14px; font-size: 32px; }
.tv-video {
  position: relative;
  display: grid;
  min-height: 200px;
  height: 53vh;
  max-height: 720px;
  place-items: center;
  overflow: hidden;
  background: #080b0e;
  border-radius: 6px;
}

.tv-media { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.tv-media video, .tv-media iframe { display: block; width: 100%; height: 100%; border: 0; }
.tv-status {
  z-index: 1;
  max-width: 90%;
  margin: 0;
  padding: 8px 14px;
  color: var(--tv-text);
  background: #080b0e;
  text-align: center;
  pointer-events: none;
}

.tv-actions { display: flex; flex-wrap: wrap; margin: 10px -5px -5px; }
.tv-actions button { margin: 5px; }

.tv-player.is-fullscreen {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 16px 24px;
  flex-direction: column;
  background: #080b0e;
}

.is-fullscreen .tv-video { flex: 1; min-height: 0; height: auto; max-height: none; }

@media (max-width: 700px) {
  body { padding: 12px 10px; }
  .tv-shell { padding: 16px; }
  .tv-episodes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tv-seasons { grid-template-columns: repeat(auto-fit, minmax(42px, 1fr)); }
  .tv-grid { grid-gap: 6px; }
  .tv-grid button { min-height: 48px; font-size: 19px; }
  .tv-brand span { display: none; }
  .tv-home { font-size: 14px; }
  #tv-resume { min-height: 54px; padding: 8px 14px; font-size: 19px; }
  .tv-player h2 { font-size: 24px; }
  .tv-player.is-fullscreen { padding: 12px; }
}
