/* v32 · La tabla de la bola */
body.bola { margin: 0; background: linear-gradient(170deg, #FBF1E3, #F3E2C8); color: #3b2a1a; font-family: "Baloo 2", "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif; overflow-y: auto; -webkit-user-select: none; user-select: none; }
.b-view[hidden] { display: none !important; }
.b-menu, .b-sum { max-width: 1120px; margin: 0 auto; padding: calc(0.9rem + env(safe-area-inset-top)) calc(1.1rem + env(safe-area-inset-right)) 1.5rem calc(1.1rem + env(safe-area-inset-left)); }
.b-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.b-head .home-back { margin: 0; font: inherit; font-weight: 800; font-size: 1.1rem; cursor: pointer; }
.b-title { flex: 1 1 360px; min-width: 0; }
.b-title h1 { margin: 0; font-size: 2rem; color: #4a2e17; line-height: 1.1; }
.b-sub { margin: 0.2rem 0 0; font-size: 1.05rem; color: #6d5440; }
.b-histlink { font-weight: 800; color: #4a2e17; text-decoration: none; background: #fff; border-radius: 999px; padding: 0.55rem 1.1rem; box-shadow: 0 3px 10px rgba(90,60,30,0.12); }
.b-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; margin-bottom: 0.9rem; }
.b-lv { font: inherit; border: 3px solid transparent; border-radius: 20px; padding: 0.55rem 0.4rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: #3b2a1a; min-height: 64px; }
.b-lv b { font-size: 1.25rem; } .b-lv small { font-size: 0.88rem; color: #5b4636; }
.b-lv.facil { background: #cdebd6; } .b-lv.medio { background: #cfe2f4; } .b-lv.dificil { background: #e2d5f3; } .b-lv.experto { background: #f3d9c2; }
.b-lv[aria-selected="true"] { border-color: #4a2e17; box-shadow: 0 4px 12px rgba(74,46,23,0.2); }
.b-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
.b-card { background: #fffaf2; border-radius: 22px; padding: 0.7rem; box-shadow: 0 5px 16px rgba(90,60,30,0.12); display: flex; flex-direction: column; gap: 0.45rem; border: 3px solid #fff; }
.b-card canvas { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 12px; display: block; }
.b-card h3 { margin: 0.1rem 0.2rem 0; font-size: 1.25rem; color: #4a2e17; }
.b-card .b-stats { margin: 0 0.2rem; font-size: 0.98rem; color: #6d5440; min-height: 2.6em; line-height: 1.3; }
.b-card .b-row { display: flex; gap: 0.5rem; }
.b-play-btn, .b-evol-btn { font: inherit; font-weight: 800; border-radius: 16px; cursor: pointer; min-height: 52px; font-size: 1.12rem; }
.b-play-btn { flex: 1 1 auto; background: #4a2e17; color: #fff; border: 0; }
.b-evol-btn { flex: 0 0 auto; background: #fff; color: #4a2e17; border: 2px solid #c9a27a; padding: 0 0.9rem; }
.b-settings { margin-top: 1rem; background: rgba(255,255,255,0.65); border-radius: 22px; padding: 0.8rem 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1.2rem; }
.b-set { display: flex; flex-direction: column; gap: 0.35rem; }
.b-setl { font-weight: 800; font-size: 1.05rem; }
.b-seg { display: flex; gap: 0.5rem; }
.b-mode { flex: 1; font: inherit; font-weight: 800; font-size: 1.02rem; border-radius: 14px; border: 2px solid #d9bf9f; background: #fff; color: #4a2e17; min-height: 50px; cursor: pointer; }
.b-mode[aria-checked="true"] { background: #4a2e17; color: #fff; border-color: #4a2e17; }
.b-range { display: flex; align-items: center; gap: 0.6rem; font-size: 0.95rem; }
.b-range input { flex: 1; height: 44px; accent-color: #8a5530; }
.b-tip { grid-column: 1 / -1; margin: 0; font-size: 0.98rem; color: #6d5440; }
/* juego */
.b-play { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; background: #5a3318; touch-action: none; overflow: hidden; }
.b-play canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.b-hud { position: absolute; top: calc(8px + env(safe-area-inset-top)); display: flex; gap: 0.45rem; align-items: center; z-index: 2; }
.b-hudl { left: calc(10px + env(safe-area-inset-left)); }
.b-hudr { right: calc(10px + env(safe-area-inset-right)); }
.b-chip { background: rgba(255,248,236,0.92); color: #3b2a1a; font-weight: 800; font-size: 1.05rem; border-radius: 999px; padding: 0.35rem 0.85rem; box-shadow: 0 2px 8px rgba(0,0,0,0.2); white-space: nowrap; }
.b-btn { font: inherit; font-weight: 800; font-size: 1.05rem; min-height: 46px; min-width: 46px; border-radius: 999px; border: 2px solid #f3dfc3; background: rgba(255,248,236,0.95); color: #3b2a1a; padding: 0 0.95rem; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.b-btn.strong { background: #fff; border-color: #fff; }
.b-msg { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(255,248,236,0.96); color: #3b2a1a; font-weight: 800; font-size: 1.15rem; padding: 0.55rem 1.2rem; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,0.25); opacity: 0; transition: opacity .3s; pointer-events: none; max-width: 86vw; text-align: center; z-index: 3; }
.b-msg.show { opacity: 1; }
/* resumen */
.b-sumbox { background: #fffaf2; border-radius: 24px; padding: 1rem; box-shadow: 0 5px 16px rgba(90,60,30,0.12); }
.b-sumgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.b-sumgrid div { background: #f6ead8; border-radius: 16px; padding: 0.7rem 0.9rem; }
.b-sumgrid span { display: block; font-size: 0.95rem; color: #6d5440; font-weight: 700; }
.b-sumgrid b { font-size: 1.7rem; color: #3b2a1a; }
.b-sumbox .chart svg { width: 100%; height: auto; }
.b-sumbox .chart figcaption { font-size: 0.98rem; margin: 0.6rem 0 0.2rem; }
.b-sumbox .chart .grid { stroke: #eadfcd; } .b-sumbox .chart .ax { font-size: 12px; fill: #6d5440; }
.b-sumbox .chart .lt { fill: none; stroke: #8a5530; stroke-width: 3; } .b-sumbox .chart .lh { fill: none; stroke: #e2557a; stroke-width: 3; stroke-dasharray: 6 5; }
.b-sumbox .chart .dt { fill: #8a5530; } .b-sumbox .chart .dh { fill: #e2557a; }
.b-sumbox .chart .leg i { display: inline-block; width: 18px; height: 4px; margin: 0 0.3rem 0 0.8rem; vertical-align: middle; } .chart .leg i.lt { background: #8a5530; } .chart .leg i.lh { background: #e2557a; }
.b-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.9rem; }
.b-actions button { font: inherit; font-weight: 800; font-size: 1.12rem; min-height: 54px; border-radius: 16px; padding: 0 1.3rem; cursor: pointer; border: 2px solid #c9a27a; background: #fff; color: #4a2e17; }
.b-actions button.main { background: #4a2e17; color: #fff; border-color: #4a2e17; }
@media (max-width: 900px) {
  .b-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-settings { grid-template-columns: 1fr; }
  .b-chip { font-size: 0.95rem; padding: 0.3rem 0.65rem; }
  .b-btn { font-size: 0.98rem; padding: 0 0.75rem; }
}
.b-sumrow { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 1rem; align-items: start; margin-top: 0.9rem; }
.b-sumrow canvas { width: 100%; height: auto; border-radius: 14px; }
@media (max-width: 900px) { .b-sumrow { grid-template-columns: 1fr; } .b-sumrow canvas { max-width: 420px; } }
