/* ============================================================
   Result modal, round-end summary, leaderboard.
   ============================================================ */

/* ---- Hole result modal (now dark glass, was pure white) --- */
#result {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  background: var(--surface-scrim);
  -webkit-backdrop-filter: blur(var(--blur-sm));
  backdrop-filter: blur(var(--blur-sm));
}
#result.hidden { display: none; }

.result-box {
  background: var(--surface-panel);
  border: var(--border-hair);
  padding: var(--s-6) var(--s-6);
  border-radius: var(--r-lg);
  text-align: center;
  box-shadow: var(--shadow-3);
  -webkit-backdrop-filter: blur(var(--blur-md));
  backdrop-filter: blur(var(--blur-md));
  animation: panelIn var(--dur-modal) var(--ease) both;
}
.result-box h2 { color: var(--text); font-family: var(--font-display); font-size: var(--t-h1); font-weight: var(--fw-bold); margin-bottom: var(--s-2); }
.result-box p { color: var(--text-muted); margin-bottom: var(--s-5); font-size: var(--t-body); font-variant-numeric: tabular-nums; }

#play-again {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: var(--s-3) 28px;
  border-radius: var(--r-pill);
  font-size: 16px;
  font-weight: var(--fw-med);
  cursor: pointer;
  box-shadow: var(--accent-glow);
  transition: transform var(--dur-fast);
}
#play-again:active { transform: scale(0.97); }

/* ---- Result detail keeps the personal-best line on its own row ---- */
#result-detail { white-space: pre-line; }

/* ---- Escalating celebration on the result title ------------------- */
#result-title.rt-l1 { color: var(--status-birdie); }
#result-title.rt-l2,
#result-title.rt-l3,
#result-title.rt-l4 {
  color: var(--status-eagle);
  text-shadow: 0 0 18px rgba(207, 168, 94, 0.55);
  animation: rtPulse 0.6s var(--ease) 2;
}
#result-title.rt-best { animation: rtPulse 0.6s var(--ease) 2; }
@keyframes rtPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ---- Round-end summary ------------------------------------ */
#round-end {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-scrim);
  -webkit-backdrop-filter: blur(var(--blur-sm));
  backdrop-filter: blur(var(--blur-sm));
  z-index: 30;
  padding: var(--s-4);
}
#round-end.hidden { display: none; }

.re-box {
  background: var(--surface-panel);
  border: var(--border-hair);
  border-radius: var(--r-lg);
  width: min(480px, 100%);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-3);
  animation: panelIn var(--dur-modal) var(--ease) both;
}
.re-header {
  padding: var(--s-4) var(--s-5) var(--s-3);
  text-align: center;
  border-bottom: 1px solid var(--w-08);
  flex-shrink: 0;
}
.re-header h2 { color: var(--text); font-family: var(--font-display); font-size: var(--t-h2); font-weight: var(--fw-bold); }
#re-subtitle { color: var(--text-dim); font-size: var(--t-cap); margin-top: 3px; }

.re-tabs {
  display: flex;
  padding: var(--s-3) var(--s-4);
  gap: var(--s-2);
  border-bottom: 1px solid var(--w-08);
  flex-shrink: 0;
}
.re-tab {
  flex: 1;
  padding: var(--s-2);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: var(--t-cap);
  font-weight: var(--fw-med);
  letter-spacing: 0.4px;
  cursor: pointer;
}
.re-tab.active { border-bottom-color: var(--brass); color: var(--text); }

.re-panel { overflow-y: auto; flex: 1; padding: var(--s-3) var(--s-4); min-height: 0; }
.re-panel.hidden { display: none; }

