* { box-sizing: border-box; }

:root {
 color-scheme: dark;
 --accent: #97dbb9;
 --text: #edf5f0;
 --muted: #9aafa3;
 --surface: rgba(24, 43, 33, 0.62);
 --border: rgba(160, 211, 183, 0.19);
 --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html, body {
 margin: 0;
 padding: 0;
 background: transparent;
 color: var(--text);
 font: 14px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
}

body { min-height: 100dvh; }
::selection { background: #97dbb940; }
svg { flex-shrink: 0; width: 20px; height: 20px; }
a { color: var(--accent); text-underline-offset: 4px; transition: color 180ms; }
a:hover { color: #d3ffe6; }

button, input, select {
 font: inherit;
 color: inherit;
 background: var(--surface);
 border: 1px solid var(--border);
 border-radius: 999px;
 padding: 9px 16px;
}

button, select {
 transition: transform 200ms var(--ease), background 200ms, border-color 200ms, box-shadow 200ms, color 200ms;
}
button { cursor: pointer; }
button:hover:not(:disabled) {
 background: rgba(88, 140, 108, 0.24);
 border-color: var(--accent);
 transform: translateY(-2px);
 box-shadow: 0 5px 20px #0000001a;
}
button:active:not(:disabled) { transform: translateY(0) scale(0.97); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
 outline: 2px solid var(--accent);
 outline-offset: 4px;
}
button:disabled, select:disabled { opacity: 0.45; cursor: default; }
select option { background: #17251d; color: var(--text); }

.hidden { display: none !important; }
.dim { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.bar {
 display: grid;
 grid-template-columns: 1fr;
 align-items: center;
 gap: 24px;
 padding: 54px 24px 38px;
 background: transparent;
 position: relative;
 z-index: 20;
}

.brand {
 justify-self: center;
 display: inline-flex;
 align-items: center;
 gap: 12px;
 border: 0;
 background: transparent;
 padding: 4px 10px;
 font-size: clamp(32px, 4vw, 46px);
 font-weight: 750;
 letter-spacing: -2px;
 color: var(--text);
}
.brand-icon { width: 44px; height: 34px; color: var(--accent); }
.brand-dot { color: var(--accent); }
.brand:hover:not(:disabled) { background: transparent; box-shadow: none; }

.search {
 width: min(100%, 620px);
 margin: 0 auto;
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 6px 7px 6px 19px;
 border: 1px solid rgba(151, 219, 185, 0.4);
 border-radius: 999px;
 background: rgba(35, 59, 44, 0.66);
 backdrop-filter: blur(18px);
 -webkit-backdrop-filter: blur(18px);
 box-shadow: 0 8px 32px #0000001a, inset 0 1px 0 #ffffff08;
 transition: border-color 220ms, box-shadow 220ms, background 220ms;
}
.search:hover { border-color: rgba(151, 219, 185, 0.7); }
.search:focus-within {
 border-color: var(--accent);
 background: rgba(40, 70, 51, 0.8);
 box-shadow: 0 0 0 4px #97dbb910, 0 12px 40px #00000026;
}
.search-icon { width: 18px; height: 18px; color: var(--accent); }
.search input {
 flex: 1;
 width: 0;
 min-width: 0;
 height: 38px;
 padding: 0;
 border: 0;
 border-radius: 0;
 background: transparent;
 font-size: 15px;
 outline: none;
}
.search input:focus-visible { outline: none; }
.search input::placeholder { color: #c1d1c6; opacity: 0.85; }
.search-submit {
 display: grid;
 place-items: center;
 flex: 0 0 40px;
 width: 40px;
 height: 40px;
 padding: 0;
 border: 0;
 background: var(--accent);
 color: #143123;
}
.search-submit:hover:not(:disabled) { background: #b6f0cf; box-shadow: 0 0 20px #97dbb92e; }
.search-submit svg { transition: transform 200ms var(--ease); }
.search-submit:hover svg { transform: translateX(2px); }

.nav { position: absolute; right: 24px; top: 20px; display: flex; align-items: center; gap: 8px; }
.nav button { font-size: 12px; backdrop-filter: blur(12px); }
.status-button::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.status-button[data-status="online"]::before { background: var(--accent); box-shadow: 0 0 8px #97dbb94d; }
.status-button[data-status="offline"]::before { background: #f3a295; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 20px 32px; }
footer.wrap { padding-top: 40px; padding-bottom: 30px; text-align: center; font-size: 11px; opacity: 0.7; }
.is-watching .bar { grid-template-columns: auto minmax(0, 620px) auto; gap: 24px; padding: 20px 32px; }
.is-watching .brand { font-size: 26px; letter-spacing: -1px; }
.is-watching .brand-icon { width: 32px; height: 26px; }
.is-watching .nav { position: static; justify-self: end; }

.banner {
 margin-bottom: 14px;
 padding: 14px 18px;
 border: 1px solid #e8a08d40;
 background: #54251d40;
 color: #ffc0ad;
 border-radius: 16px;
 animation: reveal 300ms var(--ease) backwards;
}

.heading { margin: 0 0 24px; font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.grid {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
 gap: 28px 20px;
}

.card {
 width: 100%;
 min-width: 0;
 border: 1px solid transparent;
 background: transparent;
 padding: 9px;
 border-radius: 22px;
 text-align: left;
 display: flex;
 flex-direction: column;
 align-items: stretch;
 gap: 8px;
 appearance: none;
 -webkit-appearance: none;
 animation: reveal 450ms var(--ease) backwards;
}
.card:nth-child(4n+2) { animation-delay: 50ms; }
.card:nth-child(4n+3) { animation-delay: 100ms; }
.card:nth-child(4n+4) { animation-delay: 150ms; }
.card:hover:not(:disabled) { background: rgba(35, 59, 44, 0.45); border-color: var(--border); transform: translateY(-5px); }
.card:hover .card-title { color: #fff; }

.thumb {
 position: relative;
 width: 100%;
 aspect-ratio: 16 / 9;
 background: #0a0a0a;
 border: 1px solid var(--border);
 border-radius: 16px;
 overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms var(--ease); }
.card:hover .thumb img, .rel-card:hover .thumb img { transform: scale(1.045); }
.dur {
 position: absolute;
 right: 6px;
 bottom: 6px;
 padding: 1px 5px;
 font-size: 11px;
 background: rgba(0, 0, 0, 0.85);
 color: #fff;
 border-radius: 6px;
}
.dur.live { background: #b91c1c; }

.card-title {
 width: 100%;
 min-width: 0;
 font-size: 14px;
 font-weight: 600;
 color: var(--text);
 display: -webkit-box;
 -webkit-line-clamp: 2;
 -webkit-box-orient: vertical;
 overflow: hidden;
}
.card-sub { width: 100%; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.more { margin: 18px 0; text-align: center; }

.watch {
 display: grid;
 grid-template-columns: minmax(0, 1fr) 320px;
 gap: 20px;
 align-items: start;
}
.main-col, .side-col { min-width: 0; }
.watch:not(.hidden) { animation: reveal 350ms var(--ease) backwards; }

.player-box {
 position: relative;
 width: 100%;
 aspect-ratio: 16 / 9;
 background: #000;
 border: 1px solid var(--border);
 border-radius: 22px;
 overflow: hidden;
}
.player-box video { width: 100%; height: 100%; display: block; background: #000; }
.overlay {
 position: absolute;
 inset: 0;
 display: grid;
 place-items: center;
 background: rgba(12, 27, 18, 0.8);
 color: var(--accent);
 align-content: center;
 gap: 16px;
}
.overlay::before { content: ""; width: 32px; height: 32px; border: 2px solid #97dbb933; border-top-color: var(--accent); border-radius: 50%; animation: spin 850ms linear infinite; }

.controls-row {
 display: flex;
 flex-wrap: wrap;
 justify-content: space-between;
 align-items: center;
 gap: 8px;
 padding: 16px 0;
 border-bottom: 1px solid var(--border);
}
.controls-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ctrl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #888; }
.ctrl select { padding: 4px 8px; }

.vtitle { margin: 20px 0 6px; font-size: clamp(18px, 2vw, 24px); font-weight: 650; color: var(--text); letter-spacing: -0.5px; }
.vmeta { font-size: 12.5px; margin-bottom: 12px; }

.desc-box { padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: rgba(24, 43, 33, 0.32); }
.desc { white-space: pre-wrap; font-size: 13px; color: #bbb; overflow-wrap: anywhere; }
.desc.collapsed { max-height: 76px; overflow: hidden; }

.text-btn {
 border: 0;
 background: transparent;
 padding: 2px 0;
 color: #999;
 font-size: 12.5px;
}
.text-btn:hover { background: transparent; color: #fff; }
.text-btn.active { color: #fff; text-decoration: underline; }

.ts-btn {
 border: 0;
 background: transparent;
 padding: 0;
 color: #93c5fd;
 font-size: inherit;
}
.ts-btn:hover { background: transparent; text-decoration: underline; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 18px; }
.tab {
 border: 0;
 border: 1px solid transparent;
 border-radius: 999px;
 background: transparent;
 padding: 9px 16px;
 color: var(--muted);
}
.tab:hover { background: transparent; color: #ddd; border-color: transparent; }
.tab.active { color: var(--accent); background: #97dbb915; border-color: #97dbb94d; }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.sort { display: flex; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

.line-btn {
 display: flex;
 gap: 10px;
 text-align: left;
 background: var(--surface);
 border: 1px solid var(--border);
 border-radius: 14px;
 padding: 12px 14px;
}
.line-btn.active { border-color: #555; color: #fff; }

.comment {
 padding: 8px 0;
 border-bottom: 1px solid #141414;
 font-size: 13px;
}
.comment-head { font-size: 12px; color: #888; margin-bottom: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.comment-head strong { color: #ddd; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.replies { margin-top: 8px; padding-left: 12px; border-left: 1px solid #222; }

.side-head { font-size: 13px; font-weight: 600; color: #bbb; padding-bottom: 8px; border-bottom: 1px solid #1a1a1a; }
.rel-card {
 width: 100%;
 min-width: 0;
 display: flex;
 align-items: flex-start;
 gap: 8px;
 text-align: left;
 border: 0;
 background: transparent;
 padding: 4px 0;
 appearance: none;
 -webkit-appearance: none;
}
.rel-card:hover { background: transparent; }
.rel-card:hover .card-title { color: #fff; }
.rel-thumb { width: 128px; flex: 0 0 auto; }

.dialog { background: transparent; border: 0; padding: 0; color: #e5e5e5; max-width: 560px; width: calc(100% - 24px); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.8); }
.dialog-box { background: #15241d; border: 1px solid var(--border); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.dialog-box pre { margin: 0; padding: 10px; background: #000; border: 1px solid #1a1a1a; overflow-x: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog[open] { animation: reveal 220ms var(--ease) backwards; }
.grid > .dim { grid-column: 1 / -1; padding: 32px 0; text-align: center; }

@keyframes reveal {
 from { opacity: 0; transform: translateY(12px); }
 to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 960px) {
 .watch { grid-template-columns: 1fr; }
 .is-watching .bar { grid-template-columns: auto 1fr; gap: 16px; }
 .is-watching .search { grid-column: 1 / -1; grid-row: 2; }
 .is-watching .nav { grid-column: 2; grid-row: 1; }
}
@media (max-width: 640px) {
 .bar { padding: 78px 18px 24px; gap: 22px; }
 .nav { right: 18px; top: 16px; }
 .wrap { padding: 18px; }
 .is-watching .bar { padding: 18px; }
 .is-watching .brand { font-size: 22px; gap: 8px; padding: 4px 0; }
 .is-watching .nav button { padding: 8px 10px; font-size: 11px; }
 .search { gap: 9px; padding-left: 15px; }
 .search input { font-size: 13px; }
 .grid { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 18px; }
 .card { padding: 0; }
 .player-box { border-radius: 16px; }
 .controls-right { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
 *, *::before, *::after { animation: none !important; transition: none !important; }
 button:hover:not(:disabled), button:active:not(:disabled), .card:hover:not(:disabled), .thumb img { transform: none; }
}
