/* RANK WHAT YOU KNOW — sports-desk power-ranking look:
   deep night navy, electric maple gold, hot magenta accents. */

:root {
  --bg: #141a26;
  --panel: #1d2536;
  --panel-2: #232e44;
  --ink: #f2f4f8;
  --dim: #8b96ac;
  --gold: #ffc531;
  --pink: #ff4d8d;
  --green: #3ddc84;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100dvh;
}
#app { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(28px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; border: none; -webkit-tap-highlight-color: transparent; }

/* ---------- header ---------- */
header { text-align: center; margin-bottom: 18px; }
#brand {
  font-size: 15px; font-weight: 900; letter-spacing: 3px; color: var(--gold);
  text-transform: uppercase;
}
#brand span { color: var(--pink); }
#cat-line { margin-top: 10px; font-size: 30px; font-weight: 900; line-height: 1.1; }
#cat-emoji { margin-right: 6px; }
#cat-month { color: var(--dim); font-size: 14px; margin-top: 4px; font-weight: 600; }
#month-nav {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 2px;
  scrollbar-width: none; justify-content: safe center;
}
#month-nav::-webkit-scrollbar { display: none; }
.month-chip {
  flex: 0 0 auto; background: var(--panel); color: var(--dim);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 700;
  border: 1px solid #2c3852;
}
.month-chip.active { background: var(--gold); color: #241a00; border-color: var(--gold); }

/* ---------- shared ---------- */
.step-label {
  color: var(--pink); font-size: 12px; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 6px;
}
h2 { font-size: 21px; margin-bottom: 6px; }
.hint { color: var(--dim); font-size: 14px; margin-bottom: 14px; }
.cta {
  background: var(--gold); color: #241a00; font-weight: 900; font-size: 16px;
  padding: 14px 22px; border-radius: var(--radius); width: 100%;
  transition: transform .1s, opacity .2s;
}
.cta:active { transform: scale(.97); }
.cta:disabled { opacity: .35; cursor: default; }
.ghost {
  background: transparent; color: var(--dim); font-weight: 700; font-size: 14px;
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid #2c3852;
}
.sticky-bar {
  position: sticky; bottom: 0; margin: 16px -16px -28px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.sticky-bar .cta { flex: 1; width: auto; }
#check-counter { width: 100%; text-align: center; font-weight: 800; color: var(--gold); font-size: 15px; }

/* ---------- checklist ---------- */
#check-grid { display: flex; flex-direction: column; gap: 10px; }
.check-card {
  display: flex; align-items: flex-start; gap: 12px; text-align: left;
  background: var(--panel); border: 2px solid #2c3852; border-radius: var(--radius);
  padding: 13px 14px; color: var(--ink); width: 100%;
  transition: border-color .15s, background .15s;
}
.check-card.checked { border-color: var(--green); background: #1c3227; }
.check-box {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; margin-top: 2px;
  border: 2px solid #3a4763; display: grid; place-items: center;
  font-weight: 900; color: #06331c; background: transparent; font-size: 16px;
}
.check-card.checked .check-box { background: var(--green); border-color: var(--green); }
.check-body { display: block; }
.check-name { display: block; font-weight: 800; font-size: 16px; }
.check-where { display: block; color: var(--gold); font-size: 12px; font-weight: 700; margin-top: 1px; }
.check-note { display: block; color: var(--dim); font-size: 13px; margin-top: 3px; }

/* ---------- rank ---------- */
#rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2); border: 2px solid #2c3852; border-radius: var(--radius);
  padding: 10px 12px; user-select: none; position: relative;
}
.rank-row.dragging {
  z-index: 5; border-color: var(--gold);
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}
.drag-live .rank-row:not(.dragging) { transition: none; }
.rank-num {
  flex: 0 0 30px; height: 30px; border-radius: 9px; background: var(--gold);
  color: #241a00; font-weight: 900; display: grid; place-items: center; font-size: 15px;
}
.rank-body { flex: 1; min-width: 0; }
.rank-name { display: block; font-weight: 800; font-size: 15px; }
.rank-where { display: block; color: var(--dim); font-size: 12px; }
.row-btns { display: flex; flex-direction: column; gap: 4px; }
.mini-btn {
  background: var(--panel); color: var(--dim); border: 1px solid #2c3852;
  border-radius: 8px; width: 34px; height: 26px; font-size: 11px;
}
.mini-btn:active { color: var(--gold); }
.drag-handle {
  flex: 0 0 auto; font-size: 24px; color: var(--dim); padding: 6px 4px 6px 10px;
  cursor: grab; touch-action: none;
}
.rank-row.dragging .drag-handle { cursor: grabbing; color: var(--gold); }

/* ---------- name ---------- */
#name-input {
  width: 100%; background: var(--panel); border: 2px solid #2c3852; border-radius: var(--radius);
  color: var(--ink); font-size: 18px; font-weight: 700; padding: 14px 16px; margin-bottom: 12px;
  outline: none;
}
#name-input:focus { border-color: var(--gold); }

/* ---------- reveal ---------- */
#reveal-loading { text-align: center; color: var(--dim); padding: 40px 0; font-weight: 700; }
#reveal-count { color: var(--dim); font-size: 14px; font-weight: 700; margin-bottom: 14px; }

#match-card {
  background: linear-gradient(135deg, #2a1a3e, #3e1f33);
  border: 2px solid var(--pink); border-radius: var(--radius);
  text-align: center; padding: 18px 16px; margin-bottom: 18px;
}
#match-pct { font-size: 44px; font-weight: 900; color: var(--pink); line-height: 1; }
#match-label { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); margin-top: 4px; }
#match-line { margin-top: 8px; font-weight: 700; font-size: 15px; }

#bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { background: var(--panel); border-radius: var(--radius); padding: 10px 12px; border: 2px solid transparent; }
.bar-row.mine { border-color: #3a4763; }
.bar-top { display: flex; align-items: baseline; gap: 8px; }
.bar-rank { font-weight: 900; color: var(--gold); font-size: 17px; min-width: 22px; }
.bar-name { font-weight: 800; font-size: 15px; flex: 1; min-width: 0; }
.you-badge {
  background: var(--pink); color: #fff; font-size: 10px; font-weight: 900;
  padding: 2px 7px; border-radius: 999px; letter-spacing: .5px; text-transform: uppercase;
  flex: 0 0 auto;
}
.bar-score { font-weight: 900; color: var(--gold); font-size: 15px; }
.bar-track { background: #10151f; border-radius: 6px; height: 10px; margin-top: 7px; overflow: hidden; }
.bar-fill {
  height: 100%; width: var(--w);
  background: linear-gradient(90deg, var(--gold), var(--pink));
  border-radius: 6px; transform-origin: left;
  animation: grow .7s cubic-bezier(.2,.8,.2,1) backwards;
}
@keyframes grow { from { transform: scaleX(0); } }
.bar-sub { color: var(--dim); font-size: 11px; margin-top: 5px; }
.empty-note { color: var(--dim); background: var(--panel); border-radius: var(--radius); padding: 18px; text-align: center; font-size: 14px; }

.pending { margin-top: 6px; background: var(--panel); border-radius: var(--radius); padding: 12px 14px; }
.pending-title { color: var(--dim); font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.pending-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; color: #c3cbdb; }
.pending-count { color: var(--dim); font-weight: 700; }

.action-row { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }

#todo { background: var(--panel); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
#todo h3 { font-size: 16px; margin-bottom: 2px; }
#todo ul { list-style: none; }
#todo li { padding: 8px 0; border-bottom: 1px solid #2c3852; font-size: 14px; }
#todo li:last-child { border-bottom: none; }
#todo li span { color: var(--dim); }

#countdown {
  text-align: center; color: var(--gold); font-weight: 800; font-size: 14px;
  background: var(--panel); border-radius: var(--radius); padding: 14px; margin-bottom: 8px;
}

footer { text-align: center; color: var(--dim); font-size: 13px; margin-top: 28px; }
footer a { color: var(--gold); text-decoration: none; font-weight: 700; }

@media (min-width: 480px) {
  #check-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .action-row { flex-direction: row; flex-wrap: wrap; }
  .action-row .cta { flex: 1 1 100%; }
  .action-row .ghost { flex: 1; }
}
