:root {
  --bg: #12192b;
  --bg-2: #1d2a4a;
  --paper: #24365c;
  --ink: #f6f1e6;
  --muted: #9aa8c7;
  --gold: #f4c14a;
  --sky: #7ecbff;
  --line: rgba(255, 255, 255, 0.1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; color: var(--ink); background: var(--bg); }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  overscroll-behavior: none;
}
button {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
}
a { color: inherit; text-decoration: none; }

#app { min-height: 100dvh; }

.home {
  padding: calc(20px + var(--safe-top)) 18px calc(28px + var(--safe-bottom));
  max-width: 720px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.brand img { width: 44px; height: 44px; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: 0.04em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.season { margin-bottom: 22px; }
.season-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.season-head h2 { margin: 0; font-size: 16px; }
.season-head span { color: var(--muted); font-size: 12px; }

.ep-list { display: grid; gap: 10px; }
.ep-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  text-align: left;
  width: 100%;
}
.ep-card.ready { box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18); }
.ep-card:disabled { opacity: 0.55; cursor: default; }
.ep-no {
  min-width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #1d2a4a;
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
}
.ep-card strong { display: block; font-size: 16px; }
.ep-card em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}

.player {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #000;
}
.stage {
  position: relative;
  background: #000;
  flex: 1 1 auto;
  min-height: 42vh;
}
.stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  vertical-align: middle;
  background: #000;
}
.back {
  position: absolute;
  top: calc(10px + var(--safe-top));
  left: 10px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 20px;
}
.rotate-btn {
  position: absolute;
  top: calc(10px + var(--safe-top));
  right: 10px;
  z-index: 5;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 13px;
}

.dock {
  flex: 0 0 auto;
  padding: 12px 14px calc(16px + var(--safe-bottom));
  background: linear-gradient(180deg, #18233d 0%, #12192b 100%);
}
.sub {
  min-height: 58px;
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.45;
  text-align: center;
}
.sub .en {
  color: var(--gold);
  font-weight: 800;
  padding: 0 2px;
  cursor: pointer;
  border-bottom: 2px solid rgba(244, 193, 74, 0.45);
}
.sub .who { display: block; color: var(--sky); font-size: 12px; margin-bottom: 4px; }

.levels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.lv {
  padding: 8px 0 7px;
  border-radius: 12px;
  background: #24365c;
  border: 1px solid transparent;
}
.lv.on {
  background: #3a2d12;
  border-color: var(--gold);
  color: var(--gold);
}
.lv b { display: block; font-size: 14px; }
.lv small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.lv.on small { color: #e6d39a; }

.transport {
  display: flex;
  align-items: center;
  gap: 10px;
}
.play {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--gold);
  color: #1d2a4a;
  font-size: 22px;
  font-weight: 800;
}
.bar {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
}
.time { min-width: 78px; color: var(--muted); font-size: 12px; text-align: right; }

.empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
}

@media (orientation: landscape) {
  .player { height: 100dvh; }
  .stage { min-height: 0; }
  .dock {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82) 28%);
    padding-top: 28px;
  }
  .sub { font-size: 18px; min-height: 46px; }
  .lv small { display: none; }
}

body.fs-lock .dock { opacity: 1; }
