/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:  #0f4f2b;
  --green-mid:   #1a6b3c;
  --green-light: #2d8a52;
  --gold:        #d4a833;
  --gold-light:  #f0c84a;
  --tile-bg:     #fdf6e3;
  --tile-border: #c8a96e;
  --tile-shadow: #9a7040;
  --text:        #1a1a1a;
  --text-light:  #666;
  --bg:          #0f4f2b;
  --surface:     #ffffff;
  --radius:      8px;
  --font-tile:   'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  overflow-x: hidden;
}
@media (min-width: 700px) {
  html, body { font-size: 19px; }
  .screen { max-width: 720px; }
  .step-footer { max-width: 720px; }
  .wild-picker-panel { max-width: 720px; }
  .tile-btn { width: 40px; height: 52px; }
  .tile-chip { width: 44px; height: 57px; }
  .tile-chip .chip-remove { width: 22px; height: 22px; top: -7px; right: -7px; font-size: 0.85rem; }
  .suit-pip { width: 22px; }
  .meld-tiles { min-height: 58px; }
}

/* ── Screens ──────────────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 72px;
}
.screen.active { display: flex; }

/* ── Header ───────────────────────────────────────────────── */
header {
  background: var(--green-dark);
  padding: 10px 14px 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
header h1 {
  font-size: 1.1rem;
  color: var(--gold);
  white-space: nowrap;
  flex: 1;
}
.version-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.step-indicator {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
}
.progress-pill {
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
}
.btn-back {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}
.btn-back:hover { background: rgba(255,255,255,0.1); }

/* ── Compact Palette ──────────────────────────────────────── */
.palette-section {
  padding: 8px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: opacity 0.15s;
}
.palette-section.no-active-meld { opacity: 0.55; }
.palette-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.suit-pip {
  font-size: 0.78rem;
  font-weight: 700;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}
.suit-pip.suit-b { color: #6fcf97; }
.suit-pip.suit-m { color: #eb9898; }
.suit-pip.suit-p { color: #90b4e8; }
.suit-pip.suit-z { color: #c9a0f0; }
.suit-pip.suit-f { color: var(--gold-light); }

.tile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  flex: 1;
}

/* ── Compact Tile Button ──────────────────────────────────── */
.tile-btn {
  position: relative;
  width: 37px;
  height: 48px;
  background: var(--tile-bg);
  border: 1.5px solid var(--tile-border);
  border-bottom: 3px solid var(--tile-shadow);
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s, box-shadow 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}
.tile-btn:active { transform: translateY(2px); border-bottom-width: 1px; }
.tile-btn.depleted { opacity: 0.25; pointer-events: none; }
.tile-btn.selected-palette {
  border-color: var(--gold);
  border-bottom-color: #a07010;
  box-shadow: 0 0 0 2px var(--gold);
  transform: translateY(-3px);
  background: #fffbe8;
}

.tile-face {
  font-size: 1.4rem;
  line-height: 1;
  font-family: var(--font-tile);
}
.tile-count-badge {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 0.62rem;
  color: var(--green-mid);
  font-weight: 700;
  line-height: 1;
}

/* Suit colour coding */
.tile-btn.suit-b .tile-face { color: #155724; }
.tile-btn.suit-m .tile-face { color: #7b1010; }
.tile-btn.suit-p .tile-face { color: #0a3d6b; }
.tile-btn.suit-z .tile-face { color: #4a2080; }
.tile-btn.suit-f .tile-face { color: #7b6000; }

/* Flower badge next to flower row */
.flower-badge {
  background: var(--gold);
  color: var(--green-dark);
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Selection Hint ───────────────────────────────────────── */
.selection-hint {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
  text-align: center;
  padding: 4px 10px 7px;
  transition: color 0.2s;
}
.selection-hint.has-selection {
  color: var(--gold-light);
}

/* ── Melds Grid ───────────────────────────────────────────── */
.melds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 10px;
  margin-bottom: 8px;
}

.meld-slot {
  background: rgba(0,0,0,0.2);
  border: 1.5px dashed rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 7px 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.meld-slot.active-meld {
  border-style: solid;
  border-color: var(--gold);
  background: rgba(212,168,51,0.15);
  box-shadow: 0 0 0 2px var(--gold);
}
.meld-slot.slot-full {
  border-style: solid;
  border-color: rgba(255,255,255,0.15);
}

.meld-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  gap: 4px;
}
.meld-title {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
}
.meld-controls {
  display: flex;
  gap: 3px;
  align-items: center;
}
.meld-type-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  min-width: 20px;
  text-align: center;
}
.meld-type-badge[data-valid="0"] {
  background: rgba(200, 50, 50, 0.4);
  color: #ff9999;
}
.concealed-toggle {
  font-size: 0.85rem;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12);
  color: #fff;        /* full color for exposed 👁 */
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.concealed-toggle.is-concealed {
  background: rgba(212,168,51,0.2);
  border-color: var(--gold);
  opacity: 0.65;      /* dim the 🙈 to show it's hidden */
}

.meld-tiles {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  min-height: 54px;
  align-items: center;
}
.meld-empty-hint {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.25);
  font-style: italic;
}

/* ── Tile Chip (in melds) ─────────────────────────────────── */
.tile-chip {
  position: relative;
  width: 41px;
  height: 54px;
  background: var(--tile-bg);
  border: 1.5px solid var(--tile-border);
  border-bottom: 3px solid var(--tile-shadow);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-tile);
  flex-shrink: 0;
}
.tile-chip .chip-face { font-size: 1.35rem; line-height: 1; }
.tile-chip .chip-label { font-size: 0.55rem; color: var(--text-light); line-height: 1; }
.tile-chip .chip-remove {
  position: absolute;
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.tile-chip.suit-b .chip-face { color: #155724; }
.tile-chip.suit-m .chip-face { color: #7b1010; }
.tile-chip.suit-p .chip-face { color: #0a3d6b; }
.tile-chip.suit-z .chip-face { color: #4a2080; }
.tile-chip.suit-f .chip-face { color: #7b6000; }

/* Wildcard tile */
.tile-chip.is-wild {
  border-color: var(--gold);
}
.wild-sub-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 4px;
}
.wild-sub-btn {
  font-size: 0.6rem;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: rgba(212,168,51,0.1);
  color: var(--gold);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wild-sub-btn.has-sub {
  background: var(--gold);
  color: var(--green-dark);
  font-weight: 700;
}
.wild-badge {
  position: absolute;
  bottom: 1px; right: 2px;
  font-size: 0.55rem;
  color: var(--gold);
  font-weight: 700;
  line-height: 1;
}

/* Winning tile */
.tile-chip.is-winning {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold);
  cursor: pointer;
}
.win-star {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  color: var(--gold);
  line-height: 1;
}

/* ── Won From Bar ─────────────────────────────────────────── */
.won-from-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.2);
  margin: 0 10px 8px;
  border-radius: var(--radius);
  border: 1.5px solid rgba(255,255,255,0.1);
}
.won-from-bar.missing {
  border-color: #e74c3c;
  background: rgba(231,76,60,0.1);
}
.won-from-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  flex-shrink: 0;
}
.won-from-btns {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.won-from-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.won-from-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--green-dark);
  font-weight: 700;
}

.dealer-substream {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 24px;
  margin: -6px 10px 8px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(0,0,0,0.12);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-top: none;
}
.dealer-substream-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.5);
  flex: 1;
}
.streak-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.streak-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.streak-btn:active { background: rgba(255,255,255,0.18); }
.streak-value {
  width: 38px;
  text-align: center;
  padding: 4px 0;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  -moz-appearance: textfield;
}
.streak-value::-webkit-inner-spin-button,
.streak-value::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.wild-count-badge {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255,215,0,0.18);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 600;
}

/* ── Ruleset Bar ──────────────────────────────────────────── */
.ruleset-bar {
  background: var(--green-dark);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ruleset-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}
.ruleset-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.ruleset-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 600;
}

/* ── Wild Tile Bar ────────────────────────────────────────── */
.wild-tile-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin: 0 10px 8px;
}
.wild-tile-btn {
  padding: 5px 14px;
  border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  display: flex;
  align-items: center;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
}
.wild-tile-btn.active {
  background: rgba(212,168,51,0.15);
  border-color: var(--gold);
  color: #fff;
}

/* ── Win Conditions (collapsible) ────────────────────────── */
.conditions-details {
  background: var(--surface);
  margin: 0 10px 10px;
  border-radius: var(--radius);
  overflow: hidden;
}
.conditions-details summary {
  list-style: none;
  padding: 11px 14px;
  background: var(--green-mid);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.conditions-details summary::-webkit-details-marker { display: none; }
.conditions-details .caret {
  transition: transform 0.2s;
  font-size: 0.75rem;
}
.conditions-details[open] .caret { transform: rotate(90deg); }

.conditions-body {
  padding: 4px 14px 10px;
}

.condition-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  gap: 8px;
}
.condition-row:last-child { border-bottom: none; }
.condition-row label:first-child {
  font-size: 0.82rem;
  color: var(--text);
  flex: 1;
}

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #ccc; border-radius: 24px;
  transition: background 0.2s;
  cursor: pointer;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--green-mid); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

.number-input {
  width: 58px;
  text-align: center;
  padding: 5px;
  border: 1.5px solid #ddd;
  border-radius: var(--radius);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.number-input[readonly] {
  background: #f0f0f0;
  border-color: #e0e0e0;
  color: #666;
  cursor: default;
  -moz-appearance: textfield;
}
.number-input[readonly]::-webkit-inner-spin-button,
.number-input[readonly]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.select-input {
  flex: 1;
  max-width: 210px;
  padding: 5px 7px;
  border: 1.5px solid #ddd;
  border-radius: var(--radius);
  font-size: 0.78rem;
  background: #fff;
}

/* ── Step Footer ──────────────────────────────────────────── */
.step-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 640px;
  background: linear-gradient(transparent, var(--green-dark) 40%);
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 20;
}
.btn-primary {
  background: var(--gold);
  color: var(--green-dark);
  border: none;
  border-radius: var(--radius);
  padding: 13px 0;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary:not(:disabled):active { transform: scale(0.97); }

.btn-ghost-footer {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.75);
  padding: 13px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Wildcard Picker Overlay ──────────────────────────────── */
.wild-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.wild-picker-panel {
  background: var(--green-dark);
  width: 100%;
  max-width: 640px;
  border-radius: 16px 16px 0 0;
  padding: 16px 14px 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 72vh;
  overflow-y: auto;
}
.wild-picker-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  text-align: center;
}
.wild-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

/* ══════════════════════════════════════════════════════════ RESULTS */

.results-hero {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  padding: 24px 16px;
  text-align: center;
}
.total-fan-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.total-fan-value {
  font-size: 4rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.results-hand-preview {
  background: rgba(0,0,0,0.25);
  padding: 10px 14px;
}
.results-tiles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.preview-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
}
.preview-melds-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}
.preview-meld-group {
  display: flex;
  gap: 3px;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 4px;
}