/* Scorecard grid */
.re-sc-wrap { overflow-x: auto; }
.re-sc-empty { color: var(--text-dim); text-align: center; padding: 18px 0; }
.re-sc {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: var(--text);
  margin-bottom: var(--s-3);
}
.re-sc th, .re-sc td { text-align: center; padding: 5px 3px; min-width: 22px; }
.re-label { text-align: left !important; font-weight: var(--fw-med); color: var(--text-dim); font-size: 11px; padding-left: 2px !important; }
.re-sep { font-weight: var(--fw-black); border-left: 1px solid var(--w-12); padding-left: 6px !important; }
.re-sc thead th { color: var(--text-faint); font-weight: var(--fw-med); border-bottom: 1px solid var(--w-12); }
.re-sc tbody tr + tr { border-top: 1px solid var(--w-05); }

/* Score cell colors */
.re-cell-eagle  { background: var(--status-eagle); color: #1a1a1a; border-radius: 4px; font-weight: var(--fw-black); }
.re-cell-birdie { background: var(--accent); color: #fff; border-radius: 4px; font-weight: var(--fw-bold); }
.re-cell-par    { color: var(--text); }
.re-cell-bogey  { color: var(--status-hazard); }
.re-cell-double { color: var(--status-under); font-weight: var(--fw-bold); }

/* Stats list */
.re-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--w-08);
}
.re-stat-label { color: var(--text-dim); font-size: var(--t-cap); }
.re-stat-val { color: var(--text); font-size: 14px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.re-stat-section {
  margin: var(--s-4) 0 4px;
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.re-per-hole td, .re-per-hole th { padding: 6px 5px; font-size: 12px; }

.re-actions {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--w-08);
  flex-shrink: 0;
}
.re-actions .menu-btn { flex: 1; margin: 0; padding: var(--s-3); font-size: var(--t-body); }

.re-trn-row { padding: var(--s-3) var(--s-4) 0; flex-shrink: 0; }
.re-trn-row.hidden { display: none; }
.re-trn-row .menu-btn { margin: 0; width: 100%; }

/* ---- Leaderboard overlay ---------------------------------- */
#leaderboard {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(rgba(5, 11, 8, 0.5), rgba(5, 11, 8, 0.5)),
    var(--surface-scrim);
  -webkit-backdrop-filter: blur(var(--blur-sm));
  backdrop-filter: blur(var(--blur-sm));
  z-index: var(--z-sheet-low);
}
.lb-box {
  width: min(420px, 92vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-panel);
  border: var(--border-hair);
  border-left: 2px solid var(--brass);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-4);
  box-shadow: var(--shadow-3);
  animation: panelIn var(--dur-modal) var(--ease) both;
}
.lb-box h2 {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.4em;
  color: var(--text); text-align: left; margin-bottom: var(--s-4); font-size: var(--t-h1);
  font-family: var(--font-display); font-weight: var(--fw-bold);
}
.lb-box h2::before, .bk-header h2::before {
  content: "▸"; color: var(--brass); font-family: var(--font-mono);
  font-size: 0.7em; margin-right: 0.45em; vertical-align: middle;
}
.lb-box h2 .ic { color: var(--brass); }
.lb-course {
  width: 100%;
  margin-bottom: var(--s-4);
  padding: 13px 40px 13px var(--s-4);
  border-radius: var(--r-md);
  border: var(--border-edge);
  background-color: var(--w-05);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2363b98b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  color: var(--text);
  font-size: var(--t-body);
  font-weight: var(--fw-bold);
  letter-spacing: 0.2px;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.lb-course:hover { background-color: var(--w-08); }
.lb-course:focus { outline: none; border-color: var(--accent); background-color: var(--accent-soft); }
.lb-course option { background: var(--green-700); color: var(--text); font-weight: var(--fw-med); }
.lb-table-wrap { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 80px; }
.lb-table { width: 100%; border-collapse: collapse; color: var(--text); }
.lb-table th {
  position: sticky; top: 0;
  background: var(--green-700);
  color: var(--text-dim);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  text-align: left; padding: 6px var(--s-2); font-weight: var(--fw-med);
}
.lb-table td { padding: 9px var(--s-2); border-top: 1px solid var(--w-08); font-size: 14px; }
.lb-table .lb-rank { color: var(--text-faint); width: 30px; font-variant-numeric: tabular-nums; }
.lb-table .lb-name { font-weight: var(--fw-med); }
.lb-table .lb-topar { text-align: left; font-weight: var(--fw-black); font-variant-numeric: tabular-nums; }
.lb-table .lb-strk { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* to-par colors via shared .tp-under/.tp-over/.tp-even (css/base.css) */
.lb-table tr.lb-me td { background: var(--accent-soft); }
.lb-empty { text-align: center; color: var(--text-dim); padding: var(--s-5) var(--s-2); font-size: 14px; }
.lb-empty.hidden { display: none; }
.lb-box .menu-btn { margin: var(--s-4) auto 0; }

/* ---- Daily Challenge home (pre-round: course + leaderboard + Play) ---- */
.dh-box {
  position: relative;
  width: min(440px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-panel);
  border: var(--border-hair);
  border-left: 2px solid var(--brass);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-4);
  box-shadow: var(--shadow-3);
  animation: panelIn var(--dur-modal) var(--ease) both;
}
.dh-close {
  position: absolute; top: var(--s-3); right: var(--s-3);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: var(--border-hair); background: var(--w-05);
  color: var(--text-dim); cursor: pointer;
}
.dh-close:hover { background: var(--w-08); color: var(--text); }
.dh-head { margin-bottom: var(--s-3); }
.dh-head h2 {
  color: var(--text); text-align: left; margin: 0; font-size: var(--t-h1);
  font-family: var(--font-display); font-weight: var(--fw-bold);
}
.dh-date { margin: 2px 0 0; color: var(--text-dim); font-size: 13px; font-weight: var(--fw-med); }
.dh-course {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2); margin-bottom: var(--s-4);
  border: var(--border-hair); border-radius: var(--r-md); background: var(--w-05);
}
.dh-course-img {
  width: 96px; height: 64px; flex: none; overflow: hidden;
  border-radius: var(--r-sm); background: var(--green-700);
}
.dh-course-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dh-course-name { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: 17px; color: var(--text); }
.dh-course-meta { margin-top: 3px; color: var(--text-dim); font-size: 13px; }
.dh-board-wrap { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 80px; }
.dh-board-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-dim); font-weight: var(--fw-med); margin-bottom: var(--s-1);
}
.dh-box .menu-btn { margin: var(--s-4) auto 0; }
.dh-locked {
  margin-top: var(--s-4); text-align: center; color: var(--text-dim);
  font-size: 14px; line-height: 1.5; font-weight: var(--fw-med);
}
.dh-locked.hidden, .dh-course.hidden { display: none; }

