/* ==========================================================================
   SETUP (round settings) + RESULTS + submit dialog.
   Loaded after style.css + home.css; overrides scoped to #setup / #results.
   Solid surfaces, 1px borders, orange as the one accent. No glows.
   ========================================================================== */
:root {
  --spring: cubic-bezier(.2, 1.2, .4, 1);
  --soft: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- picked beat (tap to change) ---------- */
#setup .picked .beat { transition: transform .18s var(--soft), border-color .18s; }
@media (hover: hover) { #setup .picked .beat:hover .change { border-color: var(--text); } }

/* ---------- Practice or Enter contest ---------- */
.play-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 8px; }
.play-mode button {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  padding: 14px 14px 13px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow);
  transition: transform .18s var(--soft), border-color .18s, background .18s;
}
.play-mode .pm-ic { font-size: 19px; line-height: 1; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel2); border: 1px solid var(--line); margin-bottom: 6px; }
.play-mode b { font-family: var(--display); font-weight: 400; font-size: 17px; }
.play-mode small { font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.35; }
@media (hover: hover) { .play-mode button:not(.on):hover { transform: translateY(-1px); border-color: var(--line2); } }
.play-mode button:active { transform: scale(.98); }
.play-mode button.on { border-color: var(--orange); background: #1a1511; box-shadow: inset 0 0 0 1px var(--orange), var(--shadow); }
.play-mode button.on::after { content: "✓"; position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--orange); color: var(--ink); font-size: 11px; font-weight: 900; display: grid; place-items: center; }
.mode-note { margin: 4px 2px 16px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
body.contest .mode-note .mn-practice, body:not(.contest) .mode-note .mn-contest { display: none; }

/* ---------- Solo / Battle: a sliding pill with an orange edge (GO stays the one orange fill) ---------- */
#setup .seg.mode { position: relative; isolation: isolate; padding: 4px; border-radius: 16px; }
#setup .seg.mode button { position: relative; z-index: 1; padding: 13px 8px; font-size: 15px; border-radius: 12px; }
@supports selector(:has(*)) {
  #setup .seg.mode::before {
    content: ""; position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: 12px;
    background: #1a1511; box-shadow: inset 0 0 0 1.5px var(--orange); transition: translate .25s var(--soft);
  }
  #setup .seg.mode:has(button[data-v="battle"].on)::before { translate: calc(100% + 4px) 0; }
  #setup .seg.mode button.on { background: transparent; color: var(--text); }
}

/* ---------- Instagram handle ---------- */
#setup .names { gap: 10px; margin: 14px 0 4px; }
#setup .ig span { font-family: var(--display); font-weight: 400; font-size: 17px; line-height: 1; }
#setup .ig input { font-size: 16px; }
body.battle #setup .names { gap: 8px; }
body.battle #setup .ig { padding-left: 11px; }
body.battle #setup .ig input { font-size: 15px; padding-right: 8px; text-overflow: ellipsis; }

