/* Score Pad — univers « table de jeu », indépendant du launcher Devlooper */
:root {
  --felt: #14352a;
  --felt-deep: #0c241c;
  --felt-mid: #1c4a3a;
  --felt-shine: rgba(232, 184, 74, .08);
  --wood: #5c3a1e;
  --wood-edge: #c9a06a;
  --paper: #f6edd8;
  --paper-2: #efe3c4;
  --cream: #fff8ea;
  --ink: #1c140c;
  --muted: #6d5e4c;
  --line: rgba(92, 58, 30, .18);
  --gold: #e8b84a;
  --gold-2: #f3d48a;
  --chip: #c44536;
  --chip-ink: #fff8ea;
  --shadow: 0 18px 40px -18px rgba(8, 20, 14, .55);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body.sp-body {
  margin: 0;
  min-height: 100dvh;
  touch-action: manipulation;
}
.sp-body {
  font-family: var(--font-ui);
  color: var(--cream);
  background: var(--felt-deep);
  -webkit-font-smoothing: antialiased;
}
.sp-body ::selection { background: var(--gold); color: var(--felt-deep); }

.sp-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(circle at 18% 12%, var(--felt-shine), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(255,255,255,.05), transparent 38%),
    repeating-radial-gradient(circle at 0 0, rgba(255,255,255,.025) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, var(--felt-mid) 0%, var(--felt) 38%, var(--felt-deep) 100%);
}
.sp-app::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  box-shadow: inset 0 0 0 10px var(--wood), inset 0 0 0 12px var(--wood-edge);
  opacity: .55;
  z-index: 1;
}
@media (max-width: 720px) {
  .sp-app::before { box-shadow: inset 0 0 0 6px var(--wood), inset 0 0 0 7px var(--wood-edge); opacity: .4; }
}

.sp-top, .sp-root, .sp-flash, .sp-overlay { position: relative; z-index: 2; }
.sp-top[hidden], .sp-top.is-off { display: none !important; }

.sp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  border-bottom: 1px solid rgba(201, 160, 106, .28);
  background: linear-gradient(180deg, rgba(12, 36, 28, .72), rgba(12, 36, 28, .35));
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.sp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
  min-height: 44px;
}
.sp-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.sp-brand-name {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.25rem;
  letter-spacing: -.02em;
  color: var(--gold-2);
}
.sp-top-actions { display: flex; align-items: center; gap: 6px; }
.sp-library {
  color: var(--gold-2);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(201, 160, 106, .35);
}
.sp-library:hover { background: rgba(232, 184, 74, .12); }

.sp-text-btn, .sp-install-btn, .sp-icon-btn, .sp-btn, .sp-btn-ghost, .sp-btn-soft {
  min-height: 44px;
  border: 0;
  cursor: pointer;
  font: 600 13.5px var(--font-ui);
  border-radius: 12px;
}
.sp-text-btn, .sp-icon-btn { background: transparent; color: var(--gold-2); padding: 0 12px; }
.sp-icon-btn {
  width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--gold-2);
}
.sp-icon-btn[hidden], .sp-text-btn[hidden], .sp-install-btn[hidden] { display: none !important; }
.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: 400;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  display: inline-block;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-smoothing: antialiased;
}
.sp-icon-btn .material-symbols-rounded { font-size: 22px; }
.sp-install-btn { background: var(--gold); color: var(--felt-deep); padding: 0 14px; }
.sp-btn { background: var(--gold); color: var(--felt-deep); padding: 0 18px; box-shadow: 0 6px 16px -8px rgba(232, 184, 74, .7); }
.sp-btn:hover { filter: brightness(1.06); }
.sp-btn-ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(246, 237, 216, .28);
  padding: 0 16px;
}
.sp-btn-soft { background: var(--chip); color: var(--chip-ink); padding: 0 16px; }
.sp-btn:disabled { opacity: .45; cursor: not-allowed; }

.sp-flash {
  margin: 10px 16px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13.5px;
}
.sp-flash.is-error { background: #f3d0c8; color: #6b1d14; }
.sp-root { flex: 1; width: min(1120px, 100%); margin: 0 auto; padding: 20px 18px 40px; }

.sp-h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.4vw, 2.7rem);
  font-weight: 650;
  line-height: 1.12;
  margin: 6px 0 10px;
  color: var(--cream);
  letter-spacing: -.03em;
}
.sp-lead { color: rgba(255, 248, 234, .72); font-size: 15.5px; line-height: 1.5; max-width: 38rem; }
.sp-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}

