:root {
  --bg: #0f0d17;
  --bg-2: #171424;
  --card: #1d1a2c;
  --card-2: #25213a;
  --line: #2f2a47;
  --text: #f3f0ff;
  --muted: #a39dc0;
  --dim: #6f6990;
  --accent: #8b5cff;
  --accent-2: #ff4d8d;
  --ok: #3ddc97;
  --rec: #ff3b4e;
  --grad: linear-gradient(135deg, #8b5cff, #ff4d8d);
  --radius: 14px;
  --gutter: clamp(16px, 3vw, 32px);
  --top: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 Rubik, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
img, video { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
kbd { font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 4px 7px; border-radius: 6px; background: var(--card-2); border: 1px solid var(--line); border-bottom-width: 2px; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main { min-height: calc(100vh - var(--top)); outline: none; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--top); display: flex; align-items: center; gap: 20px; padding: 0 var(--gutter); background: rgba(15, 13, 23, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 40px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.search:focus-within { border-color: var(--accent); }
.search svg { width: 18px; fill: var(--dim); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: inherit; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--bg-2); }
.nav a.active { color: var(--text); background: var(--card-2); }
.nav-rec { display: flex; align-items: center; gap: 8px; }
.nav-rec .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.nav-rec.on .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(61, 220, 151, .2); }
.nav-rec.recording .dot { background: var(--rec); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- page / sections ---------- */
.page { padding: 24px var(--gutter) 64px; max-width: 1480px; margin: 0 auto; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 21px; font-weight: 700; }
.section-head .sub { color: var(--muted); font-size: 14px; }
.section-head .more { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 14px; }
.section-head .more:hover { color: var(--text); }
.empty { color: var(--muted); padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }

/* ---------- hero ---------- */
.hero { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; min-height: 340px; border-radius: 22px; overflow: hidden; background: var(--card); border: 1px solid var(--line); }
.hero-media { position: relative; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 55%, var(--card)); }
.hero-body { padding: 36px 36px 36px 8px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.hero-body .kicker { color: var(--accent-2); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.hero-body h1 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 800; letter-spacing: -.02em; }
.hero-body p { color: var(--muted); margin: 0; max-width: 46ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 600; background: var(--card-2); border: 1px solid var(--line); transition: transform .12s, background .12s; white-space: nowrap; }
.btn:hover { background: #2f2a49; }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn-primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 8px 24px -10px rgba(139, 92, 255, .8); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.08); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn-danger { color: #ff8a96; }

/* ---------- game grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.game-card { display: block; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); transition: transform .15s, border-color .15s; }
.game-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.game-card .thumb { aspect-ratio: 16 / 9; position: relative; background: var(--bg-2); }
.game-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.game-card .play-badge { position: absolute; inset: auto 10px 10px auto; width: 40px; height: 40px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; opacity: 0; transform: scale(.8); transition: .15s; }
.game-card .play-badge svg { width: 18px; fill: #fff; margin-left: 2px; }
.game-card:hover .play-badge { opacity: 1; transform: none; }
.game-card .info { padding: 12px 14px 14px; }
.game-card h3 { font-size: 16px; font-weight: 600; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag { font-size: 12px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }
.game-card .soon { aspect-ratio: 16/9; display: grid; place-items: center; color: var(--dim); font-weight: 600; }

/* ---------- strips (YouTube-like shelves) ---------- */
.strip { position: relative; }
.strip-track { display: grid; grid-auto-flow: column; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 2px; padding: 2px 2px 10px; scrollbar-width: none; }
.strip-track::-webkit-scrollbar { display: none; }
.strip-track > * { scroll-snap-align: start; }
.strip.videos .strip-track { grid-auto-columns: minmax(280px, calc((100% - 3 * 16px) / 4)); }
.strip.reels .strip-track { grid-auto-columns: minmax(160px, calc((100% - 6 * 16px) / 7)); }
.strip-arrow { position: absolute; top: 38%; z-index: 2; width: 40px; height: 40px; border-radius: 50%; background: rgba(29, 26, 44, .95); border: 1px solid var(--line); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); transition: opacity .15s; }
.strip.reels .strip-arrow { top: 44%; }
.strip-arrow svg { width: 18px; fill: var(--text); }
.strip-arrow.prev { left: -14px; } .strip-arrow.next { right: -14px; }
.strip-arrow[hidden] { display: grid; opacity: 0; pointer-events: none; }

.vcard { display: block; min-width: 0; }
.vcard .thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--bg-2); }
.vcard .thumb img, .vcard .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vcard .thumb video { opacity: 0; transition: opacity .2s; }
.vcard .thumb video.on { opacity: 1; }
.badge-time { position: absolute; right: 8px; bottom: 8px; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .78); }
.vcard .meta { display: flex; gap: 10px; padding-top: 10px; }
.vcard .meta .game-ava { flex: none; width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.vcard h3 { font-size: 15px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard .by { color: var(--muted); font-size: 13px; margin-top: 3px; }
.vcard:hover h3 { color: #fff; }

.rcard { display: block; position: relative; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: var(--bg-2); }
.rcard > img, .rcard > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rcard > video { opacity: 0; transition: opacity .2s; }
.rcard > video.on { opacity: 1; }
.rcard .shade { position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0, 0, 0, .85)); }
.rcard .cap { position: absolute; left: 10px; right: 10px; bottom: 10px; }
.rcard .cap h3 { font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.rcard .cap .views { font-size: 12px; color: #ddd; margin-top: 3px; }
.rcard .game-chip { position: absolute; top: 8px; left: 8px; }
.rcard.make { display: grid; place-items: center; text-align: center; padding: 18px; background: linear-gradient(160deg, #241d40, #1a1630); border: 1px dashed #4a3f78; }
.rcard.make .plus { width: 52px; height: 52px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; margin: 0 auto 12px; }
.rcard.make .plus svg { width: 22px; fill: #fff; }
.rcard.make b { display: block; font-size: 15px; }
.rcard.make span { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }

.game-chip { display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 16px); padding: 3px 9px 3px 3px; border-radius: 999px; background: rgba(15, 13, 23, .72); backdrop-filter: blur(6px); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; }

/* ---------- game page ---------- */
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.stage-wrap { border-radius: 18px; overflow: hidden; background: #000; border: 1px solid var(--line); }
/* Width comes from the height budget, so the stage stays exactly 16:9 in every browser: games scale their UI to
   16:9, and a wider stage (max-height alone, e.g. in Safari) cut off their bottom bar. */
.stage { position: relative; aspect-ratio: 16 / 9; width: min(100%, calc((100vh - var(--top) - 120px) * 16 / 9)); margin: 0 auto; background: #000; transition: aspect-ratio .3s, width .3s; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.stage:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; }
.stage.vertical { aspect-ratio: 9 / 16; width: auto; height: calc(100vh - var(--top) - 120px); max-height: 900px; }
.stage-cover { position: absolute; inset: 0; display: grid; place-items: center; background-size: cover; background-position: center; cursor: pointer; }
.stage-cover::before { content: ""; position: absolute; inset: 0; background: rgba(10, 8, 18, .55); backdrop-filter: blur(3px); }
.stage-cover .inner { position: relative; text-align: center; }
.stage-cover .big-play { width: 84px; height: 84px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; margin: 0 auto 14px; box-shadow: 0 10px 40px -8px rgba(139, 92, 255, .9); transition: transform .15s; }
.stage-cover:hover .big-play { transform: scale(1.06); }
.stage-cover .big-play svg { width: 34px; fill: #fff; margin-left: 5px; }
.stage-cover h1 { font-size: 26px; }
.stage-cover .note { color: var(--muted); font-size: 13px; margin-top: 6px; }

.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg-2); border-top: 1px solid var(--line); }
.toolbar .t-title { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; }
.toolbar .t-title img { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; }
.toolbar .t-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbtn { position: relative; height: 36px; min-width: 36px; padding: 0 10px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.tbtn:hover { color: var(--text); background: var(--card-2); }
.tbtn svg { width: 20px; height: 20px; fill: currentColor; }
.tbtn.on { color: var(--text); background: var(--card-2); }
.tbtn[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); right: 0; white-space: nowrap; font-size: 12px; padding: 6px 9px; border-radius: 8px; background: #000; color: #fff; pointer-events: none; }
/* Record control: quiet until hovered or recording, so it never competes with the game. */
.rec-btn { opacity: .55; }
.toolbar:hover .rec-btn, .rec-btn:focus-visible { opacity: 1; }
.rec-btn .rec-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; }
.rec-btn.ready .rec-dot { background: var(--rec); border-color: var(--rec); }
.rec-btn.recording { opacity: 1; color: #fff; background: rgba(255, 59, 78, .18); }
.rec-btn.recording .rec-dot { background: var(--rec); border-color: var(--rec); animation: pulse 1s infinite; border-radius: 3px; }
.rec-btn .rec-time { font-variant-numeric: tabular-nums; }

.popover { position: absolute; z-index: 30; width: 300px; padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .6); }
.popover h4 { margin: 0 0 6px; font-size: 15px; }
.popover p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.popover .row { display: flex; gap: 8px; flex-wrap: wrap; }
.popover .opts { display: grid; gap: 8px; margin: 10px 0 14px; }
.seg { display: flex; padding: 3px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { flex: 1; height: 30px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--card-2); color: var(--text); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.side-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.side-card + .side-card { margin-top: 14px; }
.side-card h1 { font-size: 22px; }
.side-card p { color: var(--muted); margin: 8px 0 0; }
.side-card .controls { margin-top: 14px; font-size: 13px; color: var(--muted); }
.side-card .controls b { color: var(--text); display: block; margin-bottom: 4px; font-size: 13px; }
.rec-promo { background: linear-gradient(150deg, #2a1f4d, #1d1a2c 60%); }
.rec-promo h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.rec-promo ul { margin: 10px 0 14px; padding: 0; list-style: none; display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.rec-promo li { display: flex; gap: 8px; align-items: center; }

/* ---------- watch page ---------- */
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.player { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.watch-title { font-size: 22px; font-weight: 700; margin-top: 14px; }
.watch-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 14px; }
.watch-meta .sp { flex: 1; }
.desc { margin-top: 14px; background: var(--card); border-radius: 12px; padding: 12px 14px; color: #d8d3ef; white-space: pre-wrap; }
.play-cta { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(139, 92, 255, .22), rgba(255, 77, 141, .14)); border: 1px solid #4a3f78; }
.play-cta img { width: 112px; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; flex: none; }
.play-cta .t { min-width: 0; flex: 1; }
.play-cta .t small { color: var(--muted); font-size: 12px; display: block; }
.play-cta .t b { display: block; font-size: 16px; margin: 2px 0 8px; }
.side-list { display: grid; gap: 12px; margin-top: 18px; }
.side-list .vcard { display: grid; grid-template-columns: 168px 1fr; gap: 10px; }
.side-list .vcard .meta { padding: 0; }
.side-list .vcard .game-ava { display: none; }
.side-list .vcard h3 { font-size: 14px; }

.like-btn { display: inline-flex; align-items: center; gap: 6px; }
.like-btn svg { width: 18px; fill: currentColor; }
.like-btn.on { color: var(--accent-2); }

/* ---------- reels viewer ---------- */
.reels-feed { height: calc(100vh - var(--top)); overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; }
.reels-feed::-webkit-scrollbar { display: none; }
.reel { height: calc(100vh - var(--top)); scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 0; }
.reel-box { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: calc(100vw - 32px); border-radius: 18px; overflow: hidden; background: #000; }
.reel-box video { width: 100%; height: 100%; object-fit: cover; }
.reel-box .shade { position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); pointer-events: none; }
.reel-info { position: absolute; left: 14px; right: 14px; bottom: 14px; }
.reel-info h2 { font-size: 16px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.reel-info .by { color: #ddd; font-size: 13px; margin: 4px 0 12px; }
.reel-play { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, .12); backdrop-filter: blur(10px); }
.reel-play img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.reel-play .t { flex: 1; min-width: 0; }
.reel-play .t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel-play .t small { color: #ddd; font-size: 12px; }
.reel-play .btn { height: 36px; padding: 0 14px; }
.reel-side { display: flex; flex-direction: column; gap: 14px; align-self: flex-end; padding-bottom: 20px; }
.round { width: 48px; height: 48px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; }
.round svg { width: 22px; fill: currentColor; }
.round:hover { background: #352f52; }
.round.on { color: var(--accent-2); }
.round-label { text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.tap-hint { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.tap-hint svg { width: 64px; fill: rgba(255,255,255,.85); opacity: 0; transition: opacity .2s; }
.tap-hint.show svg { opacity: 1; }
.reels-nav { position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); display: grid; gap: 10px; }

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start; }
.studio-preview { width: min(360px, 80vw); border-radius: 18px; overflow: hidden; background: #000; }
.studio-preview.horizontal { width: min(640px, 90vw); }
.studio-preview video { width: 100%; }
.form { display: grid; gap: 16px; max-width: 560px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field input, .field textarea, .field select { width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.notice.ok { border-color: rgba(61, 220, 151, .5); color: #bff3da; }

/* ---------- extension guide ---------- */
.guide-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 28px; border-radius: 22px; background: linear-gradient(135deg, #2a1f4d, #1a1630); border: 1px solid #3b3164; }
.guide-hero h1 { font-size: clamp(26px, 3vw, 36px); font-weight: 800; }
.guide-hero p { color: var(--muted); margin: 10px 0 0; max-width: 60ch; }
.ext-status { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); min-width: 260px; }
.ext-status .big-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--dim); flex: none; }
.ext-status.on .big-dot { background: var(--ok); box-shadow: 0 0 0 5px rgba(61, 220, 151, .18); }
.ext-status b { display: block; }
.ext-status small { color: var(--muted); }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.step { counter-increment: s; position: relative; padding: 20px 20px 20px 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.step::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--grad); font-weight: 700; margin-bottom: 12px; }
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.step code { font: 600 13px ui-monospace, Menlo, monospace; background: var(--bg-2); padding: 2px 6px; border-radius: 6px; color: #d9cfff; user-select: all; }
.step .btn { margin-top: 12px; }
.hotkeys { display: grid; gap: 10px; }
.hotkey { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.hotkey .keys { display: flex; gap: 4px; min-width: 190px; }
.hotkey span { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 8px 0 0; }
.browser-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 100; max-width: min(520px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 12px; background: #fff; color: #120f1d; font-weight: 500; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast a { color: var(--accent); font-weight: 600; text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .play-layout, .watch-layout { grid-template-columns: minmax(0, 1fr); }
  .strip.videos .strip-track { grid-auto-columns: minmax(260px, calc((100% - 2 * 16px) / 3)); }
  .strip.reels .strip-track { grid-auto-columns: minmax(150px, calc((100% - 4 * 16px) / 5)); }
}
@media (max-width: 760px) {
  :root { --top: 56px; }
  .topbar { gap: 10px; }
  .brand span, .nav-rec-label { display: none; }
  .search { max-width: none; }
  .nav a { padding: 8px 10px; }
  .hero { grid-template-columns: 1fr; }
  .hero-media { aspect-ratio: 16 / 9; }
  .hero-media::after { background: linear-gradient(transparent 50%, var(--card)); }
  .hero-body { padding: 0 20px 24px; }
  .strip.videos .strip-track { grid-auto-columns: 78%; }
  .strip.reels .strip-track { grid-auto-columns: 42%; }
  .strip-arrow { display: none !important; }
  .studio, .two-col, .guide-hero { grid-template-columns: 1fr; }
  .reel { position: relative; } /* each Play keeps its own side buttons */
  .reel-side { position: absolute; right: 22px; bottom: 140px; }
  .reels-nav { display: none; }
  .side-list .vcard { grid-template-columns: 140px 1fr; }
  .stage.vertical { height: calc(100vh - var(--top) - 80px); }
}

/* =====================================================================
   Accounts, social, upload and editor (appended; tokens.css may restyle)
   ===================================================================== */
.me-area { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.hdr-btn { position: relative; }
.hdr-label { margin-left: 2px; }
.me-btn { border-radius: 50%; padding: 0; display: grid; }
.ava { border-radius: 50%; object-fit: cover; flex: none; display: block; }
.ava-letter { display: grid; place-items: center; font-weight: 700; color: #fff; background: hsl(var(--h) 60% 45%); }
.ava-wrap { position: relative; display: inline-flex; flex: none; }
.ava-wrap.on::after { content: ""; position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--card); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-2); color: #fff; font-size: 11px; font-weight: 700; }
.dot-badge { position: absolute; top: 2px; right: 2px; }
.me-menu { position: fixed; display: grid; gap: 2px; width: 240px; padding: 10px; }
.me-menu a, .me-menu > button { padding: 9px 10px; border-radius: 8px; text-align: left; color: var(--text); }
.me-menu a:hover, .me-menu > button:hover { background: var(--card-2); }
.me-head { display: flex; gap: 10px; align-items: center; padding: 6px 6px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.me-head small { display: block; color: var(--muted); }
.me-lang { display: flex; align-items: center; gap: 6px; padding: 8px 10px; color: var(--muted); font-size: 14px; }
.me-lang button { padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); font-size: 12px; }
.me-lang button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.hint { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.disabled { opacity: .5; pointer-events: none; }
.mini-select { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; }
.rec-ic svg { width: 18px; fill: var(--rec); vertical-align: -3px; }
.join-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; background: rgba(61, 220, 151, .12); border: 1px solid rgba(61, 220, 151, .4); }
.join-banner svg { width: 22px; fill: var(--ok); }

/* social drawer / overlay */
.social-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(5, 4, 10, .35); }
.social-drawer { position: fixed; z-index: 71; top: 0; right: 0; bottom: 0; width: min(380px, 100vw); display: flex; flex-direction: column; background: var(--bg-2); border-left: 1px solid var(--line); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); transform: translateX(100%); transition: transform .2s ease; }
.social-drawer.open { transform: none; }
.social-drawer.overlay { background: rgba(23, 20, 36, .94); backdrop-filter: blur(14px); }
.sp-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; }
.sp-head b { flex: 1; font-size: 17px; }
.sp-tabs { margin: 0 14px 8px; }
.sp-body, .share-list { overflow-y: auto; padding: 4px 14px 16px; flex: 1; }
.sp-empty { padding: 30px 20px; text-align: center; color: var(--muted); }
.sp-add { display: flex; gap: 8px; margin: 6px 0 4px; }
.sp-add input, .sp-copy input, .chat-form input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.sp-label { margin: 14px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.sp-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 10px; }
.sp-row:hover { background: rgba(255, 255, 255, .04); }
.sp-row.clickable { cursor: pointer; }
.sp-row.muted { opacity: .6; }
.sp-who { flex: 1; min-width: 0; }
.sp-who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-who small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-who small.playing { color: var(--ok); }
.sp-time { color: var(--dim); font-size: 11px; }
.sp-hint { color: var(--muted); font-size: 13px; text-align: center; padding: 14px 0; }
.sp-copy { display: flex; gap: 8px; padding: 0 0 6px; }
.chat-sub { padding: 0 14px 8px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.msg { align-self: flex-start; max-width: 82%; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--card-2); white-space: pre-wrap; word-wrap: break-word; }
.msg.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--accent); color: #fff; }
.msg time { display: block; font-size: 10px; opacity: .6; margin-top: 2px; text-align: right; }
.msg-video { display: block; width: 180px; }
.msg-video img { width: 100%; border-radius: 10px; aspect-ratio: 9/12; object-fit: cover; }
.msg-video span { display: flex; gap: 4px; align-items: center; margin-top: 6px; font-weight: 600; font-size: 13px; }
.msg-video svg { width: 14px; fill: currentColor; }
.msg-invite { display: flex; align-items: center; gap: 10px; }
.msg-invite > svg { width: 26px; fill: currentColor; }
.msg-invite small { display: block; opacity: .75; font-size: 12px; }
.chat-form { display: flex; gap: 6px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.chat-form .send { color: var(--accent); }
.messages-page { height: calc(100vh - var(--top) - 90px); max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(5, 4, 10, .6); padding: 16px; }
.modal { width: min(420px, 100%); max-height: 80vh; display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding-bottom: 8px; }
.modal .sp-copy { padding: 0 14px 6px; }
.modal .sp-label { margin-left: 14px; }

/* auth */
.auth-page { display: grid; place-items: center; min-height: calc(100vh - var(--top) - 40px); }
.auth-card { width: min(420px, 100%); padding: 32px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); text-align: center; display: grid; gap: 12px; }
.auth-card h1 { font-size: 26px; }
.auth-card > p { color: var(--muted); margin: 0; }
.auth-card .form { text-align: left; max-width: none; gap: 12px; }
.google-btn { background: #fff; color: #1f1f1f; border: 0; }
.google-btn:hover { background: #f1f1f1; }
.or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.switch { color: var(--muted); margin: 0; }
.switch a { color: var(--accent); font-weight: 600; }

/* upload */
.dropzone { display: grid; justify-items: center; gap: 10px; padding: 48px 20px; border: 2px dashed #4a3f78; border-radius: 22px; background: linear-gradient(160deg, #201a38, #17142a); text-align: center; cursor: pointer; transition: .15s; }
.dropzone.over { border-color: var(--accent); background: #241d44; }
.dropzone.busy { opacity: .6; pointer-events: none; }
.dropzone span { color: var(--muted); }
.dz-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); }
.dz-ic svg { width: 28px; fill: #fff; }
.dropzone .btn { color: #fff; margin-top: 6px; }
.upload-progress { margin-top: 14px; display: grid; gap: 6px; color: var(--muted); }
.upload-progress .bar { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.upload-progress i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.upload-opts { margin-bottom: 18px; align-items: end; }
.upload-progress[hidden] { display: none; }
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 24px; }
.tips div { padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.tips b { display: block; margin-bottom: 4px; }
.tips span { color: var(--muted); font-size: 14px; }

/* editor */
.editor { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start; }
.ed-left { display: grid; gap: 14px; justify-items: center; }
.ed-phone { position: relative; height: min(70vh, 640px); aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden; background: #000; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.ed-phone.wide { height: auto; width: min(640px, 60vw); aspect-ratio: 16 / 9; }
.ed-phone video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ed-layer { position: absolute; inset: 0; container-type: size; }
.sticker { position: absolute; transform: translate(-50%, -50%); font-weight: 700; line-height: 1.2; text-align: center; white-space: pre; cursor: grab; user-select: none; text-shadow: 0 2px 8px rgba(0, 0, 0, .55); touch-action: none; }
.sticker.boxed { padding: .1em .35em; border-radius: .3em; text-shadow: none; }
.sticker.sel { outline: 2px dashed rgba(255, 255, 255, .8); outline-offset: 4px; }
.ed-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; background: rgba(0, 0, 0, .5); display: grid; place-items: center; transition: opacity .15s; }
.ed-play svg { width: 28px; fill: #fff; margin-left: 4px; }
.ed-play.hide { opacity: 0; pointer-events: none; }
.ed-timeline { position: relative; width: 100%; min-width: 300px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--card); cursor: pointer; touch-action: none; }
.ed-strip { display: flex; height: 100%; overflow: hidden; }
.ed-strip canvas { height: 100%; flex: 1 0 auto; object-fit: cover; }
.ed-dim { position: absolute; top: 0; bottom: 0; background: rgba(10, 8, 18, .72); }
.ed-dim.l { left: 0; } .ed-dim.r { right: 0; }
.ed-handle { position: absolute; top: 0; bottom: 0; width: 14px; margin-left: -7px; background: var(--accent-2); border-radius: 4px; cursor: ew-resize; }
.ed-handle::after { content: ""; position: absolute; left: 5px; top: 35%; bottom: 35%; width: 4px; border-left: 2px solid #fff; border-right: 2px solid #fff; }
.ed-head { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; pointer-events: none; }
.ed-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); margin-bottom: 14px; }
.ed-tabs button { flex: 1; min-width: 72px; display: grid; justify-items: center; gap: 3px; padding: 8px 6px; border-radius: 10px; color: var(--muted); font-size: 12px; }
.ed-tabs button .ic { font-size: 18px; line-height: 20px; }
.ed-tabs button svg { width: 20px; height: 20px; fill: currentColor; }
.ed-tabs button.on { background: var(--card-2); color: var(--text); }
.ed-panel { display: grid; gap: 12px; padding: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.ed-panel h3 { font-size: 17px; }
.ed-panel .form { max-width: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv span { color: var(--muted); }
.swatches { display: flex; gap: 8px; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); }
.swatches button.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.range { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.range input, input.wide { width: 100%; accent-color: var(--accent); }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.filters button { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.filters img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; border: 2px solid transparent; }
.filters button.on img { border-color: var(--accent); }
.filters button.on { color: var(--text); }
.cover-preview { max-width: 180px; border-radius: 10px; }
.status-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card-2); color: var(--muted); }
.status-pill.published { background: rgba(61, 220, 151, .15); color: var(--ok); }
.status-pill.pending { background: rgba(255, 210, 63, .15); color: #ffd23f; }
.status-pill.rejected { background: rgba(255, 59, 78, .15); color: #ff8a96; }
.section-head .status-pill { margin-left: auto; }

/* profile / my videos */
.profile-head { display: flex; align-items: center; gap: 16px; padding: 10px 0 4px; }
.profile-head h1 { font-size: 26px; }
.profile-head small { color: var(--muted); }
.profile-head .sp { flex: 1; }
.my-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.my-card { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.my-card:hover { border-color: var(--accent); }
.my-card .thumb img { width: 90px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; }
.my-card .thumb.video img { aspect-ratio: 16 / 9; }
.my-card b { display: block; font-size: 14px; margin-bottom: 6px; }
.my-card small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.prose { max-width: 760px; }
.prose h1 { margin-bottom: 4px; }
.prose h3 { margin: 22px 0 6px; }
.prose p { color: #d8d3ef; }
.manual summary { cursor: pointer; font-weight: 600; margin-bottom: 14px; }

@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .ed-phone { height: min(62vh, 560px); }
  .ed-phone.wide { width: 100%; }
}
@media (max-width: 760px) {
  .hdr-label, .hide-sm { display: none; }
  .me-area { margin-left: 0; }
}
.field select.invalid, select.invalid { border-color: var(--rec); box-shadow: 0 0 0 3px rgba(255, 59, 78, .2); }
.auth-forgot { font-size: 13px; color: var(--muted); } .auth-forgot summary { cursor: pointer; color: var(--accent); } .auth-forgot p { margin: 8px 0 0; } .auth-error { text-align: left; color: var(--px-red, #FF6B7A); border-color: currentColor; }
/* account settings on /me */
.acc-card { margin-top: var(--s-8, 32px); }
.acc-card .card-head p { margin: 4px 0 0; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s-6, 24px); }
.acc-grid .form { max-width: none; gap: 12px; }
.acc-grid h3 { margin: 0; font-size: 15px; }
.acc-grid .form > .btn { justify-self: start; }
