/* ================= Whirl v3 redesign (loaded after style.css) ================= */
:root { --side: 240px; --top: 58px; --ring: 0 0 0 2px var(--lime), 0 0 18px rgba(168,255,26,.35); }
body { background: radial-gradient(1200px 600px at 70% -10%, rgba(168,255,26,.06), transparent 60%), var(--bg); }
.top { height: var(--top); z-index: 40; }
.logo { display: flex; align-items: center; gap: 2px; }
.logo::before { content: none; }
.logoicon { width: 30px; height: 30px; margin-right: 9px; filter: drop-shadow(0 0 10px rgba(168,255,26,.35)); }
.logo { font-size: 25px; letter-spacing: .5px; }

/* ---------- sidebar ---------- */
#side { position: fixed; left: 0; top: var(--top); bottom: 0; width: var(--side); overflow-y: auto; background: #0e110a; border-right: 1px solid var(--line); padding: 10px 8px 30px; z-index: 30; transition: width .2s; }
main { margin-left: var(--side); max-width: none; padding: 22px 28px 60px; transition: margin .2s; }
footer { margin-left: var(--side); }
.sidetoggle { float: right; padding: 4px 8px; background: none; border: 0; color: var(--muted); }
.shead { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 14px 8px 6px; clear: both; }
.srow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.srow:hover { background: var(--panel2); }
.sname { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.sname b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sname small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sview { font-size: 13px; display: flex; align-items: center; gap: 5px; }
.sview i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--red); }
.sempty { color: var(--muted); font-size: 13px; padding: 4px 8px; }
body.sidemini { --side: 64px; }
body.sidemini .shead, body.sidemini .sname, body.sidemini .sview, body.sidemini .sempty { display: none; }
body.sidemini .srow { justify-content: center; padding: 6px 0; }
body.sidemini .sidetoggle { float: none; display: block; margin: 0 auto; transform: rotate(180deg); }

/* ---------- browse hero + chips ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); background: linear-gradient(135deg, #151b0e, #0c0f08); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-bottom: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.hero-player { position: relative; aspect-ratio: 16/9; background: #000; }
.hero-player video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-link { position: absolute; inset: 0; }
.hero-viewers { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.7); padding: 3px 9px; border-radius: 6px; font-size: 13px; }
.hero-info { padding: 26px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.hero-top { display: flex; gap: 12px; align-items: center; }
.hero-name { font-family: "Chakra Petch"; font-size: 24px; font-weight: 700; }
.hero-title { font-size: 18px; font-weight: 600; line-height: 1.35; }
.empty-hero { grid-template-columns: 1fr; padding: 50px; text-align: center; background: radial-gradient(circle at 50% 0%, rgba(168,255,26,.12), transparent 60%), #0e1209; }
button.big { padding: 12px 22px; font-size: 16px; border-radius: 10px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { background: var(--panel2); border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px; font-size: 12.5px; color: #cfdcc0; }
.tag:empty { display: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
.chip { border-radius: 20px; padding: 6px 14px; font-size: 14px; }
.chip.on { background: var(--lime); color: #0b1205; border-color: var(--lime); }

/* ---------- cards + hover preview ---------- */
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,.5), 0 0 0 1px var(--lime); }
.thumb { overflow: hidden; }
.thumb video.preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.thumb .badge-live, .thumb .badge-viewers, .thumb .badge-clip { z-index: 2; }

