:root {
  --fondo: #fbf7f2; --papel: #ffffff; --tinta: #1f2430; --suave: #5f6676; --linea: #e6dfd5;
  --rojo: #d94141; --verde: #2f9e6a; --azul: #2c6fd1; --ambar: #d98b14; --rosa: #e8579a;
  --acento: #e8579a; --sombra: 0 1px 3px rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; cursor: pointer; }
.barra { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--papel); border-bottom: 1px solid var(--linea); position: sticky; top: 0; z-index: 5; }
.marca { font-weight: 700; font-size: 17px; }
.demo { font-size: 11px; font-weight: 600; background: var(--acento); color: #fff; padding: 2px 6px; border-radius: 6px; vertical-align: middle; }
.kpis { display: flex; flex-wrap: wrap; gap: 6px; }
.kpi { background: var(--fondo); border: 1px solid var(--linea); border-radius: 8px; padding: 4px 10px; font-size: 13px; }
.kpi b { font-size: 15px; }
.kpi.neg b { color: var(--rojo); }
.juego { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 16px; padding: 16px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 820px) { .juego { grid-template-columns: 1fr; } }
.izq { display: flex; flex-direction: column; gap: 12px; }
.escena { background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; overflow: hidden; box-shadow: var(--sombra); }
.escena svg { display: block; width: 100%; height: auto; }
.tutor { background: var(--papel); border: 1px solid var(--linea); border-left: 4px solid var(--acento); border-radius: 12px; padding: 12px 14px; box-shadow: var(--sombra); }
.tutor .quien { font-weight: 700; margin-bottom: 4px; }
.pasar { background: var(--acento); color: #fff; border: 0; border-radius: 12px; padding: 14px; font-size: 17px; font-weight: 700; box-shadow: var(--sombra); }
.pasar:disabled { background: #c9c2b8; cursor: not-allowed; }
.aviso-horas { color: var(--rojo); font-size: 13px; min-height: 1em; text-align: center; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.tabs button { background: transparent; border: 1px solid var(--linea); border-radius: 999px; padding: 6px 12px; color: var(--suave); }
.tabs button.activo { background: var(--tinta); color: #fff; border-color: var(--tinta); }
.tabs .punto { display: inline-block; width: 8px; height: 8px; background: var(--rojo); border-radius: 50%; margin-left: 4px; vertical-align: middle; }
.panel { background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; padding: 16px; box-shadow: var(--sombra); min-height: 300px; }
.panel h3 { margin: 0 0 8px; font-size: 16px; }
.panel h4 { margin: 16px 0 6px; font-size: 14px; color: var(--suave); text-transform: uppercase; letter-spacing: .04em; }
.ayuda { color: var(--suave); font-size: 13px; margin: 0 0 10px; }
.fila { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; align-items: center; margin: 6px 0; }
.fila input[type=range] { width: 100%; accent-color: var(--acento); }
.fila .val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.total-horas { font-size: 13px; margin-top: 4px; }
.total-horas.mal { color: var(--rojo); font-weight: 600; }
.tarjeta { border: 1px solid var(--linea); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.tarjeta .cab { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tarjeta .tit { font-weight: 600; }
.tarjeta.bloq { opacity: .6; border-style: dashed; }
.chk { list-style: none; padding: 0; margin: 6px 0; }
.chk li::before { content: "✗ "; color: var(--rojo); font-weight: 700; }
.chk li.ok::before { content: "✓ "; color: var(--verde); }
.btn { background: var(--tinta); color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; font-weight: 600; }
.btn.sec { background: transparent; color: var(--tinta); border: 1px solid var(--linea); }
.btn:disabled { background: #d8d2c9; color: #fff; cursor: not-allowed; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
table.num { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.num td { padding: 5px 4px; border-bottom: 1px solid var(--linea); }
table.num td:last-child { text-align: right; white-space: nowrap; }
table.num tr.tot td { font-weight: 700; border-top: 2px solid var(--tinta); border-bottom: 0; }
table.num tr.sub td:first-child { padding-left: 16px; color: var(--suave); }
.neg { color: var(--rojo); }
.pos { color: var(--verde); }
.borroso { filter: blur(3.5px); user-select: none; }
.sello { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #fdecec; color: var(--rojo); font-weight: 600; }
.sello.ok { background: #e6f5ee; color: var(--verde); }
.sello.mid { background: #fdf3e2; color: var(--ambar); }
.subtabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.subtabs button { background: var(--fondo); border: 1px solid var(--linea); border-radius: 8px; padding: 5px 10px; }
.subtabs button.activo { border-color: var(--acento); color: var(--acento); font-weight: 600; }
.subtabs button:disabled { opacity: .5; cursor: not-allowed; }
.pregunta { background: #fff4fa; border: 1px solid #f6c7de; border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 14px; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ficha { border: 1px solid var(--linea); border-radius: 10px; padding: 12px; }
.ficha .ico { font-size: 26px; }
.ficha.oculta { background: var(--fondo); color: var(--suave); text-align: center; display: flex; flex-direction: column; justify-content: center; min-height: 120px; }
.ficha p { margin: 6px 0; font-size: 13.5px; }
.modal-fondo { position: fixed; inset: 0; background: rgba(20, 22, 30, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal-fondo[hidden] { display: none; }
.modal { background: var(--papel); border-radius: 14px; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; padding: 18px 20px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal h2 { margin: 0 0 6px; font-size: 20px; }
.modal ul { padding-left: 20px; }
.resumen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.resumen div { background: var(--fondo); border-radius: 8px; padding: 8px; text-align: center; font-size: 12px; color: var(--suave); }
.resumen b { display: block; font-size: 17px; color: var(--tinta); }
.dolor { border: 2px solid var(--rojo); background: #fff6f6; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.dolor .t { font-weight: 700; color: var(--rojo); }
.pie { text-align: center; color: var(--suave); font-size: 12px; padding: 8px 16px 24px; }
.grafico { width: 100%; height: auto; }
.mando { background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; padding: 12px 14px; box-shadow: var(--sombra); }
.mando h3 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { background: var(--fondo); border-radius: 10px; padding: 8px 10px; }
.tile .k { font-size: 12px; color: var(--suave); }
.tile .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.tile .s { font-size: 11.5px; color: var(--suave); }
.tile.mal { background: #fdecec; } .tile.mal .v { color: var(--rojo); }
.tile.bien .v { color: var(--verde); }
.tile.ojo { background: #fdf3e2; } .tile.ojo .v { color: var(--ambar); }
.izq, .der { min-width: 0; }
.opciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
@media (max-width: 520px) { .opciones { grid-template-columns: 1fr; } }
.opcion { text-align: left; background: var(--fondo); border: 2px solid var(--linea); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.opcion span { font-size: 12px; color: var(--suave); }
.opcion.activa { border-color: var(--acento); background: #fff4fa; }
.ojo-t { color: var(--ambar); }
.scroll-x { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.cuadro td { white-space: nowrap; text-align: right; font-size: 13px; padding: 5px 8px; }
table.cuadro td:first-child { text-align: left; position: sticky; left: 0; background: var(--papel); }
.mando .grafico { display: block; max-width: 440px; margin: 8px auto 0; }
.veredicto { margin: 10px 0 2px; font-weight: 600; font-size: 14px; }
.veredicto.mal { color: var(--rojo); } .veredicto.bien { color: var(--verde); }
.mando .nota { font-size: 11.5px; color: var(--suave); margin: 4px 0 0; }
.usuario { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.usuario img { width: 26px; height: 26px; border-radius: 50%; }
.usuario .guardado { color: var(--suave); font-size: 12px; }
.usuario button { background: transparent; border: 1px solid var(--linea); border-radius: 8px; padding: 3px 8px; font-size: 12px; }
.login { position: fixed; inset: 0; z-index: 30; background: linear-gradient(160deg, #fde3ef, #dff1fb); display: flex; align-items: center; justify-content: center; padding: 16px; }
.login[hidden] { display: none; }
.login-caja { background: var(--papel); border-radius: 16px; padding: 28px 24px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.12); }
.login-logo { font-size: 56px; line-height: 1; }
.login-caja h1 { font-size: 22px; margin: 8px 0; }
.login-caja p { margin: 8px 0 16px; }
.g-boton { display: flex; justify-content: center; min-height: 44px; }
.dev-login { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.dev-login[hidden] { display: none; }
.dev-login input { font: inherit; font-size: 16px; padding: 6px 10px; border: 1px solid var(--linea); border-radius: 8px; }
.login-error { color: var(--rojo); min-height: 1em; font-size: 14px; }
@media (max-width: 820px) {
  .barra { position: static; padding: 8px 16px; }
  .kpi { padding: 2px 8px; font-size: 12px; }
  .kpi b { font-size: 13px; }
  .juego { padding: 12px 16px; }
  .pasar { position: fixed; left: 16px; right: 16px; bottom: 10px; z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
  .aviso-horas { position: fixed; left: 16px; right: 16px; bottom: 66px; z-index: 10; background: #fff; border-radius: 8px; }
  .aviso-horas:empty { display: none; }
  .pie { padding-bottom: 84px; }
  .fila { grid-template-columns: 90px 1fr 60px; }
}
