/* =====================================================================
   F2-H1 · Experiencia de duelo (tablero)
   Capa visual aislada que se carga al final. Solo presentación:
   no cambia reglas, decisiones, eventos, audio, online ni JavaScript.
   Ámbito: body.duel-playing #gameBoard (y los paneles flotantes del duelo).
   Rollback: quitar el <link> de esta hoja en index.html.
   ===================================================================== */

body.duel-playing {
    --dx-gold: #f4c76a;
    --dx-gold-strong: #ffd98a;
    --dx-gold-ink: #241604;
    --dx-ally: #5ec8ff;
    --dx-rival: #ff7a6b;
    --dx-ok: #4ade80;
    --dx-danger: #f87171;
    --dx-fallen: #a78bfa;
    --dx-panel: rgba(8, 13, 26, .9);
    --dx-line: rgba(244, 199, 106, .28);
    --dx-bar-h: 0px;
}

/* ---------------------------------------------------------------------
   1. Columna derecha: primero "de quién es el turno", luego "qué hacer".
   --------------------------------------------------------------------- */
body.duel-playing #gameBoard .right-dock > .match-info-dock { order: -2; }
body.duel-playing #gameBoard .right-dock > .action-dock { order: -1; }

/* Estandarte de turno y fase */
body.duel-playing #gameBoard .match-info-dock {
    --dx-accent: var(--dx-rival);
    position: relative;
    overflow: hidden;
    padding: 12px 14px 12px 20px !important;
    border: 1px solid color-mix(in srgb, var(--dx-accent) 55%, transparent) !important;
    border-radius: 16px !important;
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--dx-accent) 26%, transparent), transparent 60%),
        linear-gradient(160deg, rgba(14, 20, 38, .96), rgba(6, 10, 22, .94)) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .04) !important;
}
body.duel-playing #gameBoard:has(.player-hand-zone .resource-main.active) .match-info-dock { --dx-accent: var(--dx-ally); }
body.duel-playing #gameBoard .match-info-dock::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--dx-accent), color-mix(in srgb, var(--dx-accent) 30%, transparent));
    box-shadow: 0 0 18px var(--dx-accent);
    pointer-events: none;
}
body.duel-playing #gameBoard .match-info-dock .duel-status-bar { gap: 8px !important; }
body.duel-playing #gameBoard .match-info-dock .match-data {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px 8px !important;
    overflow: visible !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
}
body.duel-playing #gameBoard .match-info-dock .match-data > strong {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}
body.duel-playing #gameBoard .match-info-dock .match-data #turnText {
    order: 1;
    flex: 1 0 100%;
    color: #fff7e3 !important;
    font-size: clamp(1.02rem, 1.05vw, 1.24rem) !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    letter-spacing: .01em;
    white-space: normal !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
}
body.duel-playing #gameBoard .match-info-dock .match-data #phaseText {
    order: 2;
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 10px !important;
    border: 1px solid rgba(255, 217, 138, .7) !important;
    border-radius: 999px !important;
    color: var(--dx-gold-ink) !important;
    background: linear-gradient(135deg, #ffe3a3, #f0b955) !important;
    box-shadow: 0 0 16px rgba(244, 199, 106, .35) !important;
    font-size: .84rem !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    letter-spacing: .02em;
    white-space: nowrap !important;
}
body.duel-playing #gameBoard .match-info-dock .match-data #phaseText::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dx-gold-ink);
    box-shadow: 0 0 0 3px rgba(36, 22, 4, .18);
}
body.duel-playing #gameBoard .match-info-dock .match-data #localDuelLatency { order: 3; }
/* Datos de jugadores: la identidad se mantiene; los conteos repetidos del encabezado de mano se ocultan. */
body.duel-playing #gameBoard .match-info-dock .match-players {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
}
body.duel-playing #gameBoard .match-info-dock .player-info {
    min-height: 0 !important;
    padding: 4px 8px !important;
    border-radius: 10px !important;
    font-size: .74rem !important;
}
body.duel-playing #gameBoard .match-info-dock .match-resource-line { display: none !important; }
body.duel-playing #gameBoard .match-info-dock .zone-extra-counts { gap: 4px 8px !important; font-size: .7rem !important; opacity: .85; }

/* ---------------------------------------------------------------------
   2. Menú de acciones: primero la indicación, luego solo lo que se puede hacer.
   --------------------------------------------------------------------- */
