:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #191d21;
  --panel-2: #22272d;
  --text: #f3f5f7;
  --muted: #a8b0b8;
  --line: #353c44;
  --focus: #2fd17c;
  --accent: #f2b84b;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(47, 209, 124, 0.12), transparent 34%),
    linear-gradient(250deg, rgba(242, 184, 75, 0.10), transparent 38%),
    var(--bg);
}

.topbar {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--focus);
  color: #06120b;
  font-weight: 900;
  font-size: 28px;
}

.brand strong,
.brand span:last-child {
  display: block;
}

.brand strong {
  font-size: 25px;
}

.brand span:last-child {
  color: var(--muted);
  font-size: 15px;
  margin-top: 3px;
}

.remote-hints {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 15px;
}

.remote-hints span {
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 6px;
}

main {
  height: calc(100vh - 86px);
}

.screen {
  display: none;
  height: 100%;
}

.screen.active {
  display: flex;
}

.auth-panel {
  width: 620px;
  margin: auto;
  padding: 38px;
  background: rgba(25, 29, 33, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
  font-size: 13px;
  margin: 0 0 10px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 38px;
  line-height: 1.15;
}

h2 {
  font-size: 34px;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

label {
  display: block;
  margin-top: 22px;
  color: var(--muted);
  font-size: 16px;
}

input {
  width: 100%;
  height: 58px;
  margin-top: 8px;
  padding: 0 16px;
  color: var(--text);
  background: #0d0f11;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

button {
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 22px;
  color: var(--text);
  background: var(--panel-2);
  cursor: pointer;
  outline: none;
}

.primary {
  background: var(--focus);
  color: #06120b;
  font-weight: 800;
}

.secondary {
  border-color: var(--line);
}

.button-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.button-row button,
#resolveProvider {
  margin-top: 24px;
}

.focusable.focused,
.focusable:focus {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
  border-color: var(--focus);
}

.error {
  min-height: 24px;
  color: var(--danger);
  font-weight: 700;
}

.sidebar {
  width: 248px;
  padding: 30px 22px;
  background: rgba(16, 18, 20, 0.74);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-item {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  text-align: left;
  font-weight: 700;
}

.nav-item.active {
  background: var(--accent);
  color: #171205;
}

.content {
  flex: 1;
  padding: 30px 38px 42px;
  overflow: hidden;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.search-input {
  width: 360px;
}

.category-rail {
  display: flex;
  gap: 12px;
  height: 62px;
  margin: 26px 0 20px;
  overflow: hidden;
}

.category-pill {
  min-width: 136px;
  height: 46px;
  color: var(--muted);
}

.category-pill.active {
  background: #fff;
  color: #111;
  font-weight: 800;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  height: calc(100vh - 258px);
  overflow: hidden;
}

.media-card {
  position: relative;
  height: 188px;
  padding: 16px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.media-card strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
  margin-top: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card span {
  display: block;
  color: var(--muted);
  margin-top: 8px;
}

.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 9px;
  border-radius: 5px;
  color: #111;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.star {
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--accent);
  font-size: 24px;
}

.empty-state {
  grid-column: 1 / -1;
  align-self: start;
  padding: 28px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.player-screen {
  position: relative;
  background: #030303;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #030303;
}

.player-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 42px 48px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.86));
}

.player-actions {
  display: flex;
  gap: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  min-width: 280px;
  padding: 14px 18px;
  color: #07110c;
  background: var(--focus);
  border-radius: 6px;
  text-align: center;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 1100px) {
  .media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .remote-hints {
    display: none;
  }
}