/* ---------- Advanced settings drawer ---------- */
#setup details.adv { margin-top: 10px; }
#setup .adv summary {
  list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; -webkit-user-select: none;
  padding: 12px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: border-color .18s;
}
#setup .adv summary::-webkit-details-marker { display: none; }
#setup .adv summary::marker { content: ""; }
/* mini brand-bars icon (the logo's bars) on a neutral tile */
#setup .adv summary::before {
  content: ""; box-sizing: border-box; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; padding: 10px 11px; border: 1px solid var(--line);
  background: linear-gradient(var(--peach), var(--peach)) 0 100% / 4px 42% no-repeat content-box,
              linear-gradient(var(--lime), var(--lime)) 50% 100% / 4px 70% no-repeat content-box,
              linear-gradient(var(--orange), var(--orange)) 100% 100% / 4px 100% no-repeat content-box,
              var(--panel2);
}
#setup .adv summary > span { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; line-height: 1.2; }
#setup .adv summary small { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--muted); }
#setup .adv summary small::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); flex: 0 0 auto; }
#setup .adv summary > i {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line); display: grid; place-items: center;
  transition: transform .25s var(--soft);
}
#setup .adv summary > i::before {
  content: ""; width: 7px; height: 7px; border: solid var(--text); border-width: 0 2px 2px 0; border-radius: 1px; transform: translateY(-2px) rotate(45deg);
}
@media (hover: hover) { #setup .adv summary:hover { border-color: var(--line2); } }
#setup .adv[open] summary { border-color: var(--line2); }
#setup .adv[open] summary > i { transform: rotate(180deg); }
#setup .adv > .opts { margin-top: 8px; }
#setup .adv[open] > .opts { animation: drop-in .22s var(--soft) both; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } }

/* ==========================================================================
   RESULTS
   ========================================================================== */
#results > .row-btns:last-child { margin-top: 12px; }
#results .row-btns .primary { font-size: 16px; }

/* Submit to the leaderboard (results + battle vote) */
.board-btn { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 12px;
  border-radius: var(--r); background: var(--panel); color: var(--text); text-align: left; text-decoration: none;
  border: 1px solid var(--orange); box-shadow: inset 0 0 0 1px var(--orange), var(--shadow); transition: transform .18s var(--soft), background .18s; }
.bb-ic { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 19px;
  background: var(--panel2); border: 1px solid var(--line); }
.bb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bb-txt b { font-family: var(--display); font-weight: 400; font-size: 16px; line-height: 1.15; }
.bb-txt small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.bb-go { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: var(--ink);
  font-size: 20px; font-weight: 900; line-height: 1; padding-bottom: 2px; transition: transform .18s var(--soft); }
@media (hover: hover) { .board-btn:hover { background: #1a1511; } .board-btn:hover .bb-go { transform: translateX(2px); } }
.board-btn:active { transform: scale(.98); }
.board-btn.done { border-color: var(--line); box-shadow: var(--shadow); }
.board-btn.done .bb-ic { background: var(--lime); border-color: var(--lime); color: var(--ink); font-weight: 900; font-size: 17px; }
.board-btn.done .bb-go { background: var(--panel2); color: var(--text); border: 1px solid var(--line2); }
.sub-note { margin: 8px 2px 0; font-size: 12px; color: var(--muted); text-align: center; }
.board-note { margin: -4px 2px 14px; font-size: 13px; color: var(--muted); }

/* after a practice run: step up to the contest */
.go-contest { margin: 14px 0 4px; padding: 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: drop-in .25s var(--soft) both; }
.go-contest b { display: block; font-family: var(--display); font-weight: 400; font-size: 18px; }
.go-contest b span { color: var(--orange); }
.go-contest p { margin: 6px 0 2px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.row-btns .contest-btn { background: var(--panel2); color: var(--text); border-color: var(--orange); }

/* battle vote: per-side submit */
.side .side-sub { display: block; text-align: center; text-decoration: none; background: var(--orange); color: var(--ink); border-radius: 12px; padding: 11px 8px;
  font-weight: 800; font-size: 13.5px; }
.side .side-sub.done { background: transparent; color: var(--text); border: 1px solid var(--line2); padding: 10px 8px; }

/* ---------- submit dialog ---------- */
.submit-dlg h3 { font-size: 20px; }
.sd-run { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; padding: 12px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); }
.sd-ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 10px 8px; }
.sd-ic i { width: 5px; border-radius: 3px; background: var(--cream); }
.sd-ic i:nth-child(1) { height: 34%; } .sd-ic i:nth-child(2) { height: 55%; background: var(--peach); }
.sd-ic i:nth-child(3) { height: 77%; background: var(--lime); } .sd-ic i:nth-child(4) { height: 100%; background: var(--orange); }
.sd-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sd-meta b { font-family: var(--display); font-weight: 400; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-meta small { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 2px; line-height: 1.3; }
.sd-score { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; }
.sd-score b { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--orange); line-height: 1; }
.sd-score small { font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 3px; }
.submit-dlg .check { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel2); margin-top: 10px; transition: border-color .15s; }
.submit-dlg .check:has(input:checked) { border-color: var(--orange); }
.check.nudge { animation: nudge .3s; border-color: var(--coral) !important; }
.sd-links { margin: 10px 2px 0; text-align: center; font-size: 12.5px; color: var(--dim); }
.sd-links a { color: var(--muted); font-weight: 600; margin: 0 4px; }
.sd-err { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(253, 111, 101, .08); border: 1px solid var(--coral); color: var(--text); font-weight: 600; font-size: 13px; }
.sd-bar { height: 8px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; margin-top: 16px; }
.sd-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--orange); transition: width .25s var(--soft); }
.sd-pct { text-align: center; font-family: var(--display); font-size: 22px; margin: 12px 0 4px; }
.sd-done { text-align: center; }
.sd-stamp { width: 68px; height: 68px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 30px;
  background: var(--panel2); border: 1.5px solid var(--lime); animation: grade-in .3s var(--soft) both; }
.sd-big { font-size: 24px !important; margin: 0 0 4px !important; }
.sd-view { display: block; margin: 14px 0 0; padding: 15px; border-radius: 14px; background: var(--orange); color: var(--ink); text-decoration: none;
  font-weight: 800; font-size: 16px; transition: transform .15s var(--soft); }
.sd-view:active { transform: scale(.98); }
#sdCopy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