body.duel-playing #gameBoard .action-dock {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 12px 14px 14px !important;
}
body.duel-playing #gameBoard .action-dock > h3 {
    order: 0;
    margin: 0 !important;
    color: rgba(255, 228, 170, .82) !important;
    font-size: .72rem !important;
    letter-spacing: .16em !important;
    text-transform: uppercase;
    text-align: left !important;
}
/* La indicación de qué hacer vuelve a la vista (el registro sigue oculto como antes). */
body.duel-playing #gameBoard .action-dock > #selectionInfo {
    order: 1;
    display: block !important;
    position: relative;
    margin: 0 !important;
    padding: 10px 12px 10px 40px !important;
    border: 1px solid rgba(244, 199, 106, .4) !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, rgba(244, 199, 106, .14), rgba(15, 23, 42, .72)) !important;
    color: #e8edf8 !important;
    font-size: .82rem !important;
    line-height: 1.35 !important;
}
body.duel-playing #gameBoard .action-dock > #selectionInfo::before {
    content: "!";
    position: absolute;
    left: 11px;
    top: 10px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: var(--dx-gold-ink);
    background: var(--dx-gold);
    font-size: .78rem;
    font-weight: 950;
}
body.duel-playing #gameBoard .action-dock > #selectionInfo { height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; }
body.duel-playing #gameBoard .action-dock > #selectionInfo br { display: none; }
body.duel-playing #gameBoard .action-dock > #selectionInfo strong { display: block; color: #fff3d6 !important; }
body.duel-playing #gameBoard .action-dock > #selectionInfo small { display: block; margin: 3px 0 0 !important; color: #b9c5da !important; font-size: .76rem !important; }

body.duel-playing #gameBoard .action-dock > .action-row {
    order: 2;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 0 !important;
}
/* Las acciones no disponibles dejan de ocupar espacio: el motivo sigue en la indicación. */
body.duel-playing #gameBoard .action-dock .action-row > button:disabled { display: none !important; }
body.duel-playing #gameBoard .action-dock .action-row > button {
    --dx-icon: none;
    flex: 1 1 100%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    font-size: .86rem !important;
    font-weight: 900 !important;
    letter-spacing: .04em !important;
    text-transform: uppercase;
    white-space: nowrap;
}
body.duel-playing #gameBoard .action-dock .action-row > button::before {
    content: "";
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--dx-icon) center / contain no-repeat;
    mask: var(--dx-icon) center / contain no-repeat;
}
body.duel-playing #gameBoard .action-dock .action-row > button:not([id])::before,
body.duel-playing #gameBoard .action-dock .action-row > #btnAttack::before { display: none; }

body.duel-playing #gameBoard #btnAsedio { --dx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.5 2.5 21.5 3.5 21 7 11.6 16.4 7.6 12.4 17 3z M6.2 13.8l4 4-1.4 1.4-1.4-1.4-2.6 2.6.7.7-1.4 1.4L1.7 20l1.4-1.4.7.7 2.6-2.6-1.4-1.4z'/%3E%3C/svg%3E"); }
body.duel-playing #gameBoard #btnIntercept { --dx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 20 5v6c0 5.2-3.4 9.5-8 11-4.6-1.5-8-5.8-8-11V5z'/%3E%3C/svg%3E"); }
body.duel-playing #gameBoard #btnResolve { --dx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l2.4 6.2L21 5l-3.6 5.6L23 13l-6.4 1.4L18 21l-6-3.6L6 21l1.4-6.6L1 13l5.6-2.4L3 5l6.6 2.2z'/%3E%3C/svg%3E"); }
body.duel-playing #gameBoard #btnEndTurn { --dx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h12v3c0 2.8-1.9 4.9-4.3 7 2.4 2.1 4.3 4.2 4.3 7v3H6v-3c0-2.8 1.9-4.9 4.3-7C7.9 9.9 6 7.8 6 5zm2.4 2.2c.3 1.9 1.6 3.4 3.6 5 2-1.6 3.3-3.1 3.6-5z'/%3E%3C/svg%3E"); }
body.duel-playing #gameBoard #btnExitDuel,
body.duel-playing #gameBoard #btnSurrenderOnline { --dx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h10v4h-2V5H6v14h6v-2h2v4H4z M15 8l5 4-5 4v-3H9v-2h6z'/%3E%3C/svg%3E"); }