/* ---- Booking sheet ("Book a real tee time" CTA) ------------ */
#book-sheet {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-scrim);
  -webkit-backdrop-filter: blur(var(--blur-sm));
  backdrop-filter: blur(var(--blur-sm));
  z-index: var(--z-sheet);
  padding: var(--s-4);
}
.bk-box {
  width: min(420px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-panel);
  border: var(--border-hair);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-4) var(--s-4);
  box-shadow: var(--shadow-3);
  animation: panelIn var(--dur-modal) var(--ease) both;
}
.bk-header { position: relative; text-align: center; margin-bottom: var(--s-3); flex-shrink: 0; }
.bk-header h2 { color: var(--text); font-family: var(--font-display); font-size: var(--t-h2); font-weight: var(--fw-bold); }
#bk-course-name { color: var(--text-dim); font-size: var(--t-cap); margin-top: 3px; }
.bk-x {
  position: absolute; top: -6px; right: -4px;
  background: transparent; border: none; color: var(--text-dim);
  font-size: 24px; line-height: 1; padding: var(--s-2); cursor: pointer;
}
.bk-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 60px; display: flex; flex-direction: column; gap: var(--s-2); }
.bk-loading { text-align: center; color: var(--text-dim); padding: var(--s-5) var(--s-2); font-size: 14px; }
.bk-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  width: 100%; text-align: left;
  padding: var(--s-3) var(--s-4);
  border: var(--border-edge);
  border-radius: var(--r-md);
  background: var(--w-05);
  color: var(--text);
  cursor: pointer;
  transition: background-color var(--dur-fast), transform var(--dur-fast);
}
.bk-row:hover { background: var(--w-08); }
.bk-row:active { transform: scale(0.99); }
.bk-row:disabled { opacity: 0.6; cursor: default; }
.bk-time { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.bk-meta { color: var(--text-dim); font-size: var(--t-cap); flex: 1; margin-left: var(--s-3); }
.bk-go { color: var(--brass); font-weight: var(--fw-bold); font-size: var(--t-cap); text-transform: uppercase; letter-spacing: 0.4px; }
.bk-foot { text-align: center; color: var(--text-faint); font-size: 11px; margin-top: var(--s-3); flex-shrink: 0; }

/* ===== Multiplayer matches ===== */
.mm-or { text-align: center; color: var(--text-dim); font-size: 13px; margin: var(--s-3) 0 var(--s-2); }
#match-menu input#mm-code {
  width: 100%;
  margin-top: var(--s-1);
  padding: 13px var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--w-14);
  background: var(--surface-raised);
  color: var(--text);
  text-align: center; letter-spacing: 4px; text-transform: uppercase;
  font-weight: var(--fw-bold); font-size: 20px;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
