:root {
  --jungle: #0f2a1d; --jungle2: #173d2a; --leaf: #2f6b46; --torch: #f08a24; --flame: #ffb347;
  --sand: #f3e3c3; --ink: #f7f1e3; --muted: #b9c7b4; --card: #1b4430; --line: #2c5a40;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; color: var(--ink); background: var(--jungle);
  background-image: radial-gradient(ellipse at top, #24563a 0%, transparent 60%), radial-gradient(ellipse at bottom right, #3a2410 0%, transparent 55%);
  background-attachment: fixed;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--flame); }
h1, h2, h3, .brand { font-family: Georgia, "Palatino Linotype", serif; letter-spacing: .02em; }
.muted { color: var(--muted); }
button { font: inherit; color: inherit; cursor: pointer; }

/* header */
.top { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 10px 16px; background: rgba(10, 30, 20, .92); backdrop-filter: blur(8px); border-bottom: 2px solid var(--torch); }
.brand { font-size: 1.25rem; font-weight: bold; color: var(--sand); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; order: 3; width: 100%; }
.tabs button { background: none; border: 0; padding: 6px 12px; border-radius: 999px; color: var(--muted); }
.tabs button.on { background: var(--torch); color: #1d1004; font-weight: 600; }
.out { margin-left: auto; font-size: .9rem; color: var(--muted); }
@media (min-width: 820px) { .tabs { order: 0; width: auto; } }

.hero { max-width: 1100px; margin: 0 auto; padding: 18px 16px 4px; }
.hello { margin: 0; font-size: 1.1rem; color: var(--sand); }
.next { margin: 6px 0 0; color: var(--flame); }
main { max-width: 1100px; margin: 0 auto; padding: 8px 16px 48px; }
.tab { display: none; } .tab.on { display: block; }

/* player */
.player { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9;
  box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 0 0 2px var(--line); scroll-margin-top: 110px; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: rgba(0,0,0,.6); text-align: center; padding: 16px; pointer-events: none; }
.overlay[hidden] { display: none; }
.overlay p { margin: 0; max-width: 34ch; color: var(--sand); }
.spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,179,71,.25); border-top-color: var(--torch); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.now { margin: 14px 0 6px; }
.now h2 { margin: 2px 0 6px; font-size: 1.4rem; }
.now p { margin: 0; color: var(--muted); }
.cont button { margin: 8px 0; padding: 10px 16px; border: 0; border-radius: 10px; background: var(--torch); color: #1d1004; font-weight: 600; }

/* guide */
.guide-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 28px;
  border-top: 1px dashed var(--line); padding-top: 18px; scroll-margin-top: 110px; }
.guide-head h2 { margin: 0; }
.season-pick select { margin-left: 6px; padding: 8px 10px; border-radius: 8px; background: var(--card); color: var(--ink); border: 1px solid var(--line); font: inherit; max-width: 70vw; }
.season-blurb { margin: 8px 0 12px; color: var(--muted); }
.season-blurb strong { color: var(--sand); }
.eps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ep-main { display: flex; gap: 14px; width: 100%; text-align: left; padding: 10px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.ep-main:hover { border-color: var(--torch); transform: translateY(-1px); }
.ep.playing .ep-main { border-color: var(--torch); box-shadow: 0 0 0 2px var(--torch) inset; }
.thumb { position: relative; flex: 0 0 128px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--jungle2);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .play { position: absolute; inset: auto 6px 6px auto; width: 26px; height: 26px; border-radius: 50%; background: rgba(240,138,36,.92);
  color: #1d1004; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.thumb .bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--torch); }
.ep-text { min-width: 0; }
.ep-code { font-size: .8rem; color: var(--flame); }
.ep-title { font-weight: 600; font-size: 1.05rem; }
.ep-sum { margin: 4px 0 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ep.playing .ep-sum { -webkit-line-clamp: unset; }
.seen { color: #8fd19e; }
@media (min-width: 700px) { .thumb { flex-basis: 200px; } }

/* seasons grid */
.season-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.scard { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--card), var(--jungle2)); }
.scard:hover { border-color: var(--torch); }
.snum { font: bold 2rem Georgia, serif; color: var(--torch); line-height: 1; }
.sname { font-weight: 600; font-size: 1.05rem; color: var(--sand); }
.smeta, .seps { font-size: .85rem; color: var(--muted); }
.swin { font-size: .9rem; }

/* facts */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.fact { padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.fi { font-size: 2rem; }
.fact h3 { margin: 6px 0; color: var(--sand); }
.fact p { margin: 0; color: var(--muted); }

/* news + links */
.feed { margin-bottom: 22px; }
.feed h3 { color: var(--torch); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.feed ul, .links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.feed li, .links li { padding: 10px 12px; border-radius: 10px; background: var(--card); }
.feed li a, .links li a { display: block; font-weight: 600; text-decoration: none; color: var(--sand); }
.feed li a:hover, .links li a:hover { color: var(--flame); }
.feed li span, .links li span { font-size: .85rem; color: var(--muted); }
.credit { margin-top: 24px; font-size: .85rem; color: var(--muted); }

/* login */
body.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; padding: 28px 24px; border-radius: 18px; text-align: center;
  background: rgba(23, 61, 42, .9); border: 2px solid var(--torch); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.torch { font-size: 3rem; animation: flicker 2.4s ease-in-out infinite; }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08) rotate(2deg); } }
.login-card h1 { margin: 6px 0 4px; color: var(--sand); }
.tag { margin: 0 0 18px; color: var(--muted); font-size: .9rem; }
.login-card form { display: grid; gap: 12px; text-align: left; }
.login-card label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
.login-card input { padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--jungle); color: var(--ink); font: inherit; }
.login-card button { margin-top: 6px; padding: 12px; border: 0; border-radius: 10px; background: var(--torch); color: #1d1004; font-weight: 700; font-size: 1.05rem; }
.err { margin: 0; color: #ffb4a2; }
.err[hidden] { display: none; }
.overlay.tap{pointer-events:auto;cursor:pointer}
.overlay.tap .spin{display:none}
.overlay.tap p{font-size:1.25rem;font-weight:700;padding:.6em 1em;border-radius:999px;background:rgba(255,140,0,.9)}
