/* MAOTY — palette taken from the DJ cat logo (tools/make_logo.py) */
:root {
  --bg: #0d0d0d;          /* the cat */
  --surface: #171717;
  --surface-2: #202020;
  --border: #2e2e2e;
  --text: #f5f5f5;
  --muted: #9b9b9b;
  --orange: #ff6a00;      /* badge background */
  --acid: #e6ff00;        /* eyes + knobs */
  --pink: #ff4fa3;        /* nose + ears */
  --red: #ff2e63;         /* headphones */
  --on-accent: #0d0d0d;
  --pixel: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0 auto; max-width: 780px; padding: 0 16px 64px;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
}
h1, h2, .brand, .banner, .rank, .avg, button, .badge { font-family: var(--pixel); }
h2 {
  font-size: 1rem; margin: 0 0 .6rem; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap;
  text-transform: uppercase; letter-spacing: .08em; color: var(--acid);
}
a { color: var(--orange); text-underline-offset: 2px; }
a:hover { color: var(--acid); }
button, select, input {
  font: inherit; color: inherit; border-radius: 4px; border: 2px solid var(--border);
  background: var(--surface-2); padding: .5rem .8rem;
}
button { cursor: pointer; font-family: var(--pixel); text-transform: uppercase; letter-spacing: .05em; font-size: .85rem; }
button:hover:not(:disabled) { border-color: var(--orange); }
button:disabled, select:disabled { opacity: .4; cursor: default; }
button.primary {
  background: var(--orange); color: var(--on-accent); border-color: var(--orange); font-weight: 700;
  box-shadow: 3px 3px 0 var(--acid);
}
button.primary:hover:not(:disabled) { border-color: var(--acid); }
button.primary:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--acid); }
button.small { padding: .25rem .6rem; }
button.danger { color: var(--red); }
button.link { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 0; text-transform: none; }
input[type=search], input[type=password] { width: 100%; }
input:focus, select:focus { border-color: var(--acid); outline: none; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }

.muted { color: var(--muted); font-size: .9rem; font-weight: normal; font-family: system-ui, sans-serif; text-transform: none; letter-spacing: 0; }
.error { color: var(--red); }
.error:empty { display: none; }
.row { display: flex; justify-content: flex-end; align-items: center; gap: .9rem; margin-top: .8rem; }
.unsaved { color: var(--pink); font-family: var(--pixel); font-size: .8rem; text-transform: uppercase; }
.unsaved[hidden] { display: none; }
img.logo, img.logo-big { image-rendering: pixelated; display: block; }

/* brand */
.brand { margin: 0; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1.15; }
.year { background: var(--acid); color: var(--on-accent); padding: 0 .3em; border-radius: 3px; }

/* login */
body.login { display: grid; place-items: center; min-height: 100vh; }
.login-box {
  width: 100%; max-width: 360px; background: var(--surface); border: 2px solid var(--border);
  border-radius: 8px; padding: 28px; display: grid; gap: 1.1rem; justify-items: center; text-align: center;
  box-shadow: 6px 6px 0 var(--orange);
}
.login-box .brand { font-size: 1.25rem; }
.login-box form { display: grid; gap: .6rem; text-align: left; width: 100%; }
.login-box label { color: var(--muted); font-size: .9rem; }
.logo-big { width: 160px; height: 160px; }