#match-menu input#mm-code::placeholder { color: var(--text-faint); letter-spacing: 4px; }
#match-menu input#mm-code:focus { outline: none; border-color: var(--accent); background: var(--accent-soft); }

/* Lobby */
.ml-code-wrap { text-align: center; margin: var(--s-3) 0; }
.ml-code-label { display: block; font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.ml-code-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; }
.ml-code {
  display: inline-block; font-family: var(--font-display); font-weight: var(--fw-bold);
  font-size: 32px; letter-spacing: 6px; color: var(--accent-bright);
  background: var(--accent-soft); border-radius: var(--r-md); padding: 6px 16px;
}
.ml-copy {
  font: inherit; font-size: 13px; font-weight: var(--fw-med); cursor: pointer;
  color: var(--text); background: var(--surface-panel);
  border: 1px solid var(--border, rgba(255,255,255,0.14));
  border-radius: var(--r-md); padding: 8px 12px; white-space: nowrap;
}
.ml-copy:active { transform: scale(0.94); }
.ml-copy.copied { color: var(--accent); border-color: var(--accent); }
.ml-players { list-style: none; margin: var(--s-3) 0; padding: 0; max-height: 220px; overflow-y: auto; }
.ml-player {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-panel);
  margin-bottom: 6px; font-weight: var(--fw-med); color: var(--text);
}
.ml-player.ml-me { background: var(--accent-soft); }
.ml-player.ml-empty { color: var(--text-dim); font-weight: 400; justify-content: center; }
.ml-host { font-size: 10px; font-weight: var(--fw-bold); color: var(--accent); letter-spacing: 1px; }

/* Host setup / Quick Match / Bots — format + length now use the shared
   .seg segmented control (css/base.css); only screen-specific bits remain. */
#qm-searching { text-align: center; }
#qm-setup.hidden, #qm-searching.hidden { display: none; }
.qm-hint { opacity: 0.7; }
.qm-spinner {
  width: 34px; height: 34px; margin: var(--s-3) auto var(--s-2);
  border: 3px solid var(--w-08); border-top-color: var(--accent);
  border-radius: 50%; animation: qm-spin 0.8s linear infinite;
}
@keyframes qm-spin { to { transform: rotate(360deg); } }
.qm-bots { width: 100%; margin-top: var(--s-2); }

