:root {
  --bg: #0b0d12;
  --panel: #141926;
  --panel-2: #1b2233;
  --text: #e7ebf3;
  --muted: #95a1b8;
  --line: #29324a;
  --accent: #77a8ff;
  --accent-2: #61d7c8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top right, #172138 0%, var(--bg) 45%);
  color: var(--text);
}
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11,13,18,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 44px; height: 44px; border-radius: 10px; }
.brand h1 { margin: 0; font-size: 1rem; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.controls { display:flex; gap:8px; align-items:center; }
.controls input {
  width: clamp(140px, 30vw, 220px); border: 1px solid var(--line); background: var(--panel);
  color: var(--text); border-radius: 10px; padding: 10px 12px;
}
main { max-width: 1240px; margin: 0 auto; padding: 20px; }
.hero { background: linear-gradient(160deg, #10182b, #0e1320); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 20px; }
.hero h2 { margin: 0 0 8px; }
.hero p { margin: 0; color: var(--muted); }
.chips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.chip.active { border-color: var(--accent); color: var(--accent); }
.menu-select-wrap { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.menu-label { color: var(--muted); font-size: .9rem; }
.menu-select { min-width: 260px; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 10px; padding: 8px 10px; }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin: 18px 0 12px; }
h3 { margin: 0; }
.btn {
  border: 1px solid #29324a;
  background: #141926;
  color: #e7ebf3;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.btn:hover { border-color: #3a486a; }
.back-inline { min-width: 90px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card-grid.list-mode { display:block; }
@media (max-width: 1600px) {
  .card-grid { grid-template-columns: repeat(auto-fill, 275px); justify-content: center; }
}
.card-grid.audio-mode { display:block; }
.audio-section { margin-bottom: 14px; }
.audio-section-title { margin: 0 0 8px; color: var(--accent); font-size: .92rem; }
.audio-section-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.audio-section-grid.audio-two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1600px) {
  .audio-section-grid:not(.audio-two-col) { grid-template-columns: repeat(auto-fill, 275px); justify-content: center; }
}
.simple-file-list { border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--panel); max-width: 980px; }
.simple-file-group { padding:8px 12px; font-size:.86rem; color:var(--accent); background:#101722; border-top:1px solid #29324a; border-bottom:1px solid #29324a; }
.simple-file-group:first-child { border-top:none; }
.simple-file-link { display:flex; align-items:center; gap:10px; padding:10px 12px; color:var(--text); text-decoration:none; border-bottom:1px solid #29324a; }
.file-ico { width: 20px; text-align:center; opacity:.95; }
.file-label { min-width: 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.simple-file-link:last-child { border-bottom:none; }
.simple-file-link:hover { background:#1b2233; color:var(--accent); }
.card.audio-card { height: 64px; min-height: 64px; }
.card.audio-card .meta { padding: 10px 12px; height: 100%; }
.card.audio-card .title { margin-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.audio-card .desc { display:none; }
.card.audio-card img { display:none; }
.audio-meta-row { display:grid; grid-template-columns: 18px minmax(0,1fr); align-items:center; column-gap:10px; }
.audio-meta-row .title { margin:0; }
.audio-file-ico { display:inline-flex; align-items:center; justify-content:center; width:18px; opacity:.95; }

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .15s ease, border-color .15s ease;
  height: 248px;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card img { width: 100%; aspect-ratio: 230 / 156; height: auto; object-fit: cover; background: #0f1320; }
.card .meta { padding: 8px 10px 9px; height: 92px; overflow: hidden; }
.card .title { font-weight: 600; margin-bottom: 2px; font-size: .94rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .desc { color: var(--muted); font-size: .8rem; line-height: 1.25; max-height: 40px; overflow: hidden; }
.card .tags { display: none; }
.card .tag { display: none; }
footer { text-align: center; color: var(--muted); padding: 20px; border-top: 1px solid var(--line); margin-top: 24px; }
.hidden { display:none; }
.frame { width: 100%; min-height: 70vh; border: 1px solid var(--line); border-radius: 12px; background: #0a0f18; }
.upload-box { background: var(--panel); border:1px solid var(--line); border-radius:12px; padding:16px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.upload-box button { background: var(--accent); color:#0b1320; border:none; border-radius:8px; padding:10px 16px; font-weight:600; cursor:pointer; }
#uploadStatus { color: var(--muted); font-size:.9rem; }
.login-modal { position: fixed; inset:0; background: rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; z-index: 30; }
.login-modal.hidden { display:none !important; }
.login-card { width: min(380px, 92vw); background: #141926; border:1px solid #29324a; border-radius:12px; padding:14px; }
.login-card input { width:100%; margin-bottom:8px; border:1px solid #29324a; background:#101722; color:#e7ebf3; border-radius:8px; padding:9px 10px; }
.remember-line { display:flex; align-items:center; gap:8px; color:#95a1b8; font-size:.9rem; margin:2px 0 8px; }
.remember-line input { width:auto; margin:0; }
.login-actions { display:flex; gap:8px; justify-content:flex-end; }
.login-error { color:#ff8d8d; min-height: 18px; font-size:.85rem; margin: 2px 0 8px; }
@media (max-width: 700px) {
  .topbar { padding: 10px; }
  .controls input { width: clamp(90px, 34vw, 150px); }
  .audio-section-grid.audio-two-col { grid-template-columns: 1fr; }
}