/* ─── TRACKBET web-app — estilos propios del celular (2026-09-28, MANUAL 21) ──
   Van ENCIMA de las copias iguales (evo-bpv.css, tarjeta-cruce.css,
   historial-fechas.css, sidepanel-bpv.css). Aquí solo lo que cambia en el
   teléfono: diseño B de la muestra (zonas abajo), buscador escondido tras la
   lupa, ⚙ Config como hoja de abajo, pantallas de entrada y espera. */

/* ── Siempre oscura, como TRACKBET (el Viewer sigue el tema del sistema) ── */
:root {
  --bg: #1a1a18; --surface: #252523; --surface-2: #2e2e2b;
  --border: rgba(255,255,255,0.10); --border-strong: rgba(255,255,255,0.20);
  --text: #f0efe9; --text-2: #a8a8a0; --text-3: #686860;
  --accent: #5a9fe0; --accent-bg: #0d2a4a; --success: #4aae7a; --success-bg: #0a2a1a;
  --warn: #e0a030; --warn-bg: #2a1a00; --danger: #e05545; --danger-bg: #2a0a08;
  --star: #e0a030; --star-border: #c08820;
  --verde: #28cc95;
  --abajo: env(safe-area-inset-bottom, 0px);   /* la franja de abajo del iPhone */
  --arriba: env(safe-area-inset-top, 0px);
}
/* Las reglas "modo oscuro" de las copias, siempre activas */
.menu-op[style*="--mc"] { color: oklch(from var(--mc) max(l, 0.72) c h); }
.evo-tab[style*="--tc"] { color: oklch(from var(--tc) max(l, 0.72) c h); }
.evo-sub .casa[style*="--cc"], .evo-ca .casa[style*="--cc"], .evo-chip[style*="--cc"] .k,
.evo-tbl td[style*="--cc"], .evo-pre .evo-tag[style*="--cc"] { color: oklch(from var(--cc) max(l, 0.72) c h) !important; }

