/* Album Wars: fight-card look. Paper-white, black ink, blue corner vs. red corner. */
:root {
  --paper: #eef0f4;
  --card: #ffffff;
  --ink: #0b0b10;
  --ink-2: #4a4d57;
  --line: #0b0b10;
  --soft: #d9dce3;
  --blue: #1d3cff;
  --red: #ff1f4f;
  --volt: #d7ff2e;
  --ok: #00a86b;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --body: 'Space Grotesk', system-ui, -apple-system, Segoe UI, sans-serif;
  --mono: 'Space Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--blue); }
button { font: inherit; cursor: pointer; }
img { display: block; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--ink); color: #fff;
  position: sticky; top: 0; z-index: 5;
}
.logo {
  font-family: var(--display); font-size: 26px; letter-spacing: .03em; line-height: 1;
  color: #fff; text-decoration: none; text-transform: uppercase;
}
.logo span { color: var(--volt); margin-left: 6px; }
nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
nav a, nav .link {
  color: #c9ccd6; text-decoration: none; padding: 6px 12px; border-radius: 0;
  background: none; border: 0; font-weight: 600; text-transform: uppercase; font-size: 13px; letter-spacing: .08em;
}
nav a:hover, nav .link:hover { color: #fff; }
nav a.active { color: var(--ink); background: var(--volt); }

main { max-width: 1040px; margin: 0 auto; padding: 36px 20px 80px; }
.loading { color: var(--ink-2); text-align: center; margin-top: 80px; font-family: var(--mono); }
h1, h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: 1; }
h1 { font-size: clamp(36px, 6vw, 60px); margin: 0 0 10px; }
h2 { font-size: 28px; margin: 44px 0 14px; }
.sub { color: var(--ink-2); margin: 0 0 28px; max-width: 62ch; }

