
    /* Oculta el banner fijo de Somee */
    div[style*="position: fixed"][style*="bottom: 0px"][style*="height: 65px"],
    div[style*="z-index: 2147483647"][style*="bottom: 0px"],
    div[onmouseover*="S_ssac()"],
    div[style*="background-color: #202020"],
    a[href*="somee.com/VirtualServer.aspx"],
    a[href*="somee.com"] {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }

    /* Elimina el espacio vacío que deja */
    div[style*="height: 65px"] {
        display: none !important;
        height: 0 !important;
    }

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --text: #1a1d23;
  --text-dim: #6b7280;
  --accent: #2563eb;
  --accent-2: #374151;
  --danger: #dc2626;
  --good: #16a34a;
  --warn: #d97706;
  --border: #e2e4e9;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a;
    --surface: #1e2126;
    --surface-2: #262a31;
    --text: #eef0f3;
    --text-dim: #9aa1ac;
    --accent: #2563eb;
    --accent-2: #374151;
    --danger: #ef4444;
    --warn: #f59e0b;
    --border: #33373f;
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
  }
}
:root[data-theme="dark"] {
  --bg: #14161a;
  --surface: #1e2126;
  --surface-2: #262a31;
  --text: #eef0f3;
  --text-dim: #9aa1ac;
  --accent: #2563eb;
  --accent-2: #374151;
  --danger: #ef4444;
  --warn: #f59e0b;
  --border: #33373f;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 150px;
  min-height: 100vh;
}
header {
  padding: 14px 16px 10px;
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
header h1 { margin: 0 0 4px; font-size: 1.15rem; }
.subtitle { color: var(--text-dim); font-size: 0.8rem; }
main { padding: 14px 16px 24px; max-width: 640px; margin: 0 auto; }
.hidden { display: none !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.marcador-mini {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  font-size: 1.1rem; font-weight: 700; margin: 2px 0;
}
.mm-eq1 { color: var(--accent); font-size: 1.3rem; }
.mm-eq2 { color: var(--accent-2); font-size: 1.3rem; }
.mm-lbl { font-size: 0.62rem; font-weight: 600; color: var(--text-dim); }
.mm-sep { color: var(--text-dim); font-weight: 400; }

.rally-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 34px;
  padding: 8px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 12px;
}

/* reserve visual space for two lines of chips so layout doesn't jump */
.rally-chips { min-height: 54px; }

.rally-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.rally-count { font-weight:700; color:var(--text); font-size:0.85rem; }
.rally-list { display:flex; flex-wrap: wrap; gap:6px; max-height: 20vh; overflow-y: auto; padding-right:6px; }
.rally-chips.full .rally-list { max-height: 40vh; }

/* (mobile height limit removed to rollback previous change) */
.chip {
  font-size: 0.72rem;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.chip.eq1 { border-color: var(--accent); }
.chip.eq2 { border-color: var(--accent-2); }
.chip.err { background: var(--danger); color: #fff; border-color: var(--danger); }
.chip.win { background: var(--accent); color: #fff; border-color: var(--accent); }
.empty-hint { color: var(--text-dim); font-size: 0.8rem; padding: 6px; }

.pos-row { margin-bottom: 8px; }
.pos-label { font-size: 0.68rem; font-weight: 700; color: var(--text-dim); margin-bottom: 4px; letter-spacing: 0.02em; }
.pos-buttons { display: flex; gap: 8px; justify-content: center; }
.team-block { margin: 6px; padding: 8px; border-radius: 10px; background: transparent; }
.team-title { font-size: 0.78rem; font-weight: 800; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; }
.split-btn { display: flex; align-items: stretch; gap: 2px; border-radius: 12px; overflow: hidden; }
.split-btn .gbtn2 { border-radius: 0; padding: 12px 10px; font-size: 0.85rem; flex: 1; }
.split-btn .split-left { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.split-btn .split-right { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
.split-btn .split-left { border-right: 1px solid rgba(255,255,255,0.08); }

#courtGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; }
#courtGrid .team-block { background: var(--surface-2); border: 1px solid var(--border); }

/* Responsive mobile-specific court area behavior reverted. */

/* Keep court buttons visible on small screens: make the rally list scrollable and
   the court grid sticky within the registrar card so the button area doesn't
   get pushed off-screen as the rally grows. */
@media (max-width: 640px) {
  /* limit rally list height inside registrar card */
  #tab-registrar .card .rally-chips { max-height: 18vh; overflow-y: auto; }

  /* make court area sticky so it remains visible while scrolling the page */
  #tab-registrar .card { position: relative; }
  #tab-registrar #courtGrid { position: sticky; top: 110px; z-index: 2; background: transparent; }

  /* slightly tighter buttons for mobile */
  #tab-registrar .split-btn .gbtn2 { padding: 12px 8px; }
}
.gbtn2 {
  padding: 16px 6px;
  border-radius: 12px;
  border: none;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}
.gbtn2.eq1 { background: var(--accent); }
.gbtn2.eq2 { background: var(--accent-2); }
.gbtn2.eq1 { background: #2563eb !important; }
.gbtn2.eq2 { background: #374151 !important; }
.gbtn2:active { transform: scale(0.97); }
.gbtn2.disabled, .gbtn2[disabled] { opacity: 0.45; pointer-events: none; }
.pos-divider { border-top: 2px dashed var(--border); margin: 4px 0 10px; }

.btn {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  width: 100%;
}
.btn.ghost { background: transparent; }
.btn.small { width: auto; padding: 7px 12px; font-size: 0.78rem; }

.accion-bar {
  position: fixed; left: 0; right: 0; bottom: 60px;
  display: flex; gap: 8px;
  padding: 10px 16px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 8;
}
.accion-btn {
  flex: 1;
  padding: 10px 6px;
  border-radius: 12px;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.5;
}
.accion-btn span { font-weight: 500; font-size: 0.66rem; opacity: 0.9; }
.accion-btn.erra { background: var(--danger); }
.accion-btn.gana { background: var(--accent); }
.accion-btn:disabled { opacity: 0.35; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 10;
}
.tabbar button {
  flex: 1;
  padding: 12px 4px 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 600;
}
.tabbar button.active { color: var(--accent-2); }
.tabbar .ic { display:block; font-size: 1.1rem; margin-bottom: 2px; }

select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  margin-bottom: 10px;
}
input[type=text] {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

h2 { font-size: 1rem; margin: 0 0 10px; }
.stat-row { display:flex; justify-content: space-between; align-items:center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }
.stat-name { font-size: 0.85rem; }
.stat-sub { font-size: 0.7rem; color: var(--text-dim); }
.stat-pct { font-weight: 700; font-size: 0.95rem; }
.pct-bad { color: var(--danger); }
.pct-mid { color: var(--warn); }
.pct-ok { color: var(--accent); }
.matchup-good { color: var(--good); }
.matchup-bad { color: var(--danger); }
.match-item { display:flex; justify-content: space-between; align-items:center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.match-item:last-child { border-bottom: none; }
.toast {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 8px 16px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  z-index: 50; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.toast.show { opacity: 1; }
