:root {
  color-scheme: dark;
  --bg: #0b0d0f;
  --panel: #15191d;
  --panel2: #1d2328;
  --line: #303941;
  --text: #f4f7f8;
  --muted: #9faab2;
  --accent: #2bb7a8;
  --warn: #d7b65d;
  --danger: #f06f6f;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

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

button,
input,
select {
  font: inherit;
}

.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: 60px 1fr;
  min-height: 0;
}

.topbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #111518;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--accent);
  color: #061311;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

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

#account,
.notice {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.notice {
  max-width: 45vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
}

.stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #050607;
}

.videoFrame {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #000;
}

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

.playerMessage {
  position: absolute;
  inset: auto 16px 16px 16px;
  min-height: 38px;
  display: none;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(15, 18, 21, 0.88);
  color: var(--muted);
  font-size: 13px;
}

.playerMessage.show {
  display: flex;
}

.playerMessage.error {
  color: var(--danger);
}

.nowbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.nowbar h2 {
  max-width: 64vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  line-height: 1.25;
}

.nowbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.openLink {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  background: var(--panel2);
}

.catalog {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 46px auto minmax(0, 1fr) 46px;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.tab {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab:last-child {
  border-right: 0;
}

.tab.active {
  color: var(--text);
  background: var(--panel2);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.filters {
  display: grid;
  gap: 9px;
  padding: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.searchRow {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 9px;
}

select,
input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #101418;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

select:focus,
input:focus {
  border-color: var(--accent);
}

.iconButton,
.more,
.episode {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
}

.iconButton {
  min-height: 38px;
  font-size: 20px;
}

.list {
  min-height: 0;
  overflow: auto;
}

.item,
.episode {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.item {
  min-height: 68px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 11px;
  padding: 9px 10px;
}

.item:hover,
.item.active,
.episode:hover {
  background: var(--panel2);
}

.thumb {
  width: 52px;
  height: 52px;
  border-radius: 7px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #0c1013;
}

.itemText {
  min-width: 0;
  align-self: center;
}

.title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 14px;
  line-height: 1.25;
}

.meta {
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  color: var(--warn);
}

.empty,
.error {
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
}

.error {
  color: var(--danger);
}

.episode {
  min-height: 48px;
  padding: 10px 12px;
}

.catalogFoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.more {
  min-height: 32px;
  padding: 0 11px;
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  .app {
    grid-template-rows: 56px 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(210px, 42dvh) minmax(0, 1fr);
  }

  .stage {
    border-bottom: 1px solid var(--line);
  }

  .catalog {
    border-left: 0;
  }

  .nowbar {
    min-height: 58px;
    padding: 9px 12px;
  }

  .nowbar h2 {
    max-width: 58vw;
    font-size: 15px;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 8px 10px;
  }

  .notice {
    display: none;
  }

  .workspace {
    grid-template-rows: minmax(190px, 38dvh) minmax(0, 1fr);
  }

  .openLink {
    display: none;
  }
}