/* ---------- buttons & inputs ---------- */
.btn {
  border: 2px solid var(--ink); border-radius: 0; padding: 10px 20px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; font-size: 14px;
  background: var(--blue); color: #fff; box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .08s ease;
  text-decoration: none; display: inline-block;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.ghost { background: var(--card); color: var(--ink); }
.btn.small { padding: 5px 12px; font-size: 12px; }
.link { background: none; border: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.link:hover { color: var(--ink); }
input[type=email], input[type=search] {
  width: 100%; padding: 12px 16px; border-radius: 0; border: 2px solid var(--ink);
  background: var(--card); color: var(--ink); font: inherit;
}
input:focus { outline: 3px solid var(--volt); outline-offset: 0; box-shadow: var(--shadow-sm); }
.row { display: flex; gap: 10px; }
.row input { flex: 1; }

/* ---------- login ---------- */
.login { max-width: 460px; margin: 40px auto; text-align: center; }
.login h1 { font-size: clamp(64px, 14vw, 110px); line-height: .9; }
.login h1 span {
  display: block; color: var(--ink); background: var(--volt);
  border: 3px solid var(--ink); box-shadow: var(--shadow); padding: 4px 0 8px; margin: 8px 0 22px;
}
.login form { margin-top: 28px; display: grid; gap: 12px; }
.note { color: var(--ink-2); font-size: 14px; }

/* ---------- battle ---------- */
.arena {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 22px;
}
.vs {
  font-family: var(--display); font-size: 34px; color: var(--ink); line-height: 1;
  width: 70px; height: 70px; display: grid; place-items: center;
  background: var(--volt); border: 3px solid var(--ink); box-shadow: var(--shadow-sm);
  transform: rotate(-8deg);
}
.contender { display: grid; gap: 8px; justify-items: center; }
.arena > .contender::before {
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .14em;
  color: #fff; padding: 3px 10px; justify-self: start;
}
.arena > .contender:first-child::before { content: 'BLUE CORNER'; background: var(--blue); }
.arena > .contender:last-child::before { content: 'RED CORNER'; background: var(--red); }
.pick {
  width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left;
  transition: transform .1s ease;
}
.pick .cover { border: 3px solid var(--ink); box-shadow: var(--shadow); }
.pick:hover { transform: translate(-3px, -3px); }
.arena > .contender:first-child .pick:hover .cover { box-shadow: 8px 8px 0 var(--blue); }
.arena > .contender:last-child .pick:hover .cover { box-shadow: 8px 8px 0 var(--red); }
.pick:focus-visible { outline: 4px solid var(--volt); outline-offset: 4px; }
.pick.won .cover { box-shadow: 8px 8px 0 var(--volt), 8px 8px 0 3px var(--ink); }
.pick.won .meta .title { background: var(--volt); }
.pick.lost { opacity: .3; filter: grayscale(1); }
.cover {
  width: 100%; aspect-ratio: 1; overflow: hidden;
  background: var(--soft); position: relative;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .fallback {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; text-align: center;
  font-family: var(--display); text-transform: uppercase; font-size: clamp(20px, 3.4vw, 34px); line-height: 1.05;
  color: var(--ink);
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(11,11,16,.06) 14px 28px),
    var(--soft);
}
.meta { padding: 14px 2px 0; width: 100%; }
.meta .title { font-weight: 700; font-size: 19px; line-height: 1.2; display: inline; padding: 0 2px; }
.meta .artist { color: var(--ink-2); margin-top: 2px; }
.battle-footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-top: 30px; padding-top: 16px; border-top: 2px solid var(--ink);
  color: var(--ink-2); font-size: 14px; font-family: var(--mono);
}
.kbd { border: 2px solid var(--ink); background: var(--card); padding: 0 6px; font-size: 12px; color: var(--ink); }

/* ---------- listen menu + wikipedia links ---------- */
.links { display: flex; gap: 14px; align-items: center; font-size: 13px; font-weight: 600; margin-top: 4px; }
.links a, .links summary { color: var(--blue); text-decoration: none; cursor: pointer; white-space: nowrap; }
.links { flex-wrap: wrap; row-gap: 6px; }
.links a:hover, .links summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.listen { position: relative; }
.listen summary { list-style: none; user-select: none; }
.listen summary::-webkit-details-marker { display: none; }
.listen .menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 160px;
  background: var(--card); border: 2px solid var(--ink); box-shadow: var(--shadow-sm);
  display: grid;
}
.listen .menu a { padding: 8px 12px; color: var(--ink); font-weight: 600; }
.listen .menu a + a { border-top: 1px solid var(--soft); }
.listen .menu a:hover { background: var(--volt); text-decoration: none; }
.contender-actions { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 10px; flex-wrap: wrap; }
.contender-actions .links { margin-top: 0; }
.top10 li:first-child .links a, .top10 li:first-child .links summary { color: var(--ink); }

/* ---------- undo ---------- */
.footer-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.undo { background: var(--volt); }