/* Acción principal (Asedio / Interceptar / Resolver): dorada y con brillo. */
body.duel-playing #gameBoard .action-dock .action-row > :is(#btnAsedio, #btnIntercept, #btnResolve):enabled,
body.duel-playing #gameBoard .action-dock .action-row:not(:has(:is(#btnAsedio, #btnIntercept, #btnResolve):enabled)) > #btnEndTurn:enabled {
    border: 1px solid rgba(255, 233, 180, .9) !important;
    color: var(--dx-gold-ink) !important;
    background: linear-gradient(180deg, #ffe7a8 0%, #f4c76a 48%, #d99a35 100%) !important;
    box-shadow: 0 0 0 1px rgba(36, 22, 4, .35) inset, 0 8px 22px rgba(244, 199, 106, .32) !important;
    text-shadow: none !important;
    animation: dx-cta-glow 2.6s ease-in-out infinite;
}
body.duel-playing #gameBoard .action-dock .action-row > :is(#btnAsedio, #btnIntercept, #btnResolve):enabled:hover,
body.duel-playing #gameBoard .action-dock .action-row > #btnEndTurn:enabled:hover { filter: brightness(1.08); }
/* Finalizar turno como acción secundaria cuando hay otra principal (comparte fila con Salir). */
body.duel-playing #gameBoard .action-dock .action-row:has(:is(#btnAsedio, #btnIntercept, #btnResolve):enabled) > #btnEndTurn:enabled {
    order: 8;
    border: 1px solid rgba(244, 199, 106, .55) !important;
    color: #ffe9b8 !important;
    background: rgba(244, 199, 106, .08) !important;
    box-shadow: none !important;
}
/* Salir / Rendirse: discretos, al final. */
body.duel-playing #gameBoard .action-dock .action-row > #btnSurrenderOnline,
body.duel-playing #gameBoard .action-dock .action-row > #btnExitDuel {
    order: 9;
    flex: 1 1 0;
    min-height: 36px !important;
    padding: 7px 10px !important;
    font-size: .74rem !important;
    letter-spacing: .06em !important;
}
body.duel-playing #gameBoard .action-dock .action-row > #btnExitDuel {
    border: 1px solid rgba(148, 163, 184, .38) !important;
    color: #c8d1e0 !important;
    background: rgba(15, 23, 42, .55) !important;
    box-shadow: none !important;
}
body.duel-playing #gameBoard .action-dock .action-row > #btnExitDuel:hover { border-color: rgba(248, 113, 113, .7) !important; color: #fecaca !important; }
body.duel-playing #gameBoard .action-dock .action-row > #btnSurrenderOnline {
    border: 1px solid rgba(248, 113, 113, .6) !important;
    color: #fecaca !important;
    background: rgba(127, 29, 29, .4) !important;
}

/* Resumen de combate: solo cuando hay ataques declarados. */
body.duel-playing #gameBoard .action-dock > #combatSummary { order: 3; }
body.duel-playing #gameBoard .action-dock > #combatSummary:not(:has(.combat-line)) { display: none !important; }
body.duel-playing #gameBoard .action-dock > #combatSummary:has(.combat-line) {
    display: grid !important;
    max-height: min(32vh, 240px) !important;
    overflow: auto !important;
    gap: 6px !important;
    padding: 10px 12px !important;
    border: 1px solid rgba(248, 113, 113, .45) !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, rgba(127, 29, 29, .32), rgba(15, 23, 42, .7)) !important;
}
body.duel-playing #gameBoard .action-dock > #combatSummary > strong {
    color: #fecaca !important;
    font-size: .7rem !important;
    letter-spacing: .14em;
    text-transform: uppercase;
}
body.duel-playing #gameBoard .action-dock > #combatSummary .combat-line {
    display: grid !important;
    gap: 2px;
    padding: 6px 8px !important;
    border-radius: 9px !important;
    background: rgba(2, 6, 23, .45) !important;
    font-size: .78rem !important;
}
body.duel-playing #gameBoard .action-dock > #combatSummary .combat-line > span { color: #fff1e0; font-weight: 800; }
body.duel-playing #gameBoard .action-dock > #combatSummary .combat-line > em { color: #fca5a5; font-style: normal; }

/* Pantallas de poca altura: Dominio y Clima más compactos para que todo quepa sin desplazarse. */
@media (min-width: 981px) and (max-height: 860px) {
    body.duel-playing #gameBoard .right-dock .domain-dock { padding: 8px 10px 10px !important; }
    body.duel-playing #gameBoard .right-dock .domain-dock .jungle-area { grid-template-rows: auto clamp(96px, 14vh, 128px) !important; }
    body.duel-playing #gameBoard .right-dock > .right-climate-slot { min-height: 84px !important; }
    body.duel-playing #gameBoard .right-dock .right-climate-slot > button { min-height: 84px !important; }
    /* Los nombres ya están en cada mano; el título del menú sobra cuando falta alto. */
    body.duel-playing #gameBoard .match-info-dock .match-players,
    body.duel-playing #gameBoard .action-dock > h3 {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        clip: rect(0 0 0 0) !important;
        white-space: nowrap !important;
    }
}

/* ---------------------------------------------------------------------
   3. Tablero: el lado que juega se nota de un vistazo.
   --------------------------------------------------------------------- */
