* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #0c0d12;
  background: -webkit-linear-gradient(top, #090a0e 0%, #0e1017 100%);
  background: linear-gradient(180deg, #090a0e 0%, #0e1017 100%);
  color: #fff;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  border: 0;
}

.topbar {
  height: 64px;
  padding: 0 24px;
  background: #0f1016;
  background: rgba(15, 16, 22, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-sizing: border-box;
  position: relative;
  z-index: 100;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
}

.brand {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  height: 100%;
}

.brand-logo {
  display: inline-block;
  vertical-align: middle;
  max-width: 140px;
  width: auto;
  height: auto;
  -webkit-filter: drop-shadow(0 4px 12px rgba(0,0,0,.28));
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.28));
}

.focusable {
  outline: none;
  -webkit-transition: -webkit-transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.focusable:focus,
.focusable.is-focused {
  outline: none !important;
  border-color: #f43f5e !important;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.45) !important;
  -webkit-transform: scale(1.03);
      -ms-transform: scale(1.03);
          transform: scale(1.03);
}

.hidden {
  display: none !important;
}

.card {
  background: #171922;
  background: linear-gradient(180deg, #1d1e25, #171922);
  border: 1px solid #292a33;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0,0,0,0.18);
  box-sizing: border-box;
}

.card img {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

/* safe 16:9 helper for poster/video thumbnails if needed by wrappers */
.card-thumb-16x9 {
  position: relative;
  overflow: hidden;
  background: #000;
}

.card-thumb-16x9:before {
  content: "";
  display: block;
  width: 100%;
  padding-top: 56.25%;
}

.card-thumb-16x9 img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
}

.card-body {
  padding: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}

.card-meta {
  color: #bfc3cf;
  font-size: 14px;
}

/* optional old keyboard styles, harmless if keyboard is no longer used */
.keyboard {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  background: #141418;
  background: rgba(20, 20, 24, 0.98);
  border: 1px solid #373746;
  border-radius: 22px;
  padding: 16px;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  box-sizing: border-box;
}

.keyboard-row {
  text-align: center;
  margin-bottom: 10px;
}

.keyboard-row:last-child {
  margin-bottom: 0;
}

.keyboard-key {
  display: inline-block;
  min-width: 52px;
  height: 52px;
  line-height: 52px;
  margin: 0 5px 8px;
  border: none;
  border-radius: 14px;
  background: #232731;
  background: linear-gradient(180deg, #2f3440, #232731);
  color: #fff;
  text-align: center;
  vertical-align: middle;
}

input,
select,
button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

select {
  background-image: none;
}

/* generic form look */
input,
select {
  border: 1px solid rgba(255,255,255,0.12);
  background: #252833;
  color: #fff;
}

/* small screens */
@media (max-width: 900px) {
  .topbar {
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .brand {
    float: none;
    height: auto;
    line-height: normal;
    margin-bottom: 10px;
  }
}

/* ==========================================================================
   UI Scale System: Small, Medium (Default), Large
   ========================================================================== */

/* --- MEDIUM (DEFAULT - Optimized for TV viewing from 2.5 - 3 meters) --- */
[data-ui-scale="medium"] .poster-card,
html:not([data-ui-scale]) .poster-card {
  min-width: 280px !important;
  max-width: 280px !important;
  border-radius: 16px;
}

[data-ui-scale="medium"] .poster-card .card-title,
[data-ui-scale="medium"] .video-card .card-title,
html:not([data-ui-scale]) .poster-card .card-title,
html:not([data-ui-scale]) .video-card .card-title {
  font-size: 15.5px !important;
  line-height: 1.3 !important;
  max-height: 42px !important;
  font-weight: 700 !important;
}

[data-ui-scale="medium"] .poster-card .card-meta,
[data-ui-scale="medium"] .video-card .card-meta,
html:not([data-ui-scale]) .poster-card .card-meta,
html:not([data-ui-scale]) .video-card .card-meta {
  font-size: 13px !important;
  margin-top: 6px !important;
}

[data-ui-scale="medium"] .card-duration,
html:not([data-ui-scale]) .card-duration {
  font-size: 12.5px !important;
  padding: 3px 6px !important;
  border-radius: 5px !important;
}

[data-ui-scale="medium"] .section-title,
html:not([data-ui-scale]) .section-title {
  font-size: 24px !important;
}

[data-ui-scale="medium"] .video-grid .video-card,
html:not([data-ui-scale]) .video-grid .video-card {
  width: calc(20% - 16px) !important;
  border-radius: 16px !important;
}

[data-ui-scale="medium"] .profile-page .video-card,
html:not([data-ui-scale]) .profile-page .video-card {
  width: calc(20% - 14px) !important;
  border-radius: 16px !important;
}

[data-ui-scale="medium"] .layout,
html:not([data-ui-scale]) .layout {
  grid-template-columns: 240px 1fr !important;
}

[data-ui-scale="medium"] .nav-item,
html:not([data-ui-scale]) .nav-item {
  height: 56px !important;
  border-radius: 15px !important;
}

[data-ui-scale="medium"] .nav-label,
html:not([data-ui-scale]) .nav-label {
  font-size: 16.5px !important;
}

[data-ui-scale="medium"] .nav-icon,
[data-ui-scale="medium"] .nav-icon svg,
html:not([data-ui-scale]) .nav-icon,
html:not([data-ui-scale]) .nav-icon svg {
  width: 24px !important;
  height: 24px !important;
  flex: 0 0 24px !important;
}

[data-ui-scale="medium"] #search-input,
html:not([data-ui-scale]) #search-input {
  height: 44px !important;
  font-size: 15.5px !important;
}

[data-ui-scale="medium"] #search-btn,
html:not([data-ui-scale]) #search-btn {
  height: 44px !important;
  font-size: 15.5px !important;
  padding: 0 22px !important;
}

/* --- LARGE (For viewers seated far away: 3.5 - 4+ meters) --- */
[data-ui-scale="large"] .poster-card {
  min-width: 340px !important;
  max-width: 340px !important;
  border-radius: 18px;
}

[data-ui-scale="large"] .poster-card .card-title,
[data-ui-scale="large"] .video-card .card-title {
  font-size: 18px !important;
  line-height: 1.32 !important;
  max-height: 48px !important;
  font-weight: 700 !important;
}

[data-ui-scale="large"] .poster-card .card-meta,
[data-ui-scale="large"] .video-card .card-meta {
  font-size: 15px !important;
  margin-top: 7px !important;
}

[data-ui-scale="large"] .card-duration {
  font-size: 14px !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
}

[data-ui-scale="large"] .section-title {
  font-size: 27px !important;
}

[data-ui-scale="large"] .video-grid .video-card {
  width: calc(25% - 16px) !important;
  border-radius: 18px !important;
}

[data-ui-scale="large"] .profile-page .video-card {
  width: calc(25% - 14px) !important;
  border-radius: 18px !important;
}

[data-ui-scale="large"] .layout {
  grid-template-columns: 260px 1fr !important;
}

[data-ui-scale="large"] .nav-item {
  height: 62px !important;
  border-radius: 16px !important;
}

[data-ui-scale="large"] .nav-label {
  font-size: 18px !important;
}

[data-ui-scale="large"] .nav-icon,
[data-ui-scale="large"] .nav-icon svg {
  width: 26px !important;
  height: 26px !important;
  flex: 0 0 26px !important;
}

[data-ui-scale="large"] #search-input {
  height: 48px !important;
  font-size: 17px !important;
}

[data-ui-scale="large"] #search-btn {
  height: 48px !important;
  font-size: 17px !important;
  padding: 0 26px !important;
}

