:root{
  --bg1:#ffb7ee; --bg2:#caa6ff; --bg3:#a6e4ff;
  --panel:#0f1020; --panel2:#191a2f; --text:#161a2f; --muted:#51557b;
  --rose:#ff66cc; --cyan:#57d8ff;
  --dark:#0b0d13; --border-dark:rgba(255,255,255,.18); --border:rgba(0,0,0,.12);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; color:var(--text); font:500 16px/1.5 ui-sans-serif,system-ui,Inter,Segoe UI,Arial;
  background:
    radial-gradient(1100px 800px at -10% -10%, rgba(255,102,204,.35), transparent 60%),
    radial-gradient(1100px 800px at 110% 110%, rgba(114,211,255,.35), transparent 60%),
    linear-gradient(120deg, #ffe5f8 0%, #efe3ff 35%, #e3f5ff 70%, #ffeef9 100%);
  overflow-x:hidden;
}
a{color:inherit}

header{
  position:sticky; top:0; z-index:20; backdrop-filter: blur(12px);
  background:linear-gradient(to bottom, rgba(255,255,255,.65), rgba(255,255,255,.2));
  border-bottom:1px solid var(--border);
}
.wrap{max-width:1240px; margin:0 auto; padding:14px 20px}
.top{display:flex; align-items:center; gap:12px}
.brand{display:flex; align-items:center; gap:10px}
.brand img{width:40px; height:40px; border-radius:10px; box-shadow:0 0 18px rgba(255,255,255,.55)}
h1{font-size:20px; margin:0; letter-spacing:.2px}
.badge{
  margin-left:auto; padding:6px 10px; border-radius:999px; font-size:12px; font-weight:800;
  color:#fff; background:linear-gradient(135deg, var(--rose), var(--cyan));
  box-shadow:0 0 22px rgba(255,255,255,.35);
}

.actions{display:flex; gap:10px; margin-left:10px}
button.ghost{
  padding:10px 12px; border-radius:12px; border:1px solid var(--border);
  background:linear-gradient(135deg, rgba(255,102,204,.18), rgba(95,209,255,.18));
  color:#121322; cursor:pointer; font-weight:700;
}

.search{
  margin-top:10px; display:flex; gap:10px; align-items:center
}
.search input{
  flex:1; padding:12px 14px; border-radius:14px; border:1px solid var(--border);
  background:#ffffffd9; color:#111; outline:none;
}
.search button{
  padding:10px 14px; border-radius:14px; border:1px solid var(--border);
  background:linear-gradient(135deg, rgba(255,102,204,.2), rgba(95,209,255,.2));
  color:#111; cursor:pointer
}

.grid{
  max-width:1240px; margin:20px auto 80px; padding:0 20px;
  display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:16px;
}
.card{
  background:#ffffffcc; backdrop-filter: blur(4px);
  border:1px solid var(--border); border-radius:18px; padding:14px; position:relative;
  transition:transform .14s ease, box-shadow .14s ease; cursor:pointer; box-shadow:0 12px 46px rgba(0,0,0,.15);
}
.card:hover{ transform:translateY(-3px) }
.card .thumb{
  height:130px; border-radius:12px; background:
    linear-gradient(135deg, rgba(255,102,204,.35), rgba(95,209,255,.35));
  display:flex; align-items:center; justify-content:center; font-weight:800; letter-spacing:.6px;
  text-align:center; padding:8px; color:#ffffffd9; text-shadow:0 2px 14px rgba(0,0,0,.25);
}
.card h3{margin:10px 4px 0; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#121322}
.card .meta{margin:6px 4px 0; font-size:12px; color:#4b4f6a}

.corner-label{
  position:fixed; right:14px; bottom:14px; z-index:20; padding:8px 12px; border-radius:999px;
  border:1px solid rgba(255,255,255,.5);
  color:#fff; font-weight:800; letter-spacing:.3px;
  background:linear-gradient(135deg, var(--rose), var(--cyan));
  box-shadow:0 0 30px rgba(255,255,255,.45), 0 6px 30px rgba(0,0,0,.25);
  animation:glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse{
  0%{ filter:drop-shadow(0 0 8px rgba(255,102,204,.7)); }
  50%{ filter:drop-shadow(0 0 16px rgba(95,209,255,.85)); }
  100%{ filter:drop-shadow(0 0 8px rgba(255,102,204,.7)); }
}

.viewer{ position:fixed; inset:0; display:none; z-index:30 }
.viewer.open{ display:block }
.viewer .veil{
  position:absolute; inset:0; backdrop-filter: blur(10px);
  background:rgba(255,255,255,.25);
  opacity:0; animation:veilIn .35s ease forwards;
}
@keyframes veilIn{ to{ opacity:1 } }

.playerWrap{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding:24px;
}
.player{
  width:min(1280px,96%); height:min(820px,90%);
  background:var(--dark); border-radius:20px; overflow:hidden;
  border:1px solid var(--border-dark); box-shadow:0 24px 80px rgba(0,0,0,.45);
  transform:translateY(24px) scale(.98); opacity:0;
  animation:playerIn .35s cubic-bezier(.2,.8,.2,1) forwards;
  display:flex; flex-direction:column;
}
@keyframes playerIn{
  to{ transform:translateY(0) scale(1); opacity:1 }
}
.player .bar{
  display:flex; gap:10px; align-items:center; padding:10px; background:linear-gradient(180deg, #121428, #0f1020);
  border-bottom:1px solid rgba(255,255,255,.08); color:#dbe0ff
}
.player .bar .title{flex:1; text-align:center}
.player .bar .title h2{margin:0; font-size:16px; letter-spacing:.3px}
.player .bar .left, .player .bar .right{display:flex; gap:8px; align-items:center}
button.ui{
  border:1px solid rgba(255,255,255,.18); background:linear-gradient(135deg, rgba(255,102,204,.18), rgba(95,209,255,.18));
  color:#fff; border-radius:12px; padding:8px 12px; cursor:pointer; box-shadow:0 6px 20px rgba(0,0,0,.25);
}

.content{
  display:grid; grid-template-rows: 1fr auto; height:100%;
}
.player iframe{ width:100%; height:100%; border:0; background:#000 }

/* comments drawer */
.comments{
  border-top:1px solid rgba(255,255,255,.1);
  background:#0e1020; color:#e7ebff; max-height:44%; overflow:auto; padding:12px 12px 16px;
}
.comment-row{padding:10px 12px; border:1px solid rgba(255,255,255,.15); border-radius:12px; margin:8px 0;
  background:linear-gradient(135deg, rgba(255,102,204,.12), rgba(95,209,255,.12));}
.comment-row .meta{font-size:12px; opacity:.8; margin-bottom:6px}
.comment-row .text{white-space:pre-wrap}

.form{display:flex; gap:8px; margin-top:8px}
.form input, .form textarea{
  flex:1; padding:10px 12px; border-radius:12px; border:1px solid rgba(255,255,255,.15);
  background:#0f1226; color:#fff; outline:none; resize:vertical;
}
.form button{white-space:nowrap}

/* Modal */
.modal{position:fixed; inset:0; display:none; z-index:40}
.modal.open{display:block}
.modal .shade{position:absolute; inset:0; background:rgba(0,0,0,.45); backdrop-filter: blur(4px)}
.modal .sheet{
  position:absolute; right:12px; top:70px; width:360px; max-width:95vw;
  background:#ffffff; border:1px solid var(--border); border-radius:16px; padding:14px; box-shadow:0 16px 60px rgba(0,0,0,.25);
}
.sheet h3{margin:0 0 10px 0; color:#111}
.sheet label{font-size:12px; color:#333}
.sheet input[type="text"]{width:100%; padding:10px 12px; border-radius:12px; border:1px solid var(--border); margin-top:6px; margin-bottom:10px}
.sheet input[type="file"]{width:100%; margin:6px 0 10px}
.sheet .row{display:flex; gap:8px}
.sheet .row > *{flex:1}
.sheet button{padding:10px 12px; border-radius:12px; border:1px solid var(--border); cursor:pointer; font-weight:700}