body.duel-playing #gameBoard .hand-zone:has(.resource-main.active) {
    border-color: rgba(255, 217, 138, .85) !important;
    box-shadow: 0 0 0 1px rgba(255, 217, 138, .35), 0 0 26px rgba(244, 199, 106, .22), inset 0 0 30px rgba(244, 199, 106, .06) !important;
    animation: dx-turn-breathe 3.2s ease-in-out infinite;
}
/* La insignia se apoya sobre el nombre para no robar ancho a los pilares. */
body.duel-playing #gameBoard .hand-zone .zone-title-line { position: relative; overflow: visible !important; }
body.duel-playing #gameBoard .hand-zone:has(.resource-main.active) .zone-title-line::after,
body.duel-playing #gameBoard .hand-zone.defender-player .zone-title-line::after,
body.duel-playing #gameBoard:has(.player-field-zone.defender-player) .player-hand-zone .zone-title-line::after {
    content: "En turno";
    position: absolute;
    left: 0;
    bottom: calc(100% + 3px);
    padding: 1px 7px;
    border-radius: 999px;
    color: var(--dx-gold-ink);
    background: linear-gradient(135deg, #ffe3a3, #f0b955);
    box-shadow: 0 0 12px rgba(244, 199, 106, .4);
    font-size: .58rem;
    font-weight: 950;
    letter-spacing: .08em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}
body.duel-playing #gameBoard .hand-zone.defender-player .zone-title-line::after,
body.duel-playing #gameBoard:has(.player-field-zone.defender-player) .player-hand-zone .zone-title-line::after {
    content: "Defiende";
    color: #04131f;
    background: linear-gradient(135deg, #bfe8ff, #5ec8ff);
    box-shadow: 0 0 12px rgba(94, 200, 255, .45);
}
/* Campo del jugador en turno: brillo interior suave. */
body.duel-playing #gameBoard .player-field-zone.active-player,
body.duel-playing #gameBoard:has(.opponent-hand-zone .resource-main.active) .opponent-field-zone {
    box-shadow: inset 0 0 0 1px rgba(255, 217, 138, .32), inset 0 0 60px rgba(244, 199, 106, .08) !important;
}
body.duel-playing #gameBoard .player-field-zone.defender-player,
body.duel-playing #gameBoard:has(.opponent-hand-zone.defender-player) .opponent-field-zone {
    box-shadow: inset 0 0 0 1px rgba(94, 200, 255, .38), inset 0 0 60px rgba(94, 200, 255, .1) !important;
}

/* ---------------------------------------------------------------------
   4. Pilares: vida legible, barra de resistencia y pilar caído visible.
   --------------------------------------------------------------------- */
body.duel-playing #gameBoard .mini-pillars .pilar {
    --dx-hp: 100%;
    --dx-hp-color: linear-gradient(90deg, #4ade80, #a3e635);
    padding-bottom: 9px !important;
}
body.duel-playing #gameBoard .mini-pillars .pilar.damaged { --dx-hp: 66%; --dx-hp-color: linear-gradient(90deg, #f59e0b, #fcd34d); }
body.duel-playing #gameBoard .mini-pillars .pilar.critical,
body.duel-playing #gameBoard .mini-pillars .pilar.danger { --dx-hp: 33%; --dx-hp-color: linear-gradient(90deg, #ef4444, #fb7185); }
body.duel-playing #gameBoard .mini-pillars .pilar:not(.pillar-destroyed-burst)::after {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 3px;
    height: 3px;
    border-radius: 3px;
    background:
        var(--dx-hp-color) left / var(--dx-hp) 100% no-repeat,
        rgba(148, 163, 184, .22);
    pointer-events: none;
}
/* Pilar caído: antes desaparecía (ancho 0). Ahora queda como ruina legible. */
body.duel-playing #gameBoard .mini-pillars .pilar.destroyed:not(.pillar-destroyed-burst) {
    width: auto !important;
    min-width: clamp(86px, 6vw, 112px) !important;
    padding: 5px 7px 9px !important;
    border: 1px dashed rgba(167, 139, 250, .55) !important;
    background:
        repeating-linear-gradient(135deg, rgba(167, 139, 250, .08) 0 6px, transparent 6px 12px),
        linear-gradient(135deg, rgba(24, 16, 44, .9), rgba(15, 23, 42, .78)) !important;
    opacity: .82 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
    pointer-events: none;
    box-shadow: none !important;
}
body.duel-playing #gameBoard .mini-pillars .pilar.destroyed:not(.pillar-destroyed-burst) :is(.pillar-icon, .pillar-label, .pillar-value) {
    opacity: 1 !important;
}
body.duel-playing #gameBoard .mini-pillars .pilar.destroyed:not(.pillar-destroyed-burst) .pillar-icon {
    color: #c4b5fd !important;
    background: rgba(167, 139, 250, .12) !important;
    border-color: rgba(167, 139, 250, .35) !important;
    box-shadow: none !important;
    filter: grayscale(.4);
}
body.duel-playing #gameBoard .mini-pillars .pilar.destroyed:not(.pillar-destroyed-burst) .pillar-label { color: #c4b5fd !important; }
body.duel-playing #gameBoard .mini-pillars .pilar.destroyed:not(.pillar-destroyed-burst) .pillar-value { display: none !important; }
body.duel-playing #gameBoard .mini-pillars .pilar.destroyed:not(.pillar-destroyed-burst)::after {
    content: "Caído";
    position: static !important;
    align-self: center;
    justify-self: end;
    height: auto;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(167, 139, 250, .45);
    background: rgba(167, 139, 250, .18);
    color: #ddd6fe;
    font-size: .6rem;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1.3;
    text-transform: uppercase;
}

