/* MUNO — cinema dark + muno red */
:root {
  --bg: #0b0f14;
  --bg-2: #0f151c;
  --card: #161b22;
  --card-2: #1c232c;
  --line: #21262d;
  --red: #e11d48;
  --red-2: #f43f5e;
  --text: #e6edf3;
  --muted: #7d8590;
  --green: #3fb950;
  --gold: #d29922;
  --radius: 12px;
  --max: 1240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ---------------------------------------------------------------- top bar */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 17px;
  white-space: nowrap;
}

.brand .logo {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--red), #a30f33);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.brand .tag {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search {
  display: flex;
  flex: 1;
  max-width: 460px;
  margin-left: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.search input {
  flex: 1;
  padding: 9px 14px;
  background: transparent;
  border: 0;
  color: var(--text);
  outline: none;
  font-size: 14px;
}
.search input::placeholder { color: var(--muted); }
.search button {
  padding: 0 15px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 17px;
}
.search:focus-within { border-color: var(--red); }
.search:focus-within button { color: var(--red-2); }

/* ------------------------------------------------------------------ chips */
.chips {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: 0.15s;
}
.chip:hover { color: var(--text); border-color: #30363d; }
.chip.on {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ------------------------------------------------------------------- main */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4px 16px 40px;
}

.shelf { margin-top: 26px; }

.shelf-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.shelf-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.shelf-head .count { color: var(--muted); font-size: 12px; }
.shelf-head a { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 600; }
.shelf-head a:hover { color: var(--red-2); }

.row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 132px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.row::-webkit-scrollbar { display: none; }
.row .card { scroll-snap-align: start; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

/* ------------------------------------------------------------------- card */
.card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.16s, border-color 0.16s;
}
.card:hover { transform: translateY(-3px); border-color: #3a424c; }

.card .poster {
  position: relative;
  aspect-ratio: 2 / 3;
  background: linear-gradient(160deg, #1b222b, #12171d);
  overflow: hidden;
}
.card .poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s;
}
.card .poster img.loaded { opacity: 1; }
.card .poster .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #2c333d;
  font-size: 26px;
  font-weight: 900;
}

.card .badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(225, 29, 72, 0.94);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card .body { padding: 8px 9px 10px; }
.card .title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.card .sub {
  margin-top: 5px;
  display: flex;
  gap: 6px;
  color: var(--muted);
  font-size: 10.5px;
}

/* --------------------------------------------------------------- skeleton */
.sk { border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); }
.sk .p { aspect-ratio: 2 / 3; }
.sk .t { height: 10px; margin: 10px 9px; border-radius: 4px; width: 70%; }
.sk .p, .sk .t {
  background: linear-gradient(90deg, #161b22 25%, #1f2732 50%, #161b22 75%);
  background-size: 200% 100%;
  animation: shim 1.2s infinite;
}
@keyframes shim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ----------------------------------------------------------------- status */
.status {
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.status.error { color: #f85149; }

.more {
  display: block;
  margin: 26px auto 0;
  padding: 11px 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}
.more:hover { border-color: var(--red); color: var(--red-2); }

/* ----------------------------------------------------------------- dialog */
dialog#player {
  width: min(980px, 96vw);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
  color: var(--text);
  overflow: hidden;
}
dialog#player::backdrop { background: rgba(0, 0, 0, 0.82); backdrop-filter: blur(3px); }

dialog .bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
dialog .bar h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
dialog .bar button {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
}
dialog .bar button:hover { color: var(--text); border-color: #3a424c; }

dialog video {
  display: block;
  width: 100%;
  max-height: 62vh;
  background: #000;
}

dialog .meta { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 14px 0; }

.pill {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.pill.red { background: rgba(225, 29, 72, 0.15); border-color: rgba(225, 29, 72, 0.5); color: #ff8098; }

dialog .actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--red);
}
.btn:hover { background: var(--red-2); border-color: var(--red-2); }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.ghost:hover { color: var(--text); border-color: #3a424c; }

dialog .desc {
  margin: 0;
  padding: 0 14px 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

/* ----------------------------------------------------------------- footer */
footer {
  padding: 26px 16px 40px;
  text-align: center;
  color: #4d5560;
  font-size: 12px;
  border-top: 1px solid var(--line);
}
footer a { color: var(--muted); }
footer a:hover { color: var(--red-2); }

/* ------------------------------------------------------------- responsive */
@media (max-width: 520px) {
  .brand .tag { display: none; }
  .row { grid-auto-columns: 118px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 11px; }
  dialog .bar h2 { font-size: 13px; }
}