html { height: 100%; background: #0e0e0e; }
body { height: 100%; height: 100dvh; font-size: 13px; -webkit-tap-highlight-color: transparent; background: var(--bg); }
button { -webkit-touch-callout: none; user-select: none; }
.hidden { display: none !important; }

/* ── Cabecera: TRACKBET · En vivo · 🔍 · ⚙ ── */
.header { padding: calc(8px + var(--arriba)) 14px 10px; }
.header-title { font-family: 'Lexend', sans-serif; font-size: 17px; font-weight: 800; letter-spacing: .04em; }
.header-title b { color: var(--verde); }
.icon-btn { width: 36px; height: 36px; }
#btn-buscar.on { color: var(--verde); }

/* ── Buscador escondido (Carlos): la lupa lo baja; ✕ lo cierra y borra ── */
.toolbar { display: none; padding: 6px 12px 4px !important; }
.toolbar.abierta { display: block; }
.busca { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 4px 0 11px; border-radius: 10px;
  background: #1b1b1e; border: 1px solid #2c2c30; transition: border-color .18s, box-shadow .18s; }
.busca:focus-within { border-color: var(--verde); box-shadow: 0 0 0 2px rgba(40,204,149,.16); }
.busca-lupa { color: #6b6b72; flex-shrink: 0; transition: color .18s; }
.busca:focus-within .busca-lupa, .busca.con .busca-lupa { color: var(--verde); }
/* Letra de 16 px: el iPhone no hace zoom solo al tocar la casilla */
.busca .search-input { flex: 1; min-width: 0; background: none !important; border: 0 !important; outline: none !important; box-shadow: none !important;
  font: 400 16px 'Lexend', sans-serif !important; color: #fff !important; padding: 0 !important; height: 100%; }
.busca .search-input::placeholder { color: #6b6b72; font-weight: 300; font-size: 14px; }
.busca .search-input::-webkit-search-cancel-button { display: none; }
.busca-x { width: 26px; height: 26px; border-radius: 50%; border: 0; background: #2c2c30; color: #ccc; font-size: 11px; cursor: pointer; flex-shrink: 0; }

.subtab { padding: 6px 10px !important; }
.acciones-zona:empty, .acciones-zona:has(> .hidden) { display: none; }
.acciones-zona { padding: 6px 12px 0; background: var(--surface); }
.acciones-zona .zona-accion { margin: 0; padding: 5px 10px; font-size: 11px; }

/* Botones de la tarjeta un poco más grandes: se tocan con el dedo */
.cr-acts .tb-btn, .cr-acts .tb-link { min-width: 30px; min-height: 28px; font-size: 14px; }
.cards-container { padding: 10px 12px 14px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.toast { font-family: 'Lexend', sans-serif; font-size: 12px; bottom: calc(96px + var(--abajo)); border-radius: 10px; padding: 8px 14px; white-space: pre-line; }

/* ── Zonas abajo (diseño B), al alcance del pulgar ── */
.tabbar { display: flex; background: var(--surface); border-top: 0.5px solid var(--border-strong); padding: 4px 2px calc(8px + var(--abajo)); flex-shrink: 0; }
.tabbar .zona { flex: 1; flex-direction: column; gap: 1px; padding: 6px 0 2px; font-size: 9.5px; letter-spacing: .04em;
  border-bottom: 0; border-top: 2px solid transparent; position: relative; }
.tabbar .zona.active { border-top-color: var(--zc); }
.tabbar .zona .ico { font-size: 20px; line-height: 1.1; filter: saturate(.8); }
.tabbar .zona-n { position: absolute; top: 2px; left: calc(50% + 8px); font-size: 9px; padding: 0 5px; }
.footer { display: none; }

/* ── Hojas de abajo (⚙ Config) ── */
.hoja-fondo { position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.hoja-fondo.show { opacity: 1; pointer-events: auto; }
.hoja-x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: #3a3a3c; color: #bbb; font-size: 14px; cursor: pointer; }
.cfg { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: #141416; border-radius: 16px 16px 0 0;
  padding: 14px 16px calc(24px + var(--abajo)); transform: translateY(105%); transition: transform .28s ease; font-family: 'Lexend', sans-serif; color: #eee;
  max-height: 88dvh; display: flex; flex-direction: column; }
.cfg.show { transform: translateY(0); }
.cfg-cuerpo { overflow-y: auto; min-height: 0; }
.cfg-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; flex-shrink: 0; }
.cfg-top b { font-size: 15px; font-weight: 700; }
.cfg-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid #2a2a2e; font-size: 13.5px; }
.cfg-fila > span { flex: 1; }
.cfg-fila small { display: block; color: #888; font-size: 11px; line-height: 1.4; margin-top: 2px; font-weight: 300; }
.cfg-fila .tb-idioma { margin: 0; flex-shrink: 0; }
/* (Carlos) Nombre y cuenta: lo que se llena va en la fila de abajo, no al lado */
.cfg-col { flex-direction: column; align-items: stretch; gap: 8px; }
.cfg-caja { background: #1b1b1e; border: 1px solid #333; border-radius: 12px; padding: 11px 14px; color: var(--verde); font-weight: 600; font-size: 14px; word-break: break-all; }
.cfg-edit { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; }
.cfg-edit input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--verde); font: 600 16px 'Lexend', sans-serif; }
.cfg-edit input::placeholder { color: #555; font-weight: 300; }
.cfg-edit button { font: 600 12px 'Lexend', sans-serif; background: #2a2a2e; color: #ddd; border: 0; border-radius: 9px; padding: 8px 12px; cursor: pointer; }
.cfg-edit button.listo { background: var(--verde); color: #04110c; }
.cfg-btn { width: 100%; font: 600 14px 'Lexend', sans-serif; background: var(--verde); color: #04110c; border: 0; border-radius: 12px; padding: 11px; cursor: pointer; }
.cfg-estado { font-size: 11px; color: #777; padding: 12px 2px 0; line-height: 1.5; }
.cfg-salir { margin-top: 14px; width: 100%; font: 600 14px 'Lexend', sans-serif; background: none; border: 1px solid #e53935; color: #e53935; border-radius: 12px; padding: 11px; cursor: pointer; }
/* Lista de usuarios (solo Carlos) */
.cfg-lista { display: flex; flex-direction: column; gap: 6px; }
.cfg-lista .vacio { color: #777; font-size: 12px; padding: 6px 2px; }
.cfg-usr { display: flex; align-items: center; gap: 10px; background: #1b1b1e; border: 1px solid #333; border-radius: 12px; padding: 9px 12px; }
.cfg-usr .quien { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cfg-usr .quien b { font-size: 13.5px; font-weight: 600; color: #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfg-usr .quien span { font-size: 11px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfg-usr .estado { font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; border: 1px solid; flex-shrink: 0; }
.cfg-usr .estado.si { color: var(--verde); border-color: rgba(40,204,149,.5); background: rgba(40,204,149,.10); }
.cfg-usr .estado.no { color: #e0a030; border-color: rgba(224,160,48,.5); background: rgba(224,160,48,.10); }
.cfg-usr .estado.admin { color: #5a9fe0; border-color: rgba(90,159,224,.5); background: rgba(90,159,224,.10); }
.cfg-usr button { flex-shrink: 0; font: 600 12px 'Lexend', sans-serif; border-radius: 9px; padding: 7px 11px; cursor: pointer; border: 1px solid; background: none; }
.cfg-usr button.aprobar { color: var(--verde); border-color: var(--verde); }
.cfg-usr button.quitar { color: #e53935; border-color: #e53935; }

/* ── Pantallas de entrada / espera ── */
.pant { position: fixed; inset: 0; overflow-y: auto; background: #0e0e0e; display: flex; flex-direction: column; align-items: center;
  padding: calc(70px + var(--arriba)) 30px calc(30px + var(--abajo)); font-family: 'Lexend', sans-serif; color: #eee; gap: 8px; }
.lg-logo { width: 92px; height: 92px; border-radius: 22px; overflow: hidden; box-shadow: 0 8px 26px rgba(0,0,0,.5); }
.lg-logo.chico { width: 64px; height: 64px; border-radius: 16px; }
.lg-logo img { width: 100%; height: 100%; display: block; }
.lg-t { font: 800 28px 'Lexend', sans-serif; color: #fff; letter-spacing: .05em; margin-top: 10px; } .lg-t b { color: var(--verde); }
.lg-s { font-size: 13px; color: #888; margin-bottom: 18px; }
.lg-tabs { display: flex; width: 100%; background: #1b1b1e; border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.lg-tabs button { flex: 1; font: 600 13px 'Lexend', sans-serif; background: none; border: 0; border-radius: 10px; padding: 9px; color: #888; cursor: pointer; }
.lg-tabs button.on { background: #2a2a2e; color: #fff; }
.pant form { width: 100%; display: flex; flex-direction: column; }
.pant label { width: 100%; font-size: 12px; color: #999; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.pant label small { color: #666; font-size: 11px; font-weight: 300; margin-top: -3px; }
.pant input { font: 16px 'Lexend', sans-serif; background: #1b1b1e; border: 1px solid #333; border-radius: 12px; padding: 12px 14px; color: #fff; outline: none; width: 100%; }
.pant input:focus { border-color: var(--verde); box-shadow: 0 0 0 2px rgba(40,204,149,.16); }
.lg-btn { width: 100%; font: 700 16px 'Lexend', sans-serif; background: var(--verde); color: #04110c; border: 0; border-radius: 14px; padding: 14px; cursor: pointer; margin-top: 4px; }
.lg-btn:disabled { opacity: .55; }
.lg-link { background: none; border: 0; color: #8a8a8a; font: 13px 'Lexend', sans-serif; text-decoration: underline; cursor: pointer; padding: 10px; }
.lg-msg { width: 100%; font-size: 13px; line-height: 1.5; text-align: center; min-height: 20px; padding: 4px 0; }
.lg-msg.mal { color: #ff6b6b; } .lg-msg.bien { color: var(--verde); }
.lg-nota { font-size: 12px; color: #666; text-align: center; margin-top: 8px; line-height: 1.5; }
#p-entrar:not(.crear) .solo-crear { display: none; }
.esp-ico { font-size: 44px; margin-top: 26px; }
.esp-t { font-size: 17px; font-weight: 700; text-align: center; }
.esp-d { font-size: 13.5px; color: #999; text-align: center; line-height: 1.55; max-width: 330px; margin-bottom: 18px; }
.esp-d b { color: var(--verde); word-break: break-all; }
.esp-det { font: 11px Consolas, monospace; color: #777; text-align: center; max-width: 330px; word-break: break-word; margin: -8px 0 12px; }
.mono { font-family: Consolas, monospace; color: #ccc; }
.state-screen { position: fixed; inset: 0; background: var(--bg); }

/* ── Historia 📈 en el teléfono: la caja ocupa todo el ancho ── */
/* (Carlos, 2026-09-28, MANUAL 24.1) Con la app instalada, la caja se pegaba arriba
   y la isla / la hora / la batería tapaban el título: margen arriba que respeta la
   franja del sistema (--arriba) y la caja no pasa de ahí. */
.evo-modal { padding: calc(16px + var(--arriba)) 6px calc(8px + var(--abajo)); align-items: flex-end; }
.evo-box { max-height: calc(100dvh - var(--arriba) - 40px); }
.evo-jug { font-size: 14px; }
.evo-close { width: 30px; height: 30px; font-size: 14px; }
.evo-list { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.evo-foto { margin-left: 8px; max-width: none; }
.menu-op { padding: 8px 14px; font-size: 13px; }
/* Tooltips: en el teléfono se abren dejando el dedo apoyado (app.js) */
.tip { width: 250px; }
