:root {
  --cream: #f4f1ea;
  --paper: #ffffff;
  --ink: #0b0b0b;
  --ink-soft: #4a4a48;
  --pink: #ff90e8;
  --pink-deep: #ff4fd8;
  --yellow: #ffc900;
  --border: #0b0b0b;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 132px;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Top bar ---------- */
.topbar { border-bottom: 2px solid var(--ink); background: var(--pink); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand .dot { width: 26px; height: 26px; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); display: grid; place-items: center; font-size: 14px; }
.top-actions { display: flex; gap: 10px; }

.btn {
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  font-weight: 700; font-size: 14px; padding: 9px 14px; border-radius: 10px;
  box-shadow: var(--shadow); transition: transform .06s ease, box-shadow .06s ease;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--yellow); }
.btn.ghost { box-shadow: none; background: transparent; }
.btn.small { padding: 6px 10px; font-size: 13px; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 28px; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 16px; font-weight: 800; }
.hero h1 .mark { background: var(--yellow); padding: 0 8px; border: 2px solid var(--ink); border-radius: 8px; box-shadow: var(--shadow); display: inline-block; }
.hero p { font-size: 18px; color: var(--ink-soft); max-width: 640px; margin: 0 0 20px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pill { border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 13px; box-shadow: 3px 3px 0 var(--ink); }

/* ---------- Filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 8px 0 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 6px 13px; font-weight: 700; font-size: 13px; }
.chip.active { background: var(--ink); color: #fff; }
.search { border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); padding: 9px 12px; font-size: 14px; font-weight: 600; min-width: 200px; box-shadow: var(--shadow); }
.search:focus { outline: none; box-shadow: 5px 5px 0 var(--ink); }

/* ---------- Grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; padding-bottom: 40px; }
.card { border: 2px solid var(--ink); background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .08s ease, box-shadow .08s ease; display: flex; flex-direction: column; }
.card:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-lg); }
.card.playing { box-shadow: 6px 6px 0 var(--pink-deep); border-color: var(--pink-deep); }
.cover { position: relative; aspect-ratio: 1 / 1; border-bottom: 2px solid var(--ink); display: grid; place-items: center; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .initials { font-size: 46px; font-weight: 800; color: rgba(0,0,0,0.85); }
.play-fab { position: absolute; right: 12px; bottom: 12px; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--ink); background: var(--yellow); display: grid; place-items: center; font-size: 20px; box-shadow: 3px 3px 0 var(--ink); transition: transform .06s ease; }
.card:hover .play-fab { transform: scale(1.06); }
.card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.card-artist { color: var(--ink-soft); font-weight: 600; font-size: 14px; }
.card-note { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 11px; font-weight: 700; border: 1.5px solid var(--ink); border-radius: 999px; padding: 2px 8px; background: var(--cream); }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.card-foot a.link { font-size: 13px; font-weight: 700; text-decoration: underline; }
.del-btn { border: none; background: transparent; font-size: 13px; font-weight: 700; color: var(--pink-deep); cursor: pointer; text-decoration: underline; }

.empty { border: 2px dashed var(--ink); border-radius: var(--radius); padding: 48px 24px; text-align: center; color: var(--ink-soft); grid-column: 1 / -1; background: var(--paper); }

/* ---------- Docked player ---------- */
.player { position: fixed; left: 0; right: 0; bottom: 0; border-top: 2px solid var(--ink); background: var(--paper); z-index: 40; box-shadow: 0 -4px 0 rgba(0,0,0,0.06); }
.player .wrap { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; min-height: 108px; padding-top: 12px; padding-bottom: 12px; }
.ctrl { border: 2px solid var(--ink); background: var(--paper); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; box-shadow: 2px 2px 0 var(--ink); flex: none; }
.ctrl:hover { transform: translate(-1px,-1px); }
.ctrl:active { transform: translate(2px,2px); box-shadow: 0 0 0 var(--ink); }
.embed-host { width: 100%; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--cream); min-height: 84px; display: flex; align-items: center; }
.embed-host iframe { display: block; }
.embed-empty { padding: 0 18px; font-weight: 700; color: var(--ink-soft); font-size: 15px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11,11,11,0.45); display: none; align-items: flex-start; justify-content: center; z-index: 60; padding: 40px 16px; overflow-y: auto; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 2px solid var(--ink); }
.modal-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 13px; }
.field input, .field textarea { border: 2px solid var(--ink); border-radius: 9px; padding: 10px 12px; font-size: 14px; font-family: inherit; font-weight: 600; background: var(--cream); }
.field input:focus, .field textarea:focus { outline: none; background: #fff; }
.field .hint { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.modal-foot { padding: 16px 20px; border-top: 2px solid var(--ink); display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.foot-left, .foot-right { display: flex; gap: 10px; flex-wrap: wrap; }
.close-x { border: 2px solid var(--ink); background: var(--paper); width: 34px; height: 34px; border-radius: 8px; font-weight: 800; box-shadow: 2px 2px 0 var(--ink); }
.banner { background: var(--yellow); border: 2px solid var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 600; margin: 0 0 4px; }

footer.site { border-top: 2px solid var(--ink); margin-top: 10px; padding: 26px 0; color: var(--ink-soft); font-size: 14px; }
footer.site .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .hero { padding: 36px 0 20px; }
  .player .wrap { gap: 10px; }
  .ctrl { width: 42px; height: 42px; }
}

/* ---------- Dark theme ---------- */
body.dark {
  --cream: #15151c;
  --paper: #1f1f29;
  --ink: #f2efe6;
  --ink-soft: #a6a6b0;
  --border: #f2efe6;
}
body.dark .chip.active { color: #15151c; }
body.dark .hero h1 .mark,
body.dark .btn.primary,
body.dark .banner,
body.dark .play-fab,
body.dark .brand { color: #15151c; }
body.dark .field input:focus,
body.dark .field textarea:focus { background: var(--paper); color: var(--ink); }
body.dark .cover .initials { color: rgba(0,0,0,0.85); }