/* Bot ladder — roster of fixed CPU opponents, unlock by beating the previous */
.bot-box { width: min(420px, 92vw); }
.bot-admin-note { color: var(--accent); margin-top: -8px; }
.bot-admin-note.hidden { display: none; }
.bot-list {
  max-height: 52vh; overflow-y: auto;
  margin-top: var(--s-3); text-align: left;
}
.bot-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 6px;
  border-radius: var(--r-md); background: var(--surface-panel);
}
.bot-av {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bav, var(--accent)); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
}
.bot-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bot-name { color: var(--text); font-weight: 700; font-size: 14px; }
.bot-hcp { color: var(--text-dim); font-weight: 500; font-size: 11px; margin-left: 4px; }
.bot-desc { color: var(--text-dim); font-size: 12px; }
.bot-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.bot-tags i {
  font-style: normal; font-size: 10px; color: var(--text-dim);
  background: var(--w-08); border-radius: var(--r-sm); padding: 1px 6px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.bot-row .bot-play { margin: 0; padding: 8px 14px; font-size: 13px; flex: none; width: auto; }
.bot-locked { opacity: 0.55; }
.bot-locked .bot-av { filter: grayscale(1); }
.bot-lock { flex: none; color: var(--text-dim); padding: 0 8px; }
.bot-check { color: var(--accent); font-size: 12px; }

/* Trophy Room — progress overview (courses / ladder / achievements / daily) */
.pr-box { width: min(420px, 92vw); }
#pr-body {
  max-height: 58vh; overflow-y: auto;
  margin-top: var(--s-3); text-align: left;
}
.pr-section { margin-bottom: var(--s-3); }
.pr-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--brass-bright, #cfa85e);
  margin-bottom: 6px;
}
.pr-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 13px; color: var(--text);
}
.pr-row .ic { flex: none; width: 14px; height: 14px; }
.pr-dim, .pr-locked { color: var(--text-dim); }
.pr-locked .ic { opacity: 0.6; }
.pr-earned .ic { color: var(--accent); }
.pr-ms { display: flex; flex-direction: column; min-width: 0; }
.pr-ms b { font-size: 13px; font-weight: 700; }
.pr-ms i { font-style: normal; font-size: 11px; color: var(--text-dim); }
.pr-bar {
  height: 6px; border-radius: var(--r-pill, 999px);
  background: var(--w-08, rgba(255,255,255,0.08));
  overflow: hidden; margin: 4px 0 6px;
}
.pr-bar-fill {
  height: 100%; border-radius: inherit;
  background: var(--brass-bright, #cfa85e);
}

/* Post-round opponent scorecard (reuses the .re-sc table look) */
.mr-sc-wrap { overflow-x: auto; margin-top: var(--s-2); }
.mr-sc-wrap:empty { display: none; }

/* Match results footer (Rematch / Next bot appear only after ladder matches) */
.mr-actions { display: flex; gap: var(--s-2); }
.mr-actions .menu-btn { flex: 1; margin: 0; }
.mr-actions .menu-btn.hidden { display: none; }

/* Live standings — auto-shown during a match, top-left under the scorecard */
#match-standings {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 178px); left: var(--s-3); right: auto;
  width: min(240px, 60vw); z-index: 40;
  background: var(--surface-scrim); backdrop-filter: var(--blur-sm);
  border: 1px solid var(--border-edge); border-radius: var(--r-lg);
  box-shadow: var(--shadow-3); overflow: hidden;
}
#match-standings.hidden { display: none; }
/* Mobile: JS anchors it below the scorecard bar (anchorMatchBoard). */
body.is-mobile #match-standings { width: min(240px, 60vw); min-width: 0; box-sizing: border-box; }
.mb-head {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; font-weight: var(--fw-bold); color: var(--text);
  background: var(--accent-soft); font-size: 14px;
}
.mb-head #mb-title { flex: 1; }
.mb-x { background: none; border: none; color: var(--text-dim); font-size: 14px; cursor: pointer; padding: 0 4px; }
#mb-resync { font-size: 15px; line-height: 1; }
#mb-resync:active { color: var(--accent); }
.mb-list { padding: 6px; max-height: 50vh; overflow-y: auto; }