/* ---------------------------------------------------------------------
   5. Cartas: una sola etiqueta de acción por carta.
   --------------------------------------------------------------------- */
body.duel-playing #gameBoard .game-card.blocker-candidate:not(.supporter-candidate):has(.card-action-badge.candidate)::after,
body.duel-playing #gameBoard .game-card.attack-candidate:not(.supporter-candidate):has(.card-action-badge.candidate)::after {
    content: none !important;
    display: none !important;
}
body.duel-playing #gameBoard .game-card .dons .card-action-badge.candidate {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    border-color: rgba(134, 239, 172, .85) !important;
    color: #052e16 !important;
    background: linear-gradient(135deg, #bbf7d0, #4ade80) !important;
    box-shadow: 0 0 12px rgba(74, 222, 128, .35) !important;
    font-weight: 900 !important;
}

/* ---------------------------------------------------------------------
   6. Paneles flotantes del duelo: nunca encima de una ventana de decisión.
   --------------------------------------------------------------------- */
body.duel-playing .cantico-status-panel {
    z-index: 95;
    right: 64px;
    bottom: 12px;
    width: calc(clamp(320px, 23vw, 382px) - 62px);
    gap: 2px;
    padding: 7px 12px;
    font-size: .68rem;
    line-height: 1.25;
    border-color: rgba(203, 167, 85, .45);
    background: rgba(8, 11, 20, .94);
}
body.duel-playing .cantico-status-panel > strong { color: #f5d78e; font-size: .74rem; letter-spacing: .06em; }
body.duel-playing:has(#canticoStatusPanel:not(.hidden)) #gameBoard .right-dock { padding-bottom: 92px !important; }
body.duel-playing .toast-stack { z-index: 96; }

/* Ventanas de decisión: acciones siempre a la vista aunque el contenido sea alto. */
body.duel-playing .choice-modal .game-dialog-actions,
body.duel-playing .choice-modal .pending-choice-actions {
    position: sticky;
    bottom: -18px;
    z-index: 2;
    margin: 0 -18px -18px !important;
    padding: 12px 18px 16px !important;
    background: linear-gradient(180deg, rgba(20, 28, 48, 0), rgba(20, 28, 48, .96) 28%, rgba(20, 28, 48, .99)) !important;
}
@media (min-width: 760px) {
    body.duel-playing .pillar-choice-modal.with-card-detail:has(.game-dialog-card-list) {
        display: grid !important;
        grid-template-columns: minmax(200px, 250px) minmax(0, 1fr);
        grid-template-areas: "head head" "card choices";
        align-items: start;
        column-gap: 18px;
    }
    body.duel-playing .pillar-choice-modal.with-card-detail > .choice-modal-head { grid-area: head; }
    body.duel-playing .pillar-choice-modal.with-card-detail > .game-dialog-card-list { grid-area: card; grid-template-columns: 1fr !important; margin: 0 !important; }
    body.duel-playing .pillar-choice-modal.with-card-detail > .pillar-choice-grid { grid-area: choices; grid-template-columns: 1fr !important; }
}
body.duel-playing .pillar-choice-grid > button.pillar-choice {
    display: grid;
    gap: 4px;
    min-height: 64px;
    text-align: left;
    border: 1px solid rgba(244, 199, 106, .55);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(244, 199, 106, .14), rgba(15, 23, 42, .85));
}
body.duel-playing .pillar-choice-grid > button.pillar-choice strong { color: #fff1cf; font-size: 1.02rem; }
body.duel-playing .pillar-choice-grid > button.pillar-choice:hover,
body.duel-playing .pillar-choice-grid > button.pillar-choice:focus-visible {
    border-color: rgba(255, 217, 138, .95);
    box-shadow: 0 0 0 2px rgba(244, 199, 106, .35), 0 10px 24px rgba(0, 0, 0, .35);
}

/* ---------------------------------------------------------------------
   7. Pantallas donde el tablero ocupa todo el ancho (≤980 px y tablet
      horizontal táctil): barra de mando fija abajo con turno, fase,
      indicación y acciones; Cánticos en una franja fina encima.
      (Bloques equivalentes: CSS no permite unir media query + clase.)
   --------------------------------------------------------------------- */
@media (max-width: 980px) {
    body.duel-playing { --dx-bar-h: 136px; --dx-strip-h: 30px; }
    body.duel-playing main { padding-bottom: calc(var(--dx-bar-h) + var(--dx-strip-h) + 24px) !important; }
    body.duel-playing #gameBoard .right-dock > .action-dock {
        position: fixed !important;
        left: 8px;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
        z-index: 90;
        height: var(--dx-bar-h);
        box-sizing: border-box;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 26px auto 1fr;
        gap: 6px 12px !important;
        padding: 8px 10px !important;
        margin: 0 !important;
        overflow: hidden;
        border: 1px solid rgba(244, 199, 106, .5) !important;
        border-radius: 16px !important;
        background: linear-gradient(180deg, rgba(14, 20, 38, .97), rgba(6, 10, 22, .98)) !important;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, .45) !important;
        backdrop-filter: blur(6px);
    }
    body.duel-playing #gameBoard .right-dock > .action-dock > h3,
    body.duel-playing #gameBoard .right-dock > .action-dock > #combatSummary,
    body.duel-playing #gameBoard .right-dock > .action-dock > #gameLog,
    body.duel-playing #gameBoard .right-dock > .action-dock > #selectionInfo small { display: none !important; }
    body.duel-playing #gameBoard .right-dock > .action-dock > #selectionInfo {
        grid-row: 2;
        grid-column: 1;
        align-self: center;
        padding: 0 0 0 26px !important;
        border: 0 !important;
        background: none !important;
        font-size: .74rem !important;
        line-height: 1.3 !important;
    }
    body.duel-playing #gameBoard .right-dock > .action-dock > #selectionInfo strong {
        display: -webkit-box !important;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        margin: 0 !important;
    }
    body.duel-playing #gameBoard .right-dock > .action-dock > #selectionInfo::before { left: 0; top: 0; width: 18px; height: 18px; font-size: .7rem; }
    body.duel-playing #gameBoard .right-dock > .action-dock > .action-row {
        grid-row: 3;
        grid-column: 1;
        align-self: center;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        min-width: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }
    body.duel-playing #gameBoard .right-dock > .action-dock .action-row > button {
        flex: 1 0 auto;
        width: auto !important;
        max-width: none !important;
        min-height: 44px !important;
        padding: 8px 12px !important;
        font-size: .74rem !important;
        letter-spacing: .03em !important;
    }
    body.duel-playing #gameBoard .right-dock > .action-dock .action-row > :is(#btnExitDuel, #btnSurrenderOnline) {
        flex: 0 0 auto;
        min-width: 44px;
        min-height: 44px !important;
        padding: 8px 10px !important;
        font-size: .66rem !important;
    }
    /* Turno y fase en la franja superior de la barra. */
    body.duel-playing #gameBoard .right-dock > .match-info-dock {
        position: fixed !important;
        left: 14px;
        right: 14px;
        bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--dx-bar-h) - 34px);
        z-index: 91;
        height: 26px;
        margin: 0 !important;
        padding: 0 0 0 10px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        pointer-events: none;
    }
    body.duel-playing #gameBoard .right-dock > .match-info-dock::before { inset: 3px auto 3px 0; width: 4px; border-radius: 4px; }
    body.duel-playing #gameBoard .right-dock > .match-info-dock .duel-status-bar { display: block !important; }
    body.duel-playing #gameBoard .right-dock > .match-info-dock .match-players { display: none !important; }
    body.duel-playing #gameBoard .right-dock > .match-info-dock .match-data {
        flex-wrap: nowrap !important;
        gap: 8px !important;
        height: 26px;
        min-width: 0;
    }
    body.duel-playing #gameBoard .right-dock > .match-info-dock .match-data #phaseText { order: 1; flex: 0 0 auto; padding: 3px 9px 3px 8px !important; font-size: .7rem !important; }
    body.duel-playing #gameBoard .right-dock > .match-info-dock .match-data #turnText {
        order: 2;
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden !important;
        text-overflow: ellipsis;
        white-space: nowrap !important;
        font-size: .8rem !important;
    }
    body.duel-playing #gameBoard .right-dock > .match-info-dock .match-data #localDuelLatency { order: 3; flex: 0 0 auto; white-space: nowrap; display: none !important; }
    /* Cánticos: franja fina sobre la barra, sin tapar el tablero. */
    body.duel-playing .cantico-status-panel {
        top: auto;
        left: 8px;
        right: 60px;
        bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--dx-bar-h) + 6px);
        width: auto;
        height: var(--dx-strip-h);
        max-height: none;
        box-sizing: border-box;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 12px;
        padding: 3px 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        border-radius: 999px;
        font-size: .64rem;
        white-space: nowrap;
    }
    body.duel-playing .cantico-status-panel > div { flex: 0 0 auto; flex-wrap: nowrap; }
    body.duel-playing .cantico-status-panel > div > span:first-child { min-width: 0; }
    body.duel-playing .cantico-status-panel .cantico-zone-card { width: 16px; height: 22px; }
    body.duel-playing:has(#canticoStatusPanel:not(.hidden)) #gameBoard .right-dock { padding-bottom: 0 !important; }
    body.duel-playing .music-player { bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--dx-bar-h) + 2px) !important; right: 10px !important; }
    body.duel-playing .toast-stack { bottom: calc(var(--dx-bar-h) + var(--dx-strip-h) + 28px); right: 10px; left: 10px; width: auto; align-items: center; }

    /* Zonas laterales angostas y legibles: icono, nombre y cantidad en columna. */
    body.duel-playing #gameBoard .side-stacks .stack-zone {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        padding: 4px 2px !important;
        overflow: hidden;
        font-size: .56rem !important;
        line-height: 1.05 !important;
        text-align: center !important;
        white-space: normal !important;
        word-break: keep-all;
    }
    body.duel-playing #gameBoard .side-stacks .stack-zone::before,
    body.duel-playing #gameBoard .side-stacks .stack-zone::after { position: static !important; transform: none !important; margin: 0 !important; }
    body.duel-playing #gameBoard .side-stacks .stack-zone::after { padding: 1px 4px !important; font-size: .54rem !important; white-space: nowrap !important; }
    /* Pilares compactos: icono y valor; el nombre queda en la etiqueta accesible. */
    body.duel-playing #gameBoard .mini-pillars .pilar .pillar-label { display: none !important; }
    body.duel-playing #gameBoard .mini-pillars .pilar,
    body.duel-playing #gameBoard .mini-pillars .pilar.destroyed:not(.pillar-destroyed-burst) {
        min-width: 64px !important;
        grid-template-columns: auto auto !important;
        justify-content: center;
    }
}
@media (min-width: 700px) and (max-width: 980px) {
    body.duel-playing { --dx-bar-h: 104px; }
    body.duel-playing #gameBoard .right-dock > .action-dock { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 26px 1fr; }
    body.duel-playing #gameBoard .right-dock > .action-dock > .action-row { grid-row: 2; grid-column: 2; max-width: 64vw; }
    body.duel-playing #gameBoard .right-dock > .action-dock .action-row > button { flex: 0 0 auto; }
    body.duel-playing #gameBoard .right-dock > .match-info-dock .match-data #localDuelLatency { display: inline-flex !important; }
}
@media (max-width: 760px) {
    body.duel-playing #gameBoard .table-row > .side-stacks { flex: 0 0 66px !important; width: 66px !important; min-width: 0 !important; }
    /* Salir/Rendirse solo con icono en teléfono (el nombre accesible es el texto del botón). */
    body.duel-playing #gameBoard .right-dock > .action-dock .action-row > :is(#btnExitDuel, #btnSurrenderOnline) {
        width: 44px !important;
        min-width: 44px !important;
        padding: 0 !important;
        font-size: 0 !important;
        letter-spacing: 0 !important;
        gap: 0;
    }
    body.duel-playing #gameBoard .right-dock > .action-dock .action-row > button { padding: 8px 10px !important; font-size: .7rem !important; gap: 6px; }
    /* Insignia de turno en línea con el nombre (la cabecera se centra en móvil). */
    body.duel-playing #gameBoard .hand-zone .zone-title-line { display: inline-flex !important; align-items: center; justify-content: center; gap: 6px; }
    body.duel-playing #gameBoard .hand-zone:has(.resource-main.active) .zone-title-line::after,
    body.duel-playing #gameBoard .hand-zone.defender-player .zone-title-line::after,
    body.duel-playing #gameBoard:has(.player-field-zone.defender-player) .player-hand-zone .zone-title-line::after { position: static; }
}
@media (orientation: landscape) and (min-width: 900px) and (max-width: 1400px) and (max-height: 900px) {
    body.touch-layout-capable.duel-playing { --dx-bar-h: 104px; --dx-strip-h: 30px; }
    body.touch-layout-capable.duel-playing main { padding-bottom: calc(var(--dx-bar-h) + var(--dx-strip-h) + 24px) !important; }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .action-dock {
        position: fixed !important;
        left: 8px;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
        z-index: 90;
        height: var(--dx-bar-h);
        box-sizing: border-box;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: 26px 1fr;
        gap: 6px 12px !important;
        padding: 8px 10px !important;
        margin: 0 !important;
        overflow: hidden;
        border: 1px solid rgba(244, 199, 106, .5) !important;
        border-radius: 16px !important;
        background: linear-gradient(180deg, rgba(14, 20, 38, .97), rgba(6, 10, 22, .98)) !important;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, .45) !important;
        backdrop-filter: blur(6px);
    }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .action-dock > h3,
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .action-dock > #combatSummary,
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .action-dock > #gameLog,
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .action-dock > #selectionInfo small { display: none !important; }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .action-dock > #selectionInfo {
        grid-row: 2;
        grid-column: 1;
        align-self: center;
        padding: 0 0 0 26px !important;
        border: 0 !important;
        background: none !important;
        font-size: .78rem !important;
        line-height: 1.3 !important;
    }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .action-dock > #selectionInfo strong {
        display: -webkit-box !important;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        margin: 0 !important;
    }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .action-dock > #selectionInfo::before { left: 0; top: 0; width: 18px; height: 18px; font-size: .7rem; }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .action-dock > .action-row {
        grid-row: 2;
        grid-column: 2;
        align-self: center;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        min-width: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .action-dock .action-row > button {
        flex: 0 0 auto;
        width: auto !important;
        max-width: none !important;
        min-height: 44px !important;
        padding: 8px 12px !important;
        font-size: .78rem !important;
        letter-spacing: .03em !important;
    }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .action-dock .action-row > :is(#btnExitDuel, #btnSurrenderOnline) {
        flex: 0 0 auto;
        min-width: 44px;
        min-height: 44px !important;
        padding: 8px 10px !important;
        font-size: .66rem !important;
    }
    /* Turno y fase en la franja superior de la barra. */
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .match-info-dock {
        position: fixed !important;
        left: 14px;
        right: 14px;
        bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--dx-bar-h) - 34px);
        z-index: 91;
        height: 26px;
        margin: 0 !important;
        padding: 0 0 0 10px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        pointer-events: none;
    }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .match-info-dock::before { inset: 3px auto 3px 0; width: 4px; border-radius: 4px; }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .match-info-dock .duel-status-bar { display: block !important; }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .match-info-dock .match-players { display: none !important; }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .match-info-dock .match-data {
        flex-wrap: nowrap !important;
        gap: 8px !important;
        height: 26px;
        min-width: 0;
    }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .match-info-dock .match-data #phaseText { order: 1; flex: 0 0 auto; padding: 3px 9px 3px 8px !important; font-size: .7rem !important; }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .match-info-dock .match-data #turnText {
        order: 2;
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden !important;
        text-overflow: ellipsis;
        white-space: nowrap !important;
        font-size: .8rem !important;
    }
    body.touch-layout-capable.duel-playing #gameBoard .right-dock > .match-info-dock .match-data #localDuelLatency { order: 3; flex: 0 0 auto; white-space: nowrap;  }
    /* Cánticos: franja fina sobre la barra, sin tapar el tablero. */
    body.touch-layout-capable.duel-playing .cantico-status-panel {
        top: auto;
        left: 8px;
        right: 60px;
        bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--dx-bar-h) + 6px);
        width: auto;
        height: var(--dx-strip-h);
        max-height: none;
        box-sizing: border-box;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 12px;
        padding: 3px 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        border-radius: 999px;
        font-size: .64rem;
        white-space: nowrap;
    }
    body.touch-layout-capable.duel-playing .cantico-status-panel > div { flex: 0 0 auto; flex-wrap: nowrap; }
    body.touch-layout-capable.duel-playing .cantico-status-panel > div > span:first-child { min-width: 0; }
    body.touch-layout-capable.duel-playing .cantico-status-panel .cantico-zone-card { width: 16px; height: 22px; }
    body.touch-layout-capable.duel-playing:has(#canticoStatusPanel:not(.hidden)) #gameBoard .right-dock { padding-bottom: 0 !important; }
    body.touch-layout-capable.duel-playing .music-player { bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--dx-bar-h) + 2px) !important; right: 10px !important; }
    body.touch-layout-capable.duel-playing .toast-stack { bottom: calc(var(--dx-bar-h) + var(--dx-strip-h) + 28px); right: 10px; left: 10px; width: auto; align-items: center; }

    /* El tablero se ajusta al alto libre para que la mano propia no quede bajo la barra. */
    body.touch-layout-capable.duel-playing .board-layout .board-main.panel {
        height: calc(100dvh - var(--dx-bar-h) - var(--dx-strip-h) - 40px) !important;
        min-height: 0 !important;
    }
    body.touch-layout-capable.duel-playing .board-layout { grid-template-rows: auto auto !important; }
}

/* ---------------------------------------------------------------------
   8. Animaciones (solo CSS; se desactivan con movimiento reducido).
   --------------------------------------------------------------------- */
@keyframes dx-cta-glow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(36, 22, 4, .35) inset, 0 8px 22px rgba(244, 199, 106, .26); }
    50% { box-shadow: 0 0 0 1px rgba(36, 22, 4, .35) inset, 0 8px 30px rgba(244, 199, 106, .5), 0 0 0 3px rgba(244, 199, 106, .16); }
}
@keyframes dx-turn-breathe {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255, 217, 138, .3), 0 0 20px rgba(244, 199, 106, .16), inset 0 0 30px rgba(244, 199, 106, .05); }
    50% { box-shadow: 0 0 0 1px rgba(255, 217, 138, .5), 0 0 32px rgba(244, 199, 106, .3), inset 0 0 36px rgba(244, 199, 106, .09); }
}
@media (prefers-reduced-motion: reduce) {
    body.duel-playing #gameBoard .action-dock .action-row > button,
    body.duel-playing #gameBoard .hand-zone:has(.resource-main.active) { animation: none !important; }
}