/* ---------- watch page ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 360px; margin: -22px -28px -60px; min-height: calc(100vh - var(--top)); }
.watch-main { padding: 0 0 40px; min-width: 0; }
.watch .chat { position: sticky; top: var(--top); height: calc(100vh - var(--top)); max-height: none; border-radius: 0; border-width: 0 0 0 1px; }
.watch .tabs, .watch .panel { margin-left: 24px; margin-right: 24px; }
.player { position: relative; border-radius: 0; aspect-ratio: 16/9; max-height: calc(100vh - var(--top) - 120px); width: 100%; background: #000; }
.player video { width: 100%; height: 100%; object-fit: contain; }
.player .off > div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.player .off span { color: var(--muted); max-width: 420px; }
.pctl { position: absolute; left: 0; right: 0; bottom: 0; display: none; align-items: center; gap: 6px; padding: 30px 12px 10px; background: linear-gradient(transparent, rgba(0,0,0,.85)); opacity: 0; transition: opacity .2s; }
.player.on .pctl { display: flex; }
.player.on.show .pctl, .player.on:hover .pctl { opacity: 1; }
.pctl button { background: rgba(255,255,255,.08); border: 0; color: #fff; padding: 7px 11px; border-radius: 8px; font-size: 15px; }
.pctl button:hover { background: rgba(255,255,255,.2); }
.pctl input[type=range] { width: 100px; accent-color: var(--lime); }
.pspacer { flex: 1; }
.livechip { font-weight: 700; font-size: 13px !important; color: #ff5c77 !important; }
.livechip.behind { color: #fff !important; background: rgba(255,255,255,.18) !important; }
.livechip.behind::after { content: " · jump to live"; font-weight: 500; }
#pClip { background: var(--lime); color: #0b1205; font-weight: 700; }
.unmute { position: absolute; left: 14px; top: 14px; background: rgba(0,0,0,.75); border: 1px solid rgba(255,255,255,.2); color: #fff; padding: 8px 14px; border-radius: 10px; font-weight: 600; z-index: 3; }
body.theater #side { display: none; }
body.theater main, body.theater footer { margin-left: 0; }
body.theater .player { max-height: calc(100vh - var(--top)); height: calc(100vh - var(--top)); aspect-ratio: auto; }
.infobar { display: flex; gap: 16px; align-items: center; padding: 16px 24px; flex-wrap: wrap; }
.infobar .info { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 4px; }
.infobar .cname { font-size: 20px; }
.infobar .title { font-size: 16px; font-weight: 600; }
.avring { border-radius: 50%; padding: 3px; }
.avring.on { box-shadow: var(--ring); background: var(--lime); }
.avring.on::after { content: "LIVE"; display: block; margin: -12px auto 0; width: max-content; position: relative; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 4px; letter-spacing: 1px; }
.cactions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chead .cactions { margin-left: auto; }

/* ---------- chat ---------- */
.chat { position: relative; }
.chat .hd { display: flex; align-items: center; gap: 8px; }
.chat .msgs .m { line-height: 1.45; padding: 3px 6px; word-break: break-word; }
.chat .msgs .m .who { cursor: pointer; margin-right: 0; }
.chat .msgs .m .colon { color: var(--muted); margin-right: 2px; }
.chat .msgs time { display: none; color: var(--muted); font-size: 11px; margin-right: 6px; }
.chat .msgs.ts time { display: inline; }
.chat .msgs .m.hl { background: rgba(168,255,26,.12); box-shadow: inset 3px 0 0 var(--lime); }
.mention { background: rgba(255,255,255,.08); padding: 0 3px; border-radius: 4px; font-weight: 600; }
.mention.me { background: var(--lime); color: #0b1205; }
.chat .msgs .ev { padding: 4px 6px; background: rgba(168,255,26,.06); border-radius: 6px; }
.paused { display: none; position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--lime); color: var(--text); border-radius: 20px; padding: 6px 14px; font-size: 13px; z-index: 2; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.paused.show { display: block; }
.chat form { position: relative; align-items: center; }
.emojis { display: none; position: absolute; bottom: 54px; left: 8px; right: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; grid-template-columns: repeat(8, 1fr); gap: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.emojis.open { display: grid; }
.emojis button { background: none; border: 0; font-size: 18px; padding: 4px; border-radius: 6px; }
.emojis button:hover { background: var(--panel); }
button.tiny { padding: 4px 7px; font-size: 14px; }

/* ---------- clip editor ---------- */
.clipeditor .ce { width: 760px; max-width: 100%; background: #12160d; border: 1px solid #2c3a20; border-radius: 16px; padding: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.7); }
.ce-load { display: flex; gap: 14px; align-items: center; justify-content: center; padding: 50px; font-weight: 600; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--lime); border-radius: 50%; animation: fsspin .8s linear infinite; }
@keyframes fsspin { to { transform: rotate(360deg); } }
.ce-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ce-head b { font-family: "Chakra Petch"; font-size: 20px; }
.ce-head .muted { flex: 1; font-size: 13px; }
.ce-stage { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; }
.ce-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.ce-vframe { display: none; position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); aspect-ratio: 9/16; box-shadow: 0 0 0 2000px rgba(0,0,0,.6); border: 2px solid var(--lime); }
.ce-vframe.on { display: block; }
.ce-mute { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.7); border: 0; color: #fff; }
.ce-track { position: relative; height: 54px; margin: 14px 0 6px; border-radius: 10px; background: repeating-linear-gradient(90deg, #1b2213 0 10px, #161c10 10px 20px); border: 1px solid var(--line); cursor: pointer; touch-action: none; }
.ce-sel { position: absolute; top: -2px; bottom: -2px; background: rgba(168,255,26,.18); border: 3px solid var(--lime); border-radius: 8px; cursor: grab; box-shadow: 0 0 18px rgba(168,255,26,.3); }
.ce-sel .h { position: absolute; top: 50%; width: 14px; height: 34px; margin-top: -17px; background: var(--lime); border-radius: 4px; cursor: ew-resize; }
.ce-sel .h.l { left: -9px; }
.ce-sel .h.r { right: -9px; }
.ce-sel .h::after { content: ""; position: absolute; inset: 9px 5px; border-left: 2px solid #0b1205; border-right: 2px solid #0b1205; }
.ce-head-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; pointer-events: none; }
.ce-times { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.ce-times b { color: var(--lime); font-size: 15px; }
.ce-times b.bad { color: var(--red); }
.ce-quick { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.ce-quick button { padding: 5px 12px; font-size: 13px; border-radius: 20px; }
.ce-title { display: flex; gap: 10px; align-items: center; }
.ce-title input { flex: 1; font-size: 15px; padding: 11px 12px; }
.ce-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
button:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 1100px) { .watch { grid-template-columns: 1fr; margin: -22px -16px 0; } .watch .chat { position: static; height: 480px; border-width: 1px 0 0; } .hero { grid-template-columns: 1fr; } }
@media (max-width: 800px) { #side { display: none; } main, footer { margin-left: 0; padding: 16px; } }

/* header: get the app */
.getapp { color: var(--lime); font-weight: 700; font-size: 14px; padding: 7px 12px; border: 1px solid rgba(168,255,26,.35); border-radius: 9px; white-space: nowrap; }
.getapp:hover { background: rgba(168,255,26,.1); }
@media (max-width: 900px) { .getapp { display: none; } }

/* nav icons only show in the phone tab bar */
.top nav i { display: none; font-style: normal; }
.top nav .m-only { display: none; }
.top { padding-top: env(safe-area-inset-top); height: calc(var(--top, 58px) + env(safe-area-inset-top)); }

/* phones: app-style bottom tab bar, header keeps logo + log in / sign up */
@media (max-width: 640px) {
  .top { gap: 10px; padding-left: 14px; padding-right: 14px; backdrop-filter: none; -webkit-backdrop-filter: none; background: #0b0d08; }
  .top nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    background: rgba(11,13,8,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .top nav a, .top nav .m-only { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 7px; font-size: 11px; }
  .top nav i { display: block; font-size: 19px; line-height: 1.1; }
  .top nav a.active, .top nav a[aria-current] { color: var(--lime); }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .logo { font-size: 20px; }
  #authBox .btn, #authBox button { padding: 7px 11px; font-size: 13.5px; }
  .watch .chat { height: 60vh; }
  .ce-foot { flex-wrap: wrap; }
}