.sp-choice-grid { display: grid; gap: 14px; margin-top: 22px; }
@media (min-width: 720px) { .sp-choice-grid { grid-template-columns: 1fr 1fr; } }
.sp-choice {
  text-align: left;
  background: linear-gradient(180deg, var(--cream), var(--paper));
  color: var(--ink);
  border: 1px solid var(--paper-2);
  border-radius: var(--radius);
  padding: 20px 18px 18px 56px;
  cursor: pointer;
  min-height: 124px;
  box-shadow: var(--shadow);
  position: relative;
}
.sp-choice::before {
  content: "⚀";
  position: absolute;
  left: 16px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--felt);
  color: var(--gold-2);
  display: grid;
  place-items: center;
  font-size: 16px;
}
.sp-choice[data-intent="play"]::before, .sp-choice[data-mode="self"]::before { content: "⚄"; background: var(--chip); color: var(--cream); }
.sp-choice:hover, .sp-choice.is-on { transform: translateY(-1px); box-shadow: 0 22px 44px -16px rgba(8, 20, 14, .65); }
.sp-choice h3 { font-family: var(--font-display); font-size: 1.28rem; margin: 0 0 6px; font-weight: 650; }
.sp-choice p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

.sp-search {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--paper-2);
  border-radius: 14px;
  padding: 0 18px 0 44px;
  font: 15px var(--font-ui);
  color: var(--ink);
  background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%236d5e4c'%3E%3Cpath d='M8.5 3a5.5 5.5 0 014.38 8.83l3.15 3.14-1.06 1.06-3.14-3.15A5.5 5.5 0 118.5 3zm0 1.5a4 4 0 100 8 4 4 0 000-8z'/%3E%3C/svg%3E") 16px 50% no-repeat;
}
.sp-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.sp-toolbar .sp-search { flex: 1; min-width: 200px; }

.sp-layout { display: grid; gap: 16px; }
@media (min-width: 960px) {
  .sp-layout.is-split { grid-template-columns: minmax(0,1fr) minmax(320px, 420px); align-items: start; }
  .sp-sheet-desktop { position: sticky; top: 84px; }
}

.sp-cards { display: grid; gap: 12px; }
.sp-list { display: grid; gap: 12px; margin-top: 4px; }
.sp-hist-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.sp-hist-row .sp-card { flex: 1; min-width: 0; }
.sp-hist-del {
  flex: 0 0 48px;
  width: 48px;
  border-radius: 16px;
  border: 1px solid var(--paper-2);
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}
.sp-hist-del .material-symbols-rounded { font-size: 22px; }
@media (min-width: 720px) and (max-width: 959px) { .sp-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1180px) { .sp-layout.is-split .sp-cards { grid-template-columns: 1fr 1fr; } }

.sp-card {
  background: linear-gradient(180deg, var(--cream), var(--paper));
  color: var(--ink);
  border: 1px solid var(--paper-2);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
}
button.sp-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.sp-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 8px; }
.sp-filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-filter {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(246, 237, 216, .28);
  background: transparent;
  color: var(--cream);
  font: 600 13px var(--font-ui);
  cursor: pointer;
}
.sp-filter.is-on { background: var(--gold); color: var(--felt-deep); border-color: var(--gold); }
.sp-filter-players {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cream);
  font: 600 13px var(--font-ui);
}
.sp-filter-players input {
  width: 5.2rem;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid var(--paper-2);
  background: var(--cream);
  color: var(--ink);
  font: 16px var(--font-ui);
  padding: 0 10px;
}
.sp-filter-count { color: rgba(255, 248, 234, .72) !important; margin: 0 0 14px; }
.sp-empty { color: rgba(255, 248, 234, .72); }

.sp-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.sp-card h3 { margin: 0; font-size: 1.12rem; font-family: var(--font-display); font-weight: 650; }
.sp-meta { color: var(--muted); font-size: 12.5px; }
.sp-card-actions { display: flex; gap: 8px; margin-top: auto; }
.sp-card-actions .sp-btn, .sp-card-actions .sp-btn-ghost { flex: 1; }
.sp-card-actions .sp-btn-ghost { color: var(--ink); border-color: var(--line); background: var(--cream); }

