:root {
  --bg: #0b1220; --panel: #141d2f; --panel2: #1c2740; --text: #e6ecf7;
  --muted: #8b97ad; --accent: #4cc2ff; --accent2: #7b6cff; --good: #3ddc84;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
header { display: flex; align-items: center; gap: 24px; padding: 12px 20px; background: var(--panel); position: sticky; top: 0; z-index: 5; }
header h1 { font-size: 18px; margin: 0; cursor: pointer; user-select: none; }
header h1:hover { color: var(--accent); }
nav button, .pill { background: none; border: 1px solid var(--muted); color: var(--text); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
nav button.active, .pill.active { background: var(--accent); border-color: var(--accent); color: #04121f; font-weight: 600; }
#account { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; }
#account img { width: 28px; height: 28px; border-radius: 50%; }
main { padding: 20px; max-width: 1200px; margin: 0 auto; }
button { font: inherit; }
.btn { background: var(--panel2); color: var(--text); border: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.btn:hover { background: var(--accent); color: #04121f; }
.btn.primary { background: var(--accent); color: #04121f; font-weight: 600; }

h2.status-h { margin: 24px 0 10px; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.card { background: var(--panel); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.card .body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .title { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { font-size: 12px; color: var(--muted); }
.card .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; align-items: center; }
.status-select { flex: 1 1 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--panel2); border-radius: 8px; padding: 5px 6px; font-size: 12px; }
.prog-input { width: 52px; background: var(--panel2); color: var(--text); border: 1px solid var(--panel2); border-radius: 8px; padding: 5px 6px; font-size: 12px; }
.progressbar { height: 4px; background: var(--panel2); border-radius: 2px; overflow: hidden; }
.progressbar > div { height: 100%; background: var(--good); }
.discover-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.row-section { margin-bottom: 22px; }
.strip { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
.strip .card { flex: 0 0 150px; width: 150px; }
.strip::-webkit-scrollbar { height: 8px; }
.strip::-webkit-scrollbar-thumb { background: var(--panel2); border-radius: 4px; }
#search-input { flex: 1; max-width: 380px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--panel2); background: var(--panel); color: var(--text); }

#player video { width: 100%; max-height: 65vh; background: #000; border-radius: 10px; }
#embed-frame { width: 100%; aspect-ratio: 16 / 9; max-height: 65vh; border: 0; background: #000; border-radius: 10px; }
#mark-watched { margin-top: 10px; }
.player-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.player-head h2 { font-size: 16px; margin: 0; flex: 1; }
.player-head select { background: var(--panel); color: var(--text); border: 1px solid var(--panel2); border-radius: 8px; padding: 6px; }
#player-close { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--panel2); border-radius: 8px; overflow: hidden; }
.seg button { background: var(--panel); color: var(--muted); border: none; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.seg button.active { background: var(--accent); color: #04121f; font-weight: 600; }
.ep-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ep-list button { background: var(--panel); border: 1px solid var(--panel2); color: var(--text); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.ep-list button.watched { border-color: var(--good); color: var(--good); }
.ep-list button.playing { background: var(--accent2); color: #fff; border-color: var(--accent2); }

#toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--panel2); color: var(--text); padding: 10px 22px; border-radius: 10px; font-size: 14px; z-index: 999; box-shadow: 0 4px 20px rgba(0,0,0,.4); pointer-events: none; }

#setup { background: var(--panel); border-radius: 12px; padding: 24px; max-width: 600px; margin: 40px auto; }
#setup h2 { margin-top: 0; }
#setup ol { padding-left: 20px; line-height: 2.2; }
#setup code { background: var(--panel2); padding: 2px 6px; border-radius: 4px; font-size: 13px; }