/* ---------- focus mode ---------- */
.focus-link { color: var(--ink) !important; background: var(--volt); padding: 1px 6px; border: 1px solid var(--ink); }
.focus-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--ink); color: #fff; padding: 10px 14px; margin: -8px 0 22px;
  font-family: var(--mono); font-size: 14px; box-shadow: 4px 4px 0 var(--volt);
}
.focus-label { background: var(--volt); color: var(--ink); font-weight: 700; padding: 1px 8px; letter-spacing: .12em; }
.focus-title { font-family: var(--body); font-weight: 700; font-size: 16px; }
.focus-count { margin-left: auto; }
.focus-score { color: var(--volt); font-weight: 700; }
.focus-bar .link { color: #c9ccd6; }
.focus-bar .link:hover { color: #fff; }
.arena > .contender.focused .pick .cover { box-shadow: 8px 8px 0 var(--volt), 8px 8px 0 3px var(--ink); }
.focus-result {
  display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center;
  background: var(--card); border: 2px solid var(--ink); box-shadow: var(--shadow); padding: 18px; max-width: 640px;
}
.focus-result .cover { border: 2px solid var(--ink); }
.focus-result .title { font-weight: 700; font-size: 22px; line-height: 1.2; }
.focus-result .info { color: var(--ink-2); }
.focus-record { font-family: var(--display); font-size: 56px; line-height: 1; margin: 12px 0 4px; }
.focus-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* ---------- add albums & browse ---------- */
.results { display: grid; gap: 12px; margin-top: 18px; }
.result {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  background: var(--card); border: 2px solid var(--ink); box-shadow: var(--shadow-sm); padding: 10px;
}
.result .cover { border: 2px solid var(--ink); }
.result .cover .fallback, .top10 .cover .fallback { font-size: 11px; padding: 4px; overflow-wrap: anywhere; line-height: 1.1; }
.result .title { font-weight: 700; }
.result .info { color: var(--ink-2); font-size: 14px; }
.in-pool { color: var(--ok); font-weight: 700; font-size: 13px; white-space: nowrap; text-transform: uppercase; letter-spacing: .06em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.filter {
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  padding: 6px 12px; font-size: 13px; font-weight: 600;
}
.filter:hover { background: var(--soft); }
.filter.on { background: var(--ink); color: #fff; }
.sort { margin-left: auto; color: var(--ink-2); font-size: 14px; }
.sort select {
  background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 0;
  padding: 5px 8px; font: inherit;
}
.info.community { color: var(--blue); font-weight: 600; }
.browse-search { margin-bottom: 14px; max-width: 520px; display: block; }
.muted { color: var(--ink-2); }

/* ---------- rankings ---------- */
.top10 { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.top10 li {
  display: grid; grid-template-columns: 56px 72px 1fr auto; gap: 14px; align-items: center;
  background: var(--card); border: 2px solid var(--ink); box-shadow: var(--shadow-sm); padding: 10px 14px;
}
.top10 .num { font-family: var(--display); font-size: 40px; line-height: 1; text-align: center; }
.top10 li:first-child { background: var(--volt); box-shadow: var(--shadow); }
.top10 .cover { border: 2px solid var(--ink); }
.top10 .title { font-weight: 700; }
.score { color: var(--ink-2); font-size: 13px; text-align: right; white-space: nowrap; font-family: var(--mono); }
.score span { display: block; }
.top10 li:first-child .score, .top10 li:first-child .note { color: var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--card); border: 2px solid var(--ink); }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--soft); }
th {
  background: var(--ink); color: #fff; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .1em; font-family: var(--mono);
}
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td.n { font-family: var(--mono); font-size: 14px; }
.settling {
  font-family: var(--mono); font-size: 11px; margin-left: 8px; padding: 1px 6px;
  background: var(--soft); color: var(--ink); text-transform: uppercase; letter-spacing: .06em;
}
.empty {
  background: var(--card); border: 2px dashed var(--ink);
  padding: 28px; text-align: center; color: var(--ink-2);
}
.empty .btn { margin-top: 10px; }
.skiplist { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; gap: 8px; align-items: center; background: var(--card); border: 2px solid var(--ink);
  padding: 6px 8px 6px 14px; font-size: 14px;
}
.danger-zone { margin-top: 48px; padding-top: 20px; border-top: 2px solid var(--ink); }

/* ---------- version stamp ---------- */
.version { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--ink-2); padding: 0 0 70px; opacity: .7; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 18px; font-weight: 600;
  border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--volt);
  opacity: 0; pointer-events: none; transition: all .2s ease; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.error { background: var(--red); box-shadow: var(--shadow-sm); }

/* ---------- phones ---------- */
@media (max-width: 680px) {
  .topbar { padding: 10px 16px; }
  nav a, nav .link { padding: 6px 8px; font-size: 12px; }
  main { padding: 22px 16px 64px; }
  .arena { grid-template-columns: 1fr 1fr; gap: 14px; }
  .vs { display: none; }
  .pick .cover { box-shadow: var(--shadow-sm); }
  .meta .title { font-size: 15px; }
  .meta .artist { font-size: 13px; }
  .arena > .contender::before { font-size: 10px; padding: 2px 6px; }
  .top10 li { grid-template-columns: 36px 56px 1fr; }
  .top10 .num { font-size: 28px; }
  .top10 .score { grid-column: 3; text-align: left; margin-top: -8px; }
  .top10 .score span { display: inline; margin-right: 10px; }
  .kbd-hint { display: none; }
  .hide-sm { display: none; }
  .result { grid-template-columns: 56px 1fr; }
  .result > :last-child:not(:empty) { grid-column: 1 / -1; justify-self: start; }
  .sort { margin-left: 0; }
  .focus-result { grid-template-columns: 110px 1fr; gap: 14px; }
  .focus-record { font-size: 40px; }
  .focus-count { margin-left: 0; }
}
