@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&family=Unbounded:wght@500;700&display=swap");

:root {
  color-scheme: light;
  --bg-1: #041826;
  --bg-2: #0b2f46;
  --bg-3: #124f64;
  --panel: #f8fcff;
  --panel-strong: #ffffff;
  --panel-soft: #ebf4fb;
  --text: #102538;
  --muted: #5e7185;
  --line: #d3e2ed;
  --accent: #007f8c;
  --accent-2: #0f6280;
  --warning: #de8d1b;
  --danger: #b42318;
  --ok: #0f9b68;
  --shadow: 0 16px 44px rgba(6, 26, 41, 0.24);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-1: #02070f;
  --bg-2: #0a1626;
  --bg-3: #10253d;
  --panel: #101b2a;
  --panel-strong: #0d1724;
  --panel-soft: #1a2a3f;
  --text: #e6eef6;
  --muted: #97abc1;
  --line: #2d4259;
  --accent: #1ca6b5;
  --accent-2: #7cc8df;
  --warning: #d99832;
  --danger: #ef6464;
  --ok: #2fb37e;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 520px at 7% -10%, #1a6ea0 0%, transparent 52%),
    radial-gradient(840px 380px at 94% -8%, #1f977f 0%, transparent 44%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2) 56%, var(--bg-3) 100%);
  transition: background 0.25s ease, color 0.2s ease;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #2e9ccc;
  outline-offset: 2px;
}

.container {
  width: min(1200px, 94vw);
  margin: 0 auto;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(6, 22, 35, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(14px);
}

.topbar .row {
  min-height: 70px;
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 3px;
}

.topbar strong {
  font-family: "Unbounded", sans-serif;
  color: #f3fbff;
  letter-spacing: 0.02em;
  font-size: 1.02rem;
}

.topbar nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar nav a,
.topbar nav .inline-form button,
.theme-toggle {
  border-radius: 999px;
  border: 1px solid rgba(214, 230, 240, 0.34);
  background: rgba(255, 255, 255, 0.07);
  color: #eef8ff;
  padding: 8px 13px;
  font-size: 0.9rem;
  font-weight: 800;
  transition: transform 0.18s ease, background 0.18s ease;
}

.topbar nav a:hover,
.topbar nav .inline-form button:hover,
.theme-toggle:hover {
  text-decoration: none;
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
}

.theme-toggle {
  cursor: pointer;
}

.theme-fab {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 80;
  color: #eaf7ff;
}

main.container,
main.container.grid {
  padding: 22px 0 32px;
}

.home-grid,
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.full {
  grid-column: 1 / -1;
}

.panel {
  background: linear-gradient(165deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  transition: background 0.22s ease, border-color 0.22s ease;
}

.panel h1,
.panel h2,
.panel h3 {
  margin: 0 0 10px;
  font-family: "Unbounded", sans-serif;
  letter-spacing: 0.01em;
}

.panel h1 {
  font-size: 1.35rem;
}

.panel h2 {
  font-size: 1.04rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.lead {
  margin: 2px 0 12px;
  color: #325066;
  font-weight: 600;
}

.stream-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 250, 255, 0.97)),
    radial-gradient(circle at 20% 16%, rgba(5, 143, 145, 0.12), transparent 60%);
}

.stream-frame {
  border-radius: 15px;
  padding: 8px;
  background: linear-gradient(145deg, #15364a, #081a28);
}

.quick-actions {
  display: flex;
  gap: 8px;
  margin: 9px 0 12px;
  flex-wrap: wrap;
}

.quick-btn {
  border-radius: 999px;
  border: 1px solid #b3ccdc;
  background: linear-gradient(136deg, #eaf6fa, #dceef7);
  color: #0e4f65;
  font-weight: 800;
  padding: 8px 14px;
}

.quick-btn:hover {
  text-decoration: none;
  border-color: #9dbecf;
}

.hotkeys-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.hotkey-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #edf5fb;
  border: 1px solid #c6d8e6;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: #24475d;
  font-weight: 700;
}

kbd {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.74rem;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid #b8cada;
  background: #fff;
  color: #173d54;
}

.hotkey-tip {
  margin-top: 8px;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #335368;
  font-weight: 700;
  font-size: 0.9rem;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-live {
  background: var(--ok);
}

.dot-wait {
  background: var(--warning);
}

.dot-off {
  background: #c73737;
}

.status-pill {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-weight: 800;
}

.status-live {
  color: #fff;
  background: linear-gradient(130deg, var(--ok), #0e855c);
}

.status-wait {
  color: #fff;
  background: linear-gradient(130deg, var(--warning), #c87408);
}

.status-offline {
  color: #fff;
  background: linear-gradient(130deg, #c63a3a, #921a1a);
}

video {
  width: 100%;
  min-height: 340px;
  border-radius: 10px;
  border: 1px solid #133145;
  background: #000;
}

.schedule-preview,
.schedule-page,
.series-page {
  background:
    linear-gradient(170deg, #ffffff, #f4f9ff),
    radial-gradient(circle at 8% 10%, rgba(15, 98, 128, 0.08), transparent 52%);
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.series-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.series-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14, 43, 60, 0.12);
}

.series-poster-link {
  display: block;
}

.series-poster {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #c1d8e6;
  background: #eef4fa;
}

.series-body h2,
.series-body h3 {
  margin: 0 0 6px;
}

.series-body p {
  margin: 6px 0;
}

.watch-layout {
  display: grid;
  gap: 14px;
}

.watch-header {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 14px;
  align-items: start;
}

.watch-poster {
  width: 180px;
  border-radius: 12px;
  border: 1px solid #c1d8e6;
}

.episode-list {
  display: grid;
  gap: 10px;
}

.episode-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.episode-item.active {
  border-color: #7cb2cc;
  box-shadow: 0 0 0 2px rgba(124, 178, 204, 0.18);
}

.episode-item:hover {
  border-color: #a9c7d9;
}

.episode-item h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.panel-sub {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel-strong);
}

.two-tight {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.series-admin-list {
  display: grid;
  gap: 12px;
}

.series-admin-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.series-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.series-admin-head h3 {
  margin: 0;
}

.episode-admin-list {
  display: grid;
  gap: 8px;
}

.episode-admin-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #fdfefe;
}

.schedule-days {
  display: grid;
  gap: 14px;
}

.schedule-day {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  background: var(--panel-strong);
}

.schedule-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.day-count {
  font-size: 0.84rem;
  font-weight: 800;
  color: #3f5f74;
  background: var(--panel-soft);
  border: 1px solid #c9dce8;
  border-radius: 999px;
  padding: 4px 9px;
}

.schedule-list {
  display: grid;
  gap: 10px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 12px;
  padding: 10px;
}

.schedule-time {
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  background: linear-gradient(135deg, #e0f2f8, #d9ecf7);
  color: #0d5268;
  font-weight: 800;
  font-size: 0.9rem;
}

.schedule-item h3 {
  margin: 0 0 5px;
  font-size: 0.97rem;
}

.schedule-item p {
  margin: 4px 0 0;
}

.news-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  background: #fff;
}

.news-item p {
  margin: 8px 0;
  line-height: 1.45;
}

.news-item small {
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

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

.stack {
  display: grid;
  gap: 11px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input,
textarea,
select,
button {
  font: inherit;
  border-radius: 11px;
}

input,
textarea,
select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
}

button {
  padding: 10px 14px;
  border: 1px solid transparent;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #0d6f8b);
  cursor: pointer;
}

button:hover {
  filter: brightness(1.06);
}

button.theme-toggle {
  padding: 8px 13px;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid rgba(214, 230, 240, 0.34);
  background: rgba(255, 255, 255, 0.07);
  color: #eef8ff;
  font-size: 0.9rem;
  font-weight: 800;
  filter: none;
}

button.theme-toggle:hover {
  filter: none;
}

.inline-form {
  display: inline;
}

.inline-form button {
  padding: 8px 14px;
  line-height: 1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 9px;
}

th {
  color: #19384b;
  font-weight: 800;
}

.center-box {
  width: min(490px, 92vw);
  margin: 9vh auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(170deg, #ffffff, #f0f8ff);
  padding: 22px;
  box-shadow: var(--shadow);
}

.center-logo-wrap {
  text-align: center;
  margin: 0 0 8px;
}

.center-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

[data-theme="dark"] a {
  color: #8ad2eb;
}

[data-theme="dark"] .topbar {
  background: rgba(7, 14, 23, 0.88);
  border-bottom-color: rgba(139, 167, 191, 0.25);
}

[data-theme="dark"] .topbar strong {
  color: #f2f7fb;
}

[data-theme="dark"] .topbar nav a,
[data-theme="dark"] .topbar nav .inline-form button,
[data-theme="dark"] .theme-toggle {
  color: #d7e8f6;
  border-color: #3a5168;
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .stream-panel,
[data-theme="dark"] .schedule-preview,
[data-theme="dark"] .schedule-page,
[data-theme="dark"] .series-page,
[data-theme="dark"] .center-box {
  background: linear-gradient(165deg, #0f1d2d, #0d1928);
}

[data-theme="dark"] .stream-frame {
  background: linear-gradient(145deg, #0b121b, #04080d);
  border: 1px solid #1f3042;
}

[data-theme="dark"] .news-item,
[data-theme="dark"] .series-card,
[data-theme="dark"] .series-admin-item,
[data-theme="dark"] .episode-admin-item,
[data-theme="dark"] .episode-item,
[data-theme="dark"] .schedule-item,
[data-theme="dark"] .schedule-day,
[data-theme="dark"] .panel-sub {
  background: #111d2d;
  border-color: #2c4258;
}

[data-theme="dark"] .day-count,
[data-theme="dark"] .hotkey-chip {
  background: #152638;
  border-color: #334e68;
  color: #c2d8ea;
}

[data-theme="dark"] kbd {
  background: #0c1725;
  border-color: #334a60;
  color: #d7e6f2;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #0c1725;
  border-color: #2f455d;
  color: #e5edf4;
}

[data-theme="dark"] th {
  color: #d1e2ef;
}

[data-theme="dark"] .quick-btn {
  background: linear-gradient(136deg, #133043, #17425b);
  border-color: #2d4f68;
  color: #dbedf8;
}

[data-theme="dark"] .theme-fab {
  border-color: #3a5268;
  background: rgba(8, 16, 26, 0.92);
}

@media (max-width: 980px) {
  .home-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .topbar nav {
    justify-content: flex-start;
  }

  .schedule-item {
    grid-template-columns: 1fr;
  }

  .series-grid {
    grid-template-columns: 1fr;
  }

  .series-card {
    grid-template-columns: 100px 1fr;
  }

  .watch-header {
    grid-template-columns: 1fr;
  }

  .watch-poster {
    width: 130px;
  }

  .two-tight {
    grid-template-columns: 1fr;
  }

  .episode-item,
  .episode-admin-item,
  .series-admin-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .schedule-time {
    width: fit-content;
    min-width: 108px;
  }

  video {
    min-height: 230px;
  }
}

@media (max-width: 640px) {
  .topbar .row {
    align-items: flex-start;
    padding: 10px 0;
  }

  .topbar strong {
    font-size: 0.92rem;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
  }

  .panel {
    padding: 14px;
  }

  .panel h1 {
    font-size: 1.2rem;
  }

  .legend-row {
    gap: 8px;
  }

  .legend-item {
    font-size: 0.82rem;
  }
}
