/* v60 - Capa correctiva única. Mantiene efectos visuales base y evita conflictos de parches antiguos. */
:root{--redbg-safe-gap:8px;--redbg-panel-bg:rgba(7,10,18,.96);--redbg-border:rgba(216,168,77,.38);--redbg-red-border:rgba(180,38,38,.48)}
html,body{max-width:100%;overflow-x:hidden;overscroll-behavior:none;}
body.game-session-active{touch-action:manipulation;}
/* Todas las casillas del mockup respetan el tamaño asignado */
[data-layout-segment],.layout-segment,.layout-slot,.mockup-slot,.mansion-panel,.resources-panel,.chat-panel,.sidebar,.actions-panel,.buttons-panel,.timer-panel,.player-deck-panel,.players-row,.topbar-panel{box-sizing:border-box!important;max-width:100%!important;max-height:100%!important;min-width:0!important;min-height:0!important;}
[data-layout-segment] > *, .layout-segment > *, .layout-slot > *, .mockup-slot > *{box-sizing:border-box!important;max-width:100%;}
/* Regla general: no scroll lateral accidental */
.game-board,.game-shell,.play-area,.main-board,.board-root{overflow:hidden!important;}
/* Sala, chat y recursos pueden desplazarse verticalmente cuando están en panel flotante o casilla pequeña */
.sidebar,.resources-panel,.chat-panel{overflow-x:hidden!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;}
.sidebar.re-v60-stage-panel,.resources-panel.re-v60-stage-panel,.chat-panel.re-v60-stage-panel{overflow-y:auto!important;}
/* Acciones y botones superiores/inferiores se encogen dentro de su caja */
.actions-panel,.buttons-panel,.topbar-panel,.game-actions-panel,.action-buttons,.top-actions,.bottom-actions{display:flex!important;align-items:center!important;justify-content:center!important;gap:clamp(2px,.6vw,8px)!important;flex-wrap:wrap!important;overflow:hidden!important;padding:clamp(1px,.5vw,5px)!important;}
.actions-panel button,.buttons-panel button,.topbar-panel button,.game-actions-panel button,.action-buttons button,.top-actions button,.bottom-actions button,.primary-button,.ghost-button{min-width:0!important;max-width:100%!important;white-space:nowrap!important;text-overflow:ellipsis!important;overflow:hidden!important;line-height:1.05!important;}
.actions-panel button,.game-actions-panel button,.bottom-actions button{min-height:22px!important;height:auto!important;padding:clamp(2px,.5vw,6px) clamp(4px,.8vw,10px)!important;font-size:clamp(9px,1.15vw,13px)!important;border-width:1px!important;}
/* Reloj: solo tiempo, sin scroll */
.timer-panel,.turn-timer,.timer-box,.game-timer{display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;padding:0!important;}
.timer-panel *,.turn-timer *,.timer-box *,.game-timer *{max-width:100%;}
.timer-panel .timer-label,.timer-panel .timer-description,.turn-timer .timer-label,.turn-timer .timer-description{display:none!important;}
.timer-value,.turn-timer-value,#turn-timer,.timer-panel strong{font-size:clamp(16px,5vw,44px)!important;line-height:1!important;white-space:nowrap!important;}
/* Lupas proporcionadas al tamaño de carta/casilla */
.inspect-btn,.guide-card-zoom,.hand-zoom-btn,.card-zoom,.zoom-button,.card-face-btn{position:absolute!important;right:4px!important;top:4px!important;width:clamp(18px,16%,30px)!important;height:clamp(18px,16%,30px)!important;min-width:18px!important;min-height:18px!important;max-width:30px!important;max-height:30px!important;padding:0!important;border-radius:999px!important;font-size:clamp(10px,2.5vw,15px)!important;line-height:1!important;z-index:5!important;display:flex!important;align-items:center!important;justify-content:center!important;}
.hand .inspect-btn,#hand .inspect-btn,.card-in-hand .inspect-btn,.hand-card .inspect-btn{pointer-events:auto!important;opacity:.92!important;}
.hand .card,.hand-card,.card-in-hand,.hand-play-card,.guide-card{position:relative!important;overflow:hidden!important;}
/* Recursos siempre: botones arriba, cartas abajo, sin scroll horizontal */
.resources-panel{display:flex!important;flex-direction:column!important;gap:6px!important;}
.resources-panel .resource-controls,.resources-panel .resource-tabs,.resources-panel .resource-filter,.resources-panel .resource-market-controls{display:flex!important;flex-wrap:wrap!important;gap:4px!important;flex:0 0 auto!important;overflow:hidden!important;}
.resources-panel .resource-grid,.resources-panel .resource-cards,.resources-panel .resources-grid,.resources-panel #resources-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;width:100%!important;overflow-x:hidden!important;overflow-y:auto!important;align-items:start!important;}
.resource-card,.resource-mini-card,.resource-card-v27{min-width:0!important;max-width:100%!important;width:100%!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;gap:3px!important;overflow:hidden!important;box-sizing:border-box!important;cursor:pointer!important;}
.resource-card img,.resource-mini-card img,.resource-card-v27 img{width:100%!important;height:auto!important;max-height:clamp(62px,20vh,150px)!important;object-fit:contain!important;display:block!important;}
#mansion-card.has-card-image .card-art img{width:auto!important;height:auto!important;min-width:0!important;min-height:0!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important;image-rendering:auto!important;}
.resource-card .desc,.resource-card .description,.resource-card p,.resource-mini-card .desc,.resource-card-v27 .desc{display:none!important;}
.resource-card .name,.resource-card .title,.resource-card .cost,.resource-mini-card .name,.resource-mini-card .cost,.resource-card-v27 .name,.resource-card-v27 .cost{font-size:clamp(9px,2.4vw,12px)!important;line-height:1.05!important;text-align:center!important;margin:0!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;}
/* Indicadores jugador: móvil vertical 4 visibles + scroll horizontal */
.player-indicators,.player-stats,.indicators-row,.trackers-row{display:flex!important;align-items:center!important;gap:6px!important;overflow-x:auto!important;overflow-y:hidden!important;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity;}
.player-indicators > *,.player-stats > *,.indicators-row > *,.trackers-row > *{flex:0 0 auto!important;scroll-snap-align:start;}
body[data-redbg-device="mobile_portrait"] .player-indicators > *,body[data-redbg-device="mobile_portrait"] .player-stats > *,body[data-redbg-device="mobile_portrait"] .indicators-row > *,body[data-redbg-device="mobile_portrait"] .trackers-row > *{flex-basis:calc((100% - 18px)/4)!important;max-width:calc((100% - 18px)/4)!important;min-width:calc((100% - 18px)/4)!important;}
/* Dock flotante único */
.mobile-bottom-dock.re-v60-dock{position:fixed!important;z-index:2147483000!important;display:flex!important;gap:6px!important;padding:6px!important;border:1px solid var(--redbg-border)!important;border-radius:16px!important;background:rgba(5,8,16,.92)!important;box-shadow:0 10px 28px rgba(0,0,0,.45)!important;backdrop-filter:blur(9px);box-sizing:border-box!important;}
body[data-redbg-device="mobile_portrait"] .mobile-bottom-dock.re-v60-dock{flex-direction:column!important;width:auto!important;left:calc(env(safe-area-inset-left) + 6px)!important;top:22dvh!important;bottom:auto!important;}
body[data-redbg-device="mobile_landscape"] .mobile-bottom-dock.re-v60-dock,
body[data-redbg-device="tablet"] .mobile-bottom-dock.re-v60-dock{flex-direction:column!important;width:auto!important;left:calc(env(safe-area-inset-left) + 6px)!important;top:22dvh!important;bottom:auto!important;transform:none!important;max-height:calc(100dvh - 28dvh)!important;overflow-y:auto!important;overflow-x:hidden!important;}
.mobile-bottom-dock.re-v60-dock button{width:48px!important;height:42px!important;min-width:44px!important;border-radius:12px!important;padding:2px!important;font-size:12px!important;line-height:1!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:1px!important;touch-action:manipulation!important;}
.mobile-bottom-dock.re-v60-dock button.active{outline:2px solid rgba(216,168,77,.75)!important;background:rgba(128,25,25,.72)!important;}
.mobile-bottom-dock.re-v60-dock .ico{font-size:17px!important;line-height:1!important}.mobile-bottom-dock.re-v60-dock .txt{font-size:9px!important;line-height:1!important;max-width:100%;overflow:hidden;text-overflow:ellipsis;}
/* Panel flotante estable: centro útil de pantalla, scroll vertical */
.re-v60-stage-panel{position:fixed!important;display:flex!important;flex-direction:column!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;z-index:2147482500!important;box-sizing:border-box!important;background:var(--redbg-panel-bg)!important;border:1px solid var(--redbg-border)!important;border-radius:14px!important;box-shadow:0 18px 45px rgba(0,0,0,.62)!important;padding:8px!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;touch-action:pan-y!important;}
.re-v60-hidden{display:none!important;visibility:hidden!important;pointer-events:none!important;}
.re-v60-stage-panel *{max-width:100%;box-sizing:border-box;}
.re-v60-stage-panel button,.re-v60-stage-panel a,.re-v60-stage-panel input,.re-v60-stage-panel textarea,.re-v60-stage-panel select,.re-v60-stage-panel .resource-card,.re-v60-stage-panel .resource-mini-card,.re-v60-stage-panel .resource-card-v27{pointer-events:auto!important;touch-action:manipulation!important;}
/* No mostrar marcas azules/debug en juego */
.mobile-stage-debug,.re-v49-debug,.layout-debug-outline,.debug-outline{display:none!important;border:0!important;outline:0!important;}
@media (max-width: 760px){
  .resources-panel .resource-grid,.resources-panel .resource-cards,.resources-panel .resources-grid,.resources-panel #resources-grid{gap:5px!important;}
  .re-v60-stage-panel{font-size:12px!important;}
  .inspect-btn,.guide-card-zoom,.hand-zoom-btn{width:20px!important;height:20px!important;max-width:22px!important;max-height:22px!important;font-size:11px!important;}
}