.results-table-wrap {
  background: var(--surface);
  margin: 12px;
  border-radius: var(--radius);
  overflow: hidden;
}
.results-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--green-mid);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}
.show-zero-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 400;
  cursor: pointer;
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.results-table th {
  background: #f5f5f5;
  padding: 8px 10px;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.05em;
}
.fan-col { text-align: right; }
.results-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table tr.zero-row { opacity: 0.4; display: none; }
.results-table tr.zero-row.show { display: table-row; }
.rule-name-zh { font-weight: 600; }
.rule-name-en { font-size: 0.75rem; color: var(--text-light); }
.fan-value { font-weight: 700; text-align: right; color: var(--green-mid); }
.fan-value.zero { color: #ccc; }
.category-cell { font-size: 0.75rem; color: var(--text-light); }

/* ── Ruleset view button ──────────────────────────────────── */
.ruleset-view-btn {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-size: 0.72rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.12s, border-color 0.12s;
}
.ruleset-view-btn:hover { color: rgba(255,255,255,0.9); border-color: rgba(255,255,255,0.5); }

/* ══════════════════════════════════════════════════════════ RULES SCREEN */

.rules-table-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rules-section {}

.rules-category-header {
  background: var(--green-mid);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 6px 10px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.rules-ref-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  font-size: 0.82rem;
}
.rules-ref-table tr { border-bottom: 1px solid #eee; }
.rules-ref-table tr:last-child { border-bottom: none; }
.rules-ref-table td { padding: 7px 10px; vertical-align: middle; }

.rr-name { white-space: nowrap; width: 1%; }
.rr-zh { font-weight: 700; display: block; }
.rr-py { font-size: 0.68rem; color: var(--text-light); display: block; }

.rr-desc { color: var(--text); line-height: 1.35; }
.rr-fan {
  text-align: right;
  font-weight: 800;
  font-size: 1rem;
  color: var(--green-mid);
  white-space: nowrap;
  width: 1%;
  padding-left: 6px;
}

.cond-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}
.cond-badge.auto   { background: #e8f5e9; color: #2e7d32; }
.cond-badge.manual { background: #fff3e0; color: #e65100; }
.cond-badge.count  { background: #e3f2fd; color: #1565c0; }

/* ── Live Score Bar ───────────────────────────────────────── */
.live-score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(0,0,0,0.25);
  margin: 0 10px 8px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.1);
  flex-wrap: wrap;
}
.live-score-total {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}
.live-score-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.live-chip {
  font-size: 0.7rem;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 2px 7px;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
}
