:root {
  --bg: #0e0e12;
  --panel: #18181f;
  --panel-2: #22222b;
  --line: #2c2c37;
  --text: #ececf1;
  --muted: #9a9aab;
  --accent: #a970ff;
  --radius: 10px;
  --font-display: inherit;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }

header { display: flex; align-items: center; gap: 16px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--accent); background: var(--panel-2); }
.logo span { color: var(--accent); }
.logo a { display: flex; align-items: center; gap: 10px; }
.logo { gap: 6px; }
.logo a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.logo b, .card h3, .details h1, .live-head strong, .chat-head { font-family: var(--font-display); }
header nav { margin-left: auto; display: flex; gap: 16px; color: var(--muted); }
header nav a:hover { color: var(--text); }

main { max-width: 1400px; margin: 0 auto; padding: 20px; }

.live { background: var(--panel); border-radius: var(--radius); overflow: hidden; display: grid;
  grid-template-columns: minmax(0, 560px) 1fr; height: 0; margin: 0; }
.live.online { height: auto; margin-bottom: 22px; }
.live-head { display: flex; align-items: center; gap: 10px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #eb0400; box-shadow: 0 0 0 4px rgba(235,4,0,.25); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(235,4,0,0); } }
.live-embed { aspect-ratio: 16/9; width: 100%; }
.live-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.live-side { padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.live-side p { margin: 0; color: var(--muted); }
.live-side .btn { align-self: flex-start; }
@media (max-width: 760px) { .live { grid-template-columns: 1fr; } .live-side { padding: 12px 16px 16px; } }

.more-wrap { text-align: center; margin: 18px 0 28px; }
.more { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 22px; font: inherit; font-weight: 700; cursor: pointer; }
.more:hover { border-color: var(--accent); }
.more-wrap:has(.more[hidden]) { margin: 0 0 28px; }

.clips { margin-bottom: 22px; }
.clips h2 { font-family: var(--font-display); font-size: 16px; margin: 0 0 10px; }
.clip-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.clip-card { scroll-snap-align: start; background: var(--panel); border: 0; border-radius: var(--radius); overflow: hidden;
  padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.clip-card:hover { box-shadow: 0 0 0 2px var(--accent); }
.clip-card .info { padding: 8px 10px 10px; }
.clip-card h3 { font-size: 14px; margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.progress div { height: 100%; background: #eb0400; }
.thumb .progress ~ .badge, .thumb .badge:has(+ .progress) { bottom: 12px; }
.cw-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.7); color: #fff; font-size: 13px; cursor: pointer; }
.toast.action { display: flex; align-items: center; gap: 12px; }
.toast.action[hidden] { display: none; }
.toast button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer; }
a.emote-link { display: inline-block; border-radius: 6px; transition: transform .1s ease; }
a.emote-link:hover { transform: scale(1.15); }
.eotm .who a.emote-link:hover, .chips a.emote-link:hover { transform: none; text-decoration: underline; }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.8); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: min(1000px, 100%); }
.modal-frame { aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.modal-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal-close { position: absolute; top: -44px; right: 0; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; width: 36px; height: 36px; font-size: 16px; cursor: pointer; }

.board { background: var(--panel); border-radius: var(--radius); padding: 14px 16px 16px; margin-bottom: 22px; }
.board-head { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }
.board-head h2 { font-family: var(--font-display); font-size: 16px; margin: 0; text-align: center; }
.board-head button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  width: 32px; height: 32px; font-size: 18px; line-height: 1; cursor: pointer; }
.board-head button:disabled { opacity: .3; cursor: default; }
.board-body { display: grid; grid-template-columns: 3fr 1fr; gap: 10px; }
.board-body:has(.eotm-wrap[hidden]) { grid-template-columns: 1fr; }
.board-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px 2px; }
.eotm-wrap, .board-body > div:first-child { display: flex; flex-direction: column; }
.eotm-wrap[hidden] { display: none; }
.board-body .podium { flex: 1; }
.eotm { flex: 1; background: var(--panel-2); border-radius: 10px; padding: 12px 8px; text-align: center; box-shadow: inset 0 0 0 1px #a970ff66;
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.eotm img { height: 44px; max-width: 100%; object-fit: contain; }
.eotm .who { font-weight: 800; margin-top: 6px; overflow-wrap: anywhere; }
.eotm .cnt { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  .board-body { grid-template-columns: 1fr; }
  .eotm { flex-direction: row; gap: 12px; justify-content: flex-start; padding: 10px 14px; text-align: left; }
  .eotm img { height: 36px; } .eotm .who { margin-top: 0; } .eotm .cnt { margin-left: auto; }
}
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.place { background: var(--panel-2); border-radius: 10px; padding: 14px 8px; text-align: center; min-width: 0; }
.place.p1 { order: 2; box-shadow: inset 0 0 0 1px #f5c84266; }
.place.p2 { order: 1; } .place.p3 { order: 3; }
.place { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.place .rank { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 800; color: var(--muted);
  background: var(--panel); border-radius: 999px; padding: 2px 7px; }
.place.p1 .rank { color: #f5c842; }
.place .fav { height: 40px; max-width: 80%; object-fit: contain; }
.place .who { font-weight: 800; margin-top: 8px; overflow-wrap: anywhere; line-height: 1.25; }
@media (max-width: 500px) { .place { padding: 12px 6px; } .place .who { font-size: 13px; } .place .cnt { font-size: 11px; } .place .fav { height: 32px; } }
.place .cnt { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.podium .none { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 14px; padding: 8px 0; }

.controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.controls input, .controls select { background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font: inherit; }
.controls input { flex: 1; min-width: 200px; }
.count { color: var(--muted); align-self: center; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 7px 14px; border-radius: 6px; cursor: pointer; }
.seg button.active { background: var(--accent); color: #fff; }

.shimmer { background: linear-gradient(90deg, var(--panel-2) 25%, #2f2f3b 50%, var(--panel-2) 75%) !important;
  background-size: 200% 100% !important; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-line { height: 14px; border-radius: 4px; margin: 4px 0 10px; }
.sk-line.short { width: 55%; height: 12px; margin-bottom: 2px; }
.skeleton { pointer-events: none; }
.thumb img { opacity: 0; transition: opacity .3s ease; }
.thumb img.loaded { opacity: 1; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card { display: block; border-radius: var(--radius); overflow: hidden; background: var(--panel);
  transition: transform .12s ease, box-shadow .12s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--accent); }
.thumb { position: relative; aspect-ratio: 16/9; background: var(--panel-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.8);
  padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.card .info { padding: 10px 12px 12px; }
.card h3 { margin: 0 0 4px; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 56px 16px; color: var(--muted); }
.empty-state h2 { color: var(--text); font-size: 20px; margin: 8px 0 6px; font-family: var(--font-display); }
.empty-state p { margin: 0 0 18px; }
.empty-icon { font-size: 40px; }
.btn { display: inline-block; background: var(--accent); color: #fff; font-weight: 700; border-radius: 8px; padding: 10px 16px; }
.details h1:empty, .details .meta:empty { height: 20px; width: 60%; border-radius: 4px;
  background: linear-gradient(90deg, var(--panel-2) 25%, #2f2f3b 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.details .meta:empty { height: 14px; width: 35%; margin-top: 10px; }
.chat-log.loading { background: repeating-linear-gradient(to bottom, transparent 0 10px, var(--panel-2) 10px 24px, transparent 24px 34px);
  background-size: 80% 34px; background-repeat: repeat-y; background-position: 14px 8px; animation: pulse-bg 1.4s ease-in-out infinite; }
@keyframes pulse-bg { 50% { opacity: .5; } }
.not-found { display: grid; place-items: center; min-height: calc(100vh - 61px); }

.watch { display: grid; grid-template-columns: 1fr 360px; gap: 0; height: calc(100vh - 61px); }
.watch .left { overflow-y: auto; }
.player { aspect-ratio: 16/9; background: #000; width: 100%; }
.player iframe, .player > div { width: 100%; height: 100%; border: 0; display: block; }
.details { padding: 16px 20px; }
.details h1 { font-size: 20px; margin: 0 0 6px; }
.activity { position: relative; height: 56px; background: var(--panel); border-bottom: 1px solid var(--line); cursor: pointer; touch-action: none; }
.activity svg { position: absolute; inset: 6px 0 0; width: 100%; height: calc(100% - 6px); display: block; }
.activity .area { fill: var(--accent); fill-opacity: .35; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.activity .mark { stroke: #fff; stroke-opacity: .55; stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.act-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.act-tip { position: absolute; bottom: 100%; transform: translateX(-50%); margin-bottom: 6px; background: #0b0b0f; border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 8px; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 6; }
.moments h2 { font-size: 14px; margin: 18px 0 0; color: var(--muted); font-weight: 600; font-family: var(--font-display); }
.moments .chapters { margin-top: 8px; }
.actions { margin-top: 12px; }
.share { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 14px; font: inherit;
  font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.share:hover { filter: brightness(1.1); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: #0b0b0f;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
.music-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.site-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 32px; line-height: 2; }
.site-foot a { text-decoration: underline; text-underline-offset: 3px; }

.chapters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chapters button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chapters button:hover { border-color: var(--accent); }

.chat { display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); min-height: 0; }
.chat-head { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; }
.chat-head span { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 8px 4px; font-size: 13.5px; }
.msg { padding: 3px 10px; word-wrap: break-word; }
.msg .name { font-weight: 700; }
.msg img { height: 22px; vertical-align: middle; margin: -4px 1px; }
.msg .ts { color: var(--muted); font-size: 11px; margin-right: 6px; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  header { padding: 12px 16px; }
  main { padding: 16px; }
  .watch { display: flex; flex-direction: column; height: auto; }
  .watch .left { overflow: visible; }
  .player { position: sticky; top: 0; z-index: 4; }
  .chat { border-left: 0; border-top: 1px solid var(--line); height: 60vh; }
}