/* ---- Unified standings list (.std-*) — ONE row family shared by the match
   live board (#mb-list) and match results (#mr-list). Size/emphasis diffs are
   scoped per host below. Replaces the old near-identical .mb-row + .mr-row. --- */
.std-row {
  display: grid; grid-template-columns: 44px 1fr auto auto; gap: 8px; align-items: center;
  padding: 8px 9px; border-radius: var(--r-sm); font-size: 14px; color: var(--text);
  border: 1px solid transparent;
}
.std-row.std-me { background: var(--accent-soft); }
.std-row.std-lead .std-name { font-weight: var(--fw-bold); }
.std-pos { color: var(--text-dim); text-align: left; font-size: 12px; font-weight: var(--fw-bold); }
.std-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.std-score { font-weight: var(--fw-bold); min-width: 36px; text-align: right; }
.std-thru { color: var(--text-dim); font-size: 12px; min-width: 38px; text-align: right; }
.std-fin { color: var(--accent); font-weight: var(--fw-bold); }
.std-trophy { color: var(--brass-bright); font-size: 0.9em; margin-left: 2px; }
.std-empty { display: block; text-align: center; color: var(--text-dim); grid-template-columns: none; }
/* live board: tighter */
#mb-list .std-row { grid-template-columns: 38px 1fr auto auto; padding: 6px 8px; }

/* CPU vs live distinction — chip on bot opponents, dot on live pairings */
.cpu-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--w-12);
  background: var(--w-05);
  color: var(--text-dim);
  vertical-align: 1px;
}
.qm-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 7px;
  vertical-align: 1px;
}

/* Match results landing page — full-screen live scoreboard after Confirm. */
#match-results {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  background: var(--surface-scrim); backdrop-filter: var(--blur-md);
}
#match-results.hidden { display: none; }
.mr-box {
  width: min(440px, 100%); max-height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface-panel); border: 1px solid var(--border-edge);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 20px;
}
.mr-head { text-align: center; }
.mr-head h2 { margin: 0; color: var(--text); }
.mr-head p { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; }
.mr-banner {
  text-align: center; font-weight: var(--fw-bold); color: var(--text);
  background: var(--accent-soft); border-radius: var(--r-md);
  padding: 10px 12px; font-size: 16px;
}
.mr-banner:empty { display: none; }
.mr-list { display: flex; flex-direction: column; gap: 4px; }
/* results modal: roomier rows + winner border (shares .std-* base) */
#mr-list .std-row { grid-template-columns: 48px 1fr auto auto; gap: 10px; padding: 10px; font-size: 15px; }
#mr-list .std-row .std-pos, #mr-list .std-row .std-thru { font-size: 13px; }
#mr-list .std-row.std-lead { border-color: var(--accent); }

/* ===== Match play: format via .seg, Live via .switch (css/base.css) ===== */
.ms-note { min-height: 14px; color: var(--text-dim); font-size: 12px; margin: 4px 0; }

.mb-status {
  padding: 8px 10px; font-family: var(--font-display); font-weight: var(--fw-bold); font-size: 18px; color: var(--text);
  text-align: center;
}
.mb-opp { padding: 8px 10px; border-top: 1px solid var(--border-hair); }
.mb-opp-name { font-weight: var(--fw-bold); color: var(--text); font-size: 14px; }
.mb-opp-line { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.mb-honors {
  padding: 7px 10px; margin: 6px; border-radius: var(--r-sm);
  background: var(--accent-soft); color: var(--accent);
  font-weight: var(--fw-bold); font-size: 13px; text-align: center;
}
