:root { --bg:#0f1115; --panel:#181b22; --line:#2a2f3a; --text:#e8eaf0; --muted:#8b93a7; --accent:#e0457b; --ok:#3fb27f; --warn:#e0a03f; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:15px/1.5 system-ui, sans-serif; }
a { color:var(--accent); text-decoration:none; }
nav { display:flex; gap:16px; align-items:center; padding:12px 20px; border-bottom:1px solid var(--line); background:var(--panel); }
nav .spacer { flex:1; }
main { max-width:1100px; margin:0 auto; padding:20px; }
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:16px; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:14px; }
.card h3 { margin:0 0 6px; }
.muted { color:var(--muted); font-size:13px; }
button { background:var(--accent); color:#fff; border:0; border-radius:8px; padding:8px 14px; cursor:pointer; font:inherit; }
button.secondary { background:transparent; border:1px solid var(--line); color:var(--text); }
button.danger { background:#b3372f; }
button:disabled { opacity:.5; cursor:default; }
input, select, textarea { background:#0f1115; color:var(--text); border:1px solid var(--line); border-radius:8px; padding:8px; font:inherit; width:100%; }
label { display:block; margin:10px 0 4px; color:var(--muted); font-size:13px; }
.row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.row > * { width:auto; }
.stage { display:grid; grid-template-columns:1fr 320px; gap:16px; }
@media (max-width:800px) { .stage { grid-template-columns:1fr; } }
#video { background:#000; border-radius:10px; aspect-ratio:16/9; overflow:hidden; display:flex; align-items:center; justify-content:center; color:var(--muted); }
#video video { width:100%; height:100%; object-fit:contain; }
#chat { height:340px; overflow-y:auto; background:#0f1115; border:1px solid var(--line); border-radius:8px; padding:8px; margin-bottom:8px; }
#chat div { margin:2px 0; word-break:break-word; }
.badge { display:inline-block; padding:1px 8px; border-radius:10px; font-size:12px; background:var(--line); }
.badge.urgent { background:#b3372f; }
.badge.ok { background:var(--ok); }
#toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:var(--panel); border:1px solid var(--line); padding:10px 16px; border-radius:8px; display:none; z-index:50; }
.overlay { position:fixed; inset:0; background:rgba(0,0,0,.92); display:flex; align-items:center; justify-content:center; z-index:100; padding:20px; }
.overlay .card { max-width:460px; text-align:center; }


/* ---------- navigation, categories, cam grid ---------- */
.topbar { position:sticky; top:0; z-index:40; display:flex; align-items:center; gap:18px; padding:10px 22px;
  background:rgba(15,17,21,.78); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); border-bottom:1px solid var(--line); }
.brand { font-weight:800; font-size:21px; letter-spacing:.4px; background:linear-gradient(90deg,#ff5f9e,#e0457b,#ff9a5f);
  -webkit-background-clip:text; background-clip:text; color:transparent; }
.cats { display:flex; gap:6px; flex-wrap:wrap; }
.pill { padding:7px 15px; border-radius:999px; color:var(--muted); font-weight:600; border:1px solid transparent; transition:all .2s; }
.pill:hover { color:var(--text); background:rgba(255,255,255,.07); }
.pill.active { color:#fff; background:linear-gradient(135deg,#e0457b,#ff7a59); box-shadow:0 4px 16px rgba(224,69,123,.38); }
.pill.featured::before { content:"\2605  "; color:#ffc94d; }
.pill.active.featured::before { color:#fff; }
.topright { margin-left:auto; display:flex; gap:10px; align-items:center; }
.btn { display:inline-block; padding:8px 15px; border-radius:10px; font-weight:600; border:1px solid transparent; }
.btn.ghost { border-color:var(--line); color:var(--text); }
.btn.ghost:hover { background:rgba(255,255,255,.06); }
.btn.glow { background:linear-gradient(135deg,#e0457b,#ff7a59); color:#fff; box-shadow:0 4px 18px rgba(224,69,123,.42); }
.chip { padding:6px 12px; border-radius:999px; background:rgba(255,201,77,.12); color:#ffc94d; font-weight:700; font-size:13px; }
.menuwrap { position:relative; }
.avatar { width:36px; height:36px; border-radius:50%; padding:0; font-weight:800; background:linear-gradient(135deg,#6a5cff,#e0457b); }
.menu { display:none; position:absolute; right:0; top:44px; min-width:190px; background:var(--panel); border:1px solid var(--line);
  border-radius:12px; padding:6px; box-shadow:0 14px 40px rgba(0,0,0,.5); }
.menu.open { display:block; }
.menu a { display:block; padding:9px 12px; border-radius:8px; color:var(--text); }
.menu a:hover { background:rgba(255,255,255,.07); }
@media (max-width:820px) {
  .topbar { flex-wrap:wrap; gap:10px; padding:10px 14px; }
  .cats { order:3; width:100%; flex-wrap:nowrap; overflow-x:auto; padding-bottom:2px; }
  .pill { white-space:nowrap; }
}
.hero { padding:6px 0 18px; }
.hero h1 { margin:0; font-size:28px; }
.cam { position:relative; border-radius:14px; overflow:hidden; background:var(--panel); border:1px solid var(--line);
  transition:transform .2s, box-shadow .2s; display:block; color:var(--text); }
.cam:hover { transform:translateY(-4px); box-shadow:0 14px 34px rgba(0,0,0,.5); }
.cam .thumb { aspect-ratio:4/3; display:flex; align-items:center; justify-content:center; font-size:52px; font-weight:800; color:rgba(255,255,255,.92); }
.cam .meta { padding:10px 13px 13px; }
.cam .meta strong { font-size:16px; }
.tag-live { position:absolute; top:10px; left:10px; background:#d4262c; color:#fff; font-size:11px; font-weight:800; padding:3px 9px; border-radius:6px; letter-spacing:.9px; }
.tag-feat { position:absolute; top:10px; right:10px; background:#ffc94d; color:#3a2a00; font-size:11px; font-weight:800; padding:3px 9px; border-radius:6px; }
.pager { display:flex; justify-content:center; align-items:center; gap:16px; margin:28px 0 10px; }
.pager .info { color:var(--muted); font-size:14px; }
.auth-wrap { min-height:70vh; display:flex; align-items:center; justify-content:center; padding:20px; }
.auth-card { width:100%; max-width:400px; }
.auth-card h2 { margin:0 0 4px; }
.tabs { display:flex; gap:8px; margin:14px 0 4px; }
.table { width:100%; border-collapse:collapse; }
.table td { padding:6px 4px; border-bottom:1px solid var(--line); }

/* ---------- step 9: discovery ---------- */
main.wide { max-width:1500px; }
.filters { display:flex; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
.filters input { flex:1; min-width:220px; }
.filters select { width:auto; }
.tagbar, .chips { display:flex; flex-wrap:wrap; gap:6px; }
.tagbar { margin-bottom:16px; }
.tagchip { padding:3px 10px; border-radius:999px; background:rgba(255,255,255,.06); color:var(--muted); font-size:12px; font-weight:600; }
.tagchip:hover { color:var(--text); background:rgba(224,69,123,.22); }
.tagchip.on { background:var(--accent); color:#fff; }
.grid { grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); }
.cam { display:block; }
.cam-link { position:relative; display:block; color:inherit; }
.cam .thumb { position:relative; overflow:hidden; aspect-ratio:16/10; }
.cam .thumb img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.viewers { position:absolute; bottom:8px; right:8px; background:rgba(0,0,0,.65); color:#fff; font-size:12px; font-weight:700; padding:2px 8px; border-radius:6px; }
.cam .name { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.cam .subject { margin:2px 0 6px; font-size:13px; color:var(--text); opacity:.85; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cam .chips { min-height:22px; }

.stage2 { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:16px; align-items:start; }
@media (max-width:900px) { .stage2 { grid-template-columns:1fr; } }
.roomhead { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:10px; }
.roomhead h2 { margin:0; font-size:22px; }
.roomhead .sub { flex-basis:100%; color:var(--muted); }
.goal { margin:10px 0; background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:10px 14px; }
.goal .bar { height:12px; border-radius:99px; background:#0f1115; overflow:hidden; margin-top:6px; }
.goal .fill { height:100%; background:linear-gradient(90deg,#e0457b,#ffc94d); transition:width .5s; }
.goal .top { display:flex; justify-content:space-between; gap:10px; font-weight:600; }
.tipmenu { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.tipmenu button { background:rgba(255,201,77,.12); color:#ffc94d; border:1px solid rgba(255,201,77,.35); }
.tipmenu button:hover { background:rgba(255,201,77,.25); }
.heart.on { background:linear-gradient(135deg,#e0457b,#ff7a59); border-color:transparent; }
textarea.menu-edit { min-height:110px; }

/* ---------- admin panel ---------- */
.stats { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
.tile { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; color:var(--text); }
.tile b { font-size:24px; } .tile span { color:var(--muted); font-size:12px; }
a.tile:hover { border-color:var(--accent); }
.modal { width:100%; max-width:720px; text-align:left; margin:30px auto; }
.modal h4 { margin:18px 0 6px; }

.dot { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:8px; background:var(--muted); }
.dot.ok { background:var(--ok); } .dot.warn { background:var(--warn); } .dot.fail { background:#d4262c; }
.check { padding:7px 0; border-bottom:1px solid var(--line); }
.maint { background:#5a3b00; color:#ffd88a; text-align:center; padding:8px 14px; font-weight:600; }

/* ---------- admin sidebar layout ---------- */
.adminshell { display:flex; align-items:flex-start; min-height:calc(100vh - 58px); }
.adminshell > main { flex:1; min-width:0; max-width:none; margin:0; }
.sidebar { position:sticky; top:58px; width:230px; flex:none; height:calc(100vh - 58px); overflow-y:auto; padding:14px 10px;
  background:var(--panel); border-right:1px solid var(--line); }
.side-link { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; color:var(--text); font-weight:600; }
.side-link:hover { background:rgba(255,255,255,.07); }
.side-link.active { background:linear-gradient(135deg,#e0457b,#ff7a59); color:#fff; box-shadow:0 4px 16px rgba(224,69,123,.3); }
.side-link .ico { width:20px; text-align:center; }
.side-sub { display:block; padding:6px 12px 6px 42px; color:var(--muted); font-size:13px; border-radius:8px; }
.side-sub:hover { color:var(--text); background:rgba(255,255,255,.05); }
.side-sep { height:1px; background:var(--line); margin:12px 6px; }
@media (max-width:820px) {
  .adminshell { flex-direction:column; }
  .sidebar { position:static; width:100%; height:auto; display:flex; flex-wrap:nowrap; overflow-x:auto; gap:4px; padding:8px; border-right:0; border-bottom:1px solid var(--line); }
  .side-link, .side-sub { white-space:nowrap; } .side-sep { display:none; }
}
.bars { display:flex; align-items:flex-end; gap:2px; height:140px; margin:12px 0 6px; }
.bars .bar { flex:1; min-width:2px; background:linear-gradient(180deg,#ff7a59,#e0457b); border-radius:3px 3px 0 0; }
.bars .bar:hover { filter:brightness(1.3); }

#chat .tipline { color:#ffc94d; }

/* language switch */
.langsw { display:inline-flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.langbtn { background:transparent; color:var(--muted); border:0; padding:5px 9px; font-size:12px; font-weight:700; cursor:pointer; border-radius:0; }
.langbtn.on { background:var(--accent, #d4262c); color:#fff; }