.sp-sheet {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--paper-2);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.sp-sheet .sp-kicker { color: var(--felt); }
.sp-sheet .sp-lead { color: var(--ink); }
.sp-sheet .sp-h1 {
  color: var(--felt-deep);
  font-size: clamp(2.15rem, 7.2vw, 3.05rem);
  margin: 4px 0 8px;
}
.sp-sheet a:not(.sp-btn) {
  color: var(--felt);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sp-sheet a:not(.sp-btn):hover { color: var(--felt-mid); }
.sp-sheet-grab {
  position: relative;
  min-height: 28px;
  margin: -6px -6px 8px;
}
.sp-sheet-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 28px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
}
.sp-sheet-handle::before {
  content: "";
  width: 40px;
  height: 5px;
  border-radius: 99px;
  background: rgba(20, 53, 42, .35);
}
.sp-sheet-close {
  position: absolute;
  top: -4px;
  right: 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--felt-deep);
  font: 500 1.55rem/1 var(--font-ui);
  cursor: pointer;
}
.sp-sheet-close:hover { background: rgba(20, 53, 42, .08); }
.sp-overlay .sp-sheet--drawer { padding-top: 10px; }
.sp-sheet .sp-btn,
.sp-sheet .sp-btn-soft,
.sp-sheet .sp-btn-ghost {
  width: 100%;
  margin-top: 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sp-sheet .sp-btn-ghost {
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 700;
}
.sp-sheet .sp-btn-soft { color: var(--chip-ink); }
.sp-account .sp-tabs { margin-top: 0; }
.sp-sheet img { width: 100%; max-height: 220px; object-fit: contain; background: var(--cream); border-radius: 12px; }
.sp-tabs { display: flex; gap: 4px; background: var(--paper-2); padding: 4px; border-radius: 12px; margin: 14px 0; }
.sp-tab { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; font: 600 13px var(--font-ui); cursor: pointer; color: var(--muted); }
.sp-tab.is-on { background: var(--cream); color: var(--ink); }
.sp-prose { font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.sp-prose h2, .sp-prose h3, .sp-prose h4 { font-family: var(--font-display); margin: 1.1em 0 .4em; }
.sp-prose p { margin: .5em 0; }
.sp-prose ul, .sp-prose ol { padding-left: 1.2em; margin: .4em 0; }
.sp-prose blockquote { margin: .8em 0; padding: 10px 14px; background: var(--cream); border-left: 3px solid var(--gold); border-radius: 0 12px 12px 0; color: var(--felt); }
.sp-prose code { font-family: ui-monospace, monospace; font-size: .9em; background: var(--paper-2); padding: .05em .35em; border-radius: 6px; }
.sp-table-wrap { overflow-x: auto; margin: .8em 0; }
.sp-prose table, .sp-play table { border-collapse: collapse; width: 100%; font-size: 13px; }
.sp-prose th, .sp-prose td, .sp-play th, .sp-play td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.sp-note { font-size: 12.5px; color: var(--muted); background: var(--cream); border-radius: 10px; padding: 8px 10px; margin-top: 10px; }

.sp-field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; color: var(--ink); }
.sp-sheet .sp-field, .sp-pad .sp-field { color: var(--ink); }
.sp-field label { font-size: 13px; font-weight: 600; }
.sp-field input, .sp-field select, .sp-num, .sp-pad select, .sp-play select {
  min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; font: 16px var(--font-ui); background: var(--cream); color: var(--ink);
}
.sp-names { display: grid; gap: 8px; }
@media (min-width: 720px) { .sp-names { grid-template-columns: 1fr 1fr; } }

.sp-play-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.sp-code-box {
  display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--gold-2);
  padding: 8px 10px 8px 14px; border-radius: 12px; font-family: ui-monospace, monospace; letter-spacing: .16em;
}
.sp-seats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin: 8px 0 12px; }
.sp-seat {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(246, 237, 216, .28); background: transparent;
  color: var(--cream); white-space: nowrap; cursor: pointer; font: 600 13px var(--font-ui);
}
.sp-seat.is-on { background: var(--gold); color: var(--felt-deep); border-color: var(--gold); }
.sp-play-grid { display: grid; gap: 12px; }
@media (min-width: 900px) {
  .sp-play-grid.is-wide { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
.sp-pad {
  background: var(--paper); color: var(--ink); border: 1px dashed var(--wood-edge);
  border-radius: 14px; padding: 14px; overflow: auto;
  background-image: repeating-linear-gradient(transparent, transparent 27px, rgba(92, 58, 30, .08) 28px);
}
.sp-pad h4 { margin: 0 0 8px; font-family: var(--font-display); }
.sp-cell, .sp-score-in {
  width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; text-align: center;
  font: 600 14px var(--font-ui); background: var(--cream); color: var(--ink);
}
.sp-cell.is-filled { background: #f3e4b8; }
.sp-cell.is-zero { background: var(--paper-2); color: var(--muted); }
.sp-cat-row { display: grid; grid-template-columns: 1fr 72px; gap: 8px; align-items: center; padding: 4px 0; }
.sp-sheet-block {
  display: grid;
  grid-template-columns: 1.35rem 1fr;
  column-gap: 8px;
  align-items: stretch;
  margin: 6px 0 10px;
}
.sp-part-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
}
.sp-part-rail span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 700 12px var(--font-ui);
  color: var(--ink);
  letter-spacing: .04em;
  white-space: nowrap;
  line-height: 1;
}
.sp-part-rail::after {
  content: "";
  flex: 1 1 auto;
  width: 5px;
  min-height: 12px;
  margin-top: 6px;
  background: var(--ink);
  border-radius: 2px;
}
.sp-part-body { min-width: 0; }
.sp-cat-row.is-sum { padding: 0; }
.sp-cat-row.is-sum span { font-weight: 650; color: var(--felt); font-size: 12.5px; }
.sp-cat-row.is-sum .sp-readout { min-height: 20px; font-size: 12.5px; }
.sp-readout {
  min-height: 36px;
  display: grid;
  place-items: center;
  text-align: center;
  font: 700 14px var(--font-ui);
  color: var(--ink);
}
.sp-total { font-weight: 800; font-size: 1.35rem; font-family: var(--font-display); color: var(--felt); }
.sp-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sp-qwixx-row { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0; }
.sp-chip {
  min-width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--cream);
  font: 700 12px var(--font-ui); cursor: pointer; color: var(--ink);
}
.sp-chip.is-on { color: #fff; }
.sp-row-red .sp-chip.is-on { background: #c44536; }
.sp-row-yellow .sp-chip.is-on { background: #d4a017; }
.sp-row-green .sp-chip.is-on { background: #1c4a3a; }
.sp-row-blue .sp-chip.is-on { background: #2a4a6b; }
.sp-overlay {
  position: fixed; inset: 0; background: rgba(8, 20, 14, .62); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  padding: env(safe-area-inset-bottom) 0 0;
}
@media (min-width: 720px) {
  .sp-overlay { align-items: center; padding: 24px; }
  .sp-overlay .sp-sheet { max-width: 640px; max-height: min(86vh, 900px); overflow: auto; width: 100%; }
}
.sp-overlay .sp-sheet { width: 100%; max-height: 92dvh; overflow: auto; border-radius: 1.25rem 1.25rem 0 0; }
@media (min-width: 720px) { .sp-overlay .sp-sheet { border-radius: var(--radius); } }

.sp-empty { text-align: center; color: rgba(255,248,234,.7); padding: 28px 12px; }
.sp-back {
  background: none; border: 0; color: var(--gold-2); font: 600 13.5px var(--font-ui);
  cursor: pointer; min-height: 44px; padding: 0; display: inline-flex; align-items: center; gap: 4px;
}

#spTotals { color: var(--gold-2) !important; }

.sp-top--play { gap: 6px; }
.sp-play-id { flex: 1; min-width: 0; }
.sp-play-title {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.08rem;
  color: var(--gold-2);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-play-sub {
  font-size: 12px;
  color: rgba(255, 248, 234, .72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.sp-body.sp-playing { overflow: hidden; height: 100dvh; }
.sp-body.sp-playing .sp-app { height: 100dvh; overflow: hidden; }
.sp-body.sp-playing .sp-app::before {
  box-shadow: inset 0 0 0 4px var(--wood), inset 0 0 0 5px var(--wood-edge);
  opacity: .28;
}
.sp-body.sp-playing .sp-top {
  padding: calc(6px + env(safe-area-inset-top)) 10px 6px;
}
.sp-body.sp-playing .sp-root {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  padding: 6px 10px 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sp-body.sp-playing .sp-seats { margin: 0 0 6px; padding-bottom: 0; flex-shrink: 0; }
.sp-body.sp-playing .sp-seat { min-height: 34px; padding: 0 12px; }
.sp-body.sp-playing #spEngine { flex: 1; min-height: 0; overflow: auto; }
.sp-end-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 16px 0 calc(8px + env(safe-area-inset-bottom));
  margin-top: 4px;
}
.sp-end-bar .sp-btn-soft,
.sp-end-bar .sp-btn-ghost {
  flex: 1 1 9.5rem;
  max-width: 18rem;
}
.sp-end-bar .sp-meta { margin: 0; text-align: center; }
.sp-player-list { display: grid; gap: 8px; margin: 0 0 8px; }
.sp-player-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  font: 600 14px var(--font-ui);
  cursor: pointer;
  text-align: left;
}
.sp-player-score.is-on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(232, 184, 74, .35); }
.sp-player-score strong { font-variant-numeric: tabular-nums; }
.sp-body.sp-playing .sp-pad {
  padding: 8px 10px;
  background-image: repeating-linear-gradient(transparent, transparent 23px, rgba(92, 58, 30, .07) 24px);
}
.sp-body.sp-playing .sp-pad h4 { margin: 0 0 4px; font-size: 1rem; }
.sp-body.sp-playing .sp-cat-row { padding: 1px 0; gap: 6px; grid-template-columns: 1fr 58px; }
.sp-body.sp-playing .sp-cat-row.is-sum { padding: 0; }
.sp-body.sp-playing .sp-play-grid { gap: 8px; }

.sp-score-cell {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font: 650 14px var(--font-ui);
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
  padding: 0 4px;
}
.sp-score-cell.is-filled { background: #f3e4b8; }
.sp-score-cell:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.sp-score-pop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sp-score-pop[hidden] { display: none; }
.sp-score-pop-bg {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 20, 14, .62);
  cursor: pointer;
}
.sp-score-sheet {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 1.25rem 1.25rem 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
.sp-score-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--felt);
  text-align: center;
}
.sp-score-readout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
  align-items: stretch;
}
.sp-score-readout[hidden] { display: none !important; }
.sp-score-readout.has-sign { grid-template-columns: 56px 1fr; }
.sp-score-sign {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  font: 700 1.35rem var(--font-ui);
  cursor: pointer;
  touch-action: manipulation;
}
.sp-score-sign[hidden] { display: none !important; }
.sp-score-display {
  min-height: 52px;
  border-radius: 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font: 700 1.7rem var(--font-display);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.sp-score-display[hidden] { display: none !important; }
.sp-score-fixed { display: grid; gap: 8px; margin-bottom: 10px; }
.sp-score-fixed .sp-btn, .sp-score-fixed .sp-btn-ghost { width: 100%; }
.sp-score-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.1rem, 1fr));
  gap: 8px;
}
.sp-score-scratch.is-on {
  background: #2f5c3a;
  border-color: #2f5c3a;
  color: #f7f0dc;
}
.sp-choice-val {
  min-height: 44px;
  border: 1px solid var(--line, #c9b27a);
  border-radius: 10px;
  background: var(--cream, #f7f0dc);
  color: var(--ink, #1c1408);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.sp-choice-val.is-on {
  background: #2f5c3a;
  border-color: #2f5c3a;
  color: #f7f0dc;
}
.sp-score-keys[hidden], .sp-score-fixed[hidden] { display: none !important; }
.sp-score-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.sp-score-keys button {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  font: 700 1.2rem var(--font-ui);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.sp-score-keys button[data-k="back"] {
  grid-column: span 2;
  font-size: 1.45rem;
}
.sp-score-bar { display: flex; gap: 8px; }
.sp-score-bar .sp-btn, .sp-score-bar .sp-btn-ghost { flex: 1; min-height: 44px; }
.sp-score-sheet .sp-btn-ghost {
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 700;
}
@media (min-width: 720px) {
  .sp-score-pop { align-items: center; padding: 24px; }
  .sp-score-sheet { border-radius: var(--radius); padding-bottom: 16px; }
}

@media (max-width: 420px) {
  .sp-library { font-size: 0; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; }
  .sp-library::before { content: "↩"; font-size: 16px; }
}

.sp-dialog { z-index: 50; }
.sp-dialog-sheet { max-width: 26rem; margin: auto; border-radius: var(--radius) !important; }
.sp-dialog-sheet .sp-kicker { color: var(--felt); }
.sp-dialog-sheet .sp-lead { color: var(--ink); max-width: none; }
.sp-dialog-actions { display: flex; gap: 10px; margin-top: 4px; }
.sp-dialog-actions .sp-btn,
.sp-dialog-actions .sp-btn-ghost {
  flex: 1;
  min-height: 44px;
  width: auto;
  margin-top: 0;
}
.sp-dialog-actions .sp-btn {
  background: var(--felt);
  color: var(--cream);
  box-shadow: none;
}
.sp-dialog-actions .sp-btn-ghost {
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 700;
}
.sp-ios-steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 12px;
}
.sp-ios-steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.45;
}
.sp-ios-steps .material-symbols-rounded {
  color: var(--felt);
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}