/* --- SMALL (Compact view - match legacy sizes) --- */
[data-ui-scale="small"] .poster-card {
  min-width: 224px !important;
  max-width: 224px !important;
}

[data-ui-scale="small"] .poster-card .card-title,
[data-ui-scale="small"] .video-card .card-title {
  font-size: 13px !important;
  line-height: 1.25 !important;
  max-height: 33px !important;
}

[data-ui-scale="small"] .poster-card .card-meta,
[data-ui-scale="small"] .video-card .card-meta {
  font-size: 11px !important;
}

[data-ui-scale="small"] .card-duration {
  font-size: 11px !important;
  padding: 2px 5px !important;
}

[data-ui-scale="small"] .section-title {
  font-size: 21px !important;
}

[data-ui-scale="small"] .video-grid .video-card {
  width: calc(16.666% - 16px) !important;
}

[data-ui-scale="small"] .profile-page .video-card {
  width: calc(16.666% - 14px) !important;
}

[data-ui-scale="small"] .layout {
  grid-template-columns: 220px 1fr !important;
}

[data-ui-scale="small"] .nav-item {
  height: 52px !important;
}

[data-ui-scale="small"] .nav-label {
  font-size: 15px !important;
}

[data-ui-scale="small"] .nav-icon,
[data-ui-scale="small"] .nav-icon svg {
  width: 22px !important;
  height: 22px !important;
}

[data-ui-scale="small"] #search-input {
  height: 40px !important;
  font-size: 14px !important;
}

[data-ui-scale="small"] #search-btn {
  height: 40px !important;
  font-size: 14px !important;
  padding: 0 16px !important;
}