/* app header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 18px 0 10px; flex-wrap: wrap; }
.brand-row { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.brand-row .brand { font-size: 1.05rem; }
.logo { width: 44px; height: 44px; flex: none; }
.who { color: var(--muted); font-size: .9rem; }
.who #me { color: var(--pink); font-weight: 600; }
.banner {
  background: var(--surface); border: 2px solid var(--border); border-left: 6px solid var(--orange);
  border-radius: 4px; padding: .6rem .9rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em;
}
section { margin: 1.8rem 0; }

/* how it works */
.howto { margin-top: .8rem; background: var(--surface); border: 2px solid var(--border); border-radius: 6px; padding: .2rem .9rem; }
.howto[open] { padding-bottom: .9rem; }
.howto > summary {
  cursor: pointer; padding: .6rem 0; font-family: var(--pixel); text-transform: uppercase;
  letter-spacing: .08em; color: var(--acid); font-size: .9rem; font-weight: 700;
}
.steps { list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .6rem; }
.steps > li { border: 2px solid var(--border); border-radius: 6px; padding: .6rem .8rem; background: var(--surface-2); }
.steps > li.current { border-color: var(--orange); box-shadow: 3px 3px 0 var(--acid); }
.step-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.step-num {
  display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 3px;
  background: var(--orange); color: var(--on-accent); font-family: var(--pixel); font-weight: 800;
}
.step-title { font-family: var(--pixel); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.step-when { color: var(--muted); font-size: .82rem; margin-left: auto; }
.steps ul { margin: 0; padding-left: 1.1rem; color: #d6d6d6; font-size: .92rem; }
.steps ul li { margin: .15rem 0; }
.howto-foot { margin: .8rem 0 0; color: var(--muted); font-size: .85rem; }
@media (max-width: 480px) { .step-when { margin-left: 0; width: 100%; } }

/* album cards */
.albums { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .5rem; }
.album {
  display: grid; grid-template-columns: 64px 1fr auto; gap: .8rem; align-items: center;
  background: var(--surface); border: 2px solid var(--border); border-radius: 6px; padding: .55rem;
}
.album:hover { border-color: #3d3d3d; }
.album.ineligible { opacity: .5; }
li.empty { display: block; color: var(--muted); padding: .7rem; background: none; border: 2px dashed var(--border); border-radius: 6px; }
.cover { width: 64px; height: 64px; border-radius: 3px; object-fit: cover; background: var(--surface-2); display: block; }
.info { min-width: 0; }
.title { font-weight: 700; overflow-wrap: anywhere; }
.artist { overflow-wrap: anywhere; color: #d6d6d6; }
.date { color: var(--muted); font-size: .85rem; }
.links { display: flex; flex-wrap: wrap; gap: .2rem .8rem; font-size: .85rem; margin-top: .2rem; }
.actions { display: flex; gap: .4rem; align-items: center; }
.problem { font-size: .8rem; color: var(--red); max-width: 9rem; text-align: right; }
.badge {
  font-size: .7rem; color: var(--on-accent); background: var(--pink); border-radius: 3px;
  padding: .15rem .45rem; white-space: nowrap; text-transform: uppercase; letter-spacing: .05em;
}
select { min-width: 4.8rem; font-family: var(--pixel); }
select.saved { border-color: var(--acid); box-shadow: 0 0 0 2px var(--acid); }
.search-results { margin-top: .6rem; }
details.bandcamp { margin-top: 1rem; }
details.bandcamp summary { font-size: .9rem; color: var(--orange); }
.bc-row { display: flex; gap: .5rem; margin-top: .6rem; }
.bc-row input { flex: 1; min-width: 0; }

/* results */
.results .album { grid-template-columns: 2.6rem 64px 1fr auto; }
.rank { font-weight: 800; color: var(--muted); text-align: center; font-size: 1.05rem; }
.avg { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--orange); }
.avg.dim { color: var(--muted); font-size: 1.1rem; }
.badge.unranked { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); display: inline-block; margin: .2rem 0; }
.winner { border-color: var(--acid); box-shadow: 4px 4px 0 var(--pink); }
.winner .rank, .winner .avg { color: var(--acid); }
details summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.votes {
  list-style: none; padding: 0; margin: .3rem 0 0; font-size: .9rem; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .1rem 1rem;
}
.votes li { display: flex; justify-content: space-between; gap: .5rem; }
.votes b { color: var(--acid); font-family: var(--pixel); }

/* home overview panels */
.overview { display: grid; grid-template-columns: 1.6fr 1fr; gap: .8rem; }
.overview.single { grid-template-columns: 1fr; }
.panel { background: var(--surface); border: 2px solid var(--border); border-radius: 6px; padding: .8rem; min-width: 0; }
.panel h2 { margin-bottom: .5rem; }
.scroll {
  list-style: none; margin: 0; padding: 0 .3rem 0 0; max-height: 300px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--orange) var(--surface-2); overscroll-behavior: contain;
}
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-track { background: var(--surface-2); }
.scroll::-webkit-scrollbar-thumb { background: var(--orange); }
.mini-albums li:not(.empty) {
  display: grid; grid-template-columns: 40px 1fr; gap: .6rem; align-items: center;
  padding: .4rem 0; border-bottom: 1px solid var(--border);
}
.mini-albums li:last-child { border-bottom: 0; }
.mini-albums .cover { width: 40px; height: 40px; }
.mini-albums .title { font-size: .92rem; }
.mini-albums .artist { font-size: .85rem; }
.mini-albums .links { font-size: .75rem; }
.suggested-by { font-size: .78rem; color: var(--muted); }
.suggested-by b { color: var(--acid); font-weight: 600; }
.suggested-by b.me { color: var(--pink); }
.people li {
  display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .2rem;
  border-bottom: 1px solid var(--border); font-size: .92rem;
}
.people li:last-child { border-bottom: 0; }
.people .status { color: var(--muted); font-family: var(--pixel); font-size: .78rem; white-space: nowrap; }
.people li.done .status { color: var(--acid); }
.people li.me .name { color: var(--pink); font-weight: 700; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(200%);
  background: var(--acid); color: var(--on-accent); padding: .6rem 1rem; border-radius: 4px;
  font-family: var(--pixel); font-weight: 700; transition: transform .2s, visibility .2s; max-width: calc(100% - 32px);
  box-shadow: 3px 3px 0 var(--orange); visibility: hidden;
}
.toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }
.toast.error { background: var(--red); color: #fff; box-shadow: 3px 3px 0 var(--on-accent); }

@media (max-width: 640px) {
  .overview { grid-template-columns: 1fr; }
  .scroll { max-height: 240px; }
}
@media (max-width: 480px) {
  .brand-row .brand { font-size: .9rem; }
  .album { grid-template-columns: 52px 1fr; }
  .cover { width: 52px; height: 52px; }
  .album .actions { grid-column: 1 / -1; justify-content: flex-end; }
  .results .album { grid-template-columns: 2rem 52px 1fr; }
  .results .avg { grid-column: 3; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
