/* =====================
   v6 - Tablero local más ordenado
   ===================== */
body { overflow-x: hidden; }
#duel.view.active { max-width: 100%; }
.duel-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(10px);
    padding: 14px 18px;
}
.duel-toolbar h2 { margin-bottom: 4px; }
.duel-toolbar p { margin: 0; }
.toolbar-actions select { min-width: 230px; }
.game-board {
    gap: 12px;
    max-width: 100%;
}
.player-zone {
    padding: 12px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(15,23,42,.92), rgba(15,23,42,.72)),
        radial-gradient(circle at top, rgba(56,189,248,.08), transparent 24rem);
}
.player-zone.active-player {
    border-color: rgba(245,158,11,.72);
    box-shadow: 0 0 0 2px rgba(245,158,11,.12), 0 18px 42px rgba(0,0,0,.24);
}
.player-zone.defender-player {
    border-color: rgba(56,189,248,.55);
}
.player-zone h4 {
    margin: 10px 0 8px;
    color: #e0f2fe;
    letter-spacing: .02em;
}
.player-info {
    padding: 8px 10px;
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 14px;
    background: rgba(2,6,23,.28);
}
.pilares {
    flex-wrap: wrap;
}
.pilar {
    min-width: 86px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
}
.pilar span {
    color: #cbd5e1;
    font-size: .78rem;
}
.pilar strong {
    color: #fef3c7;
    font-size: 1.05rem;
}
.pilar.danger {
    border-color: rgba(239,68,68,.7);
    background: rgba(127,29,29,.35);
}
.battlefield,
.hand {
    display: flex;
    gap: 10px;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 226px;
    padding: 10px;
    border: 1px dashed rgba(148,163,184,.22);
    border-radius: 16px;
    background:
        linear-gradient(90deg, rgba(15,23,42,.72), rgba(30,41,59,.42)),
        radial-gradient(circle at center, rgba(34,197,94,.08), transparent 24rem);
    scrollbar-width: thin;
}
.battlefield {
    min-height: 244px;
    background:
        linear-gradient(90deg, rgba(21,83,45,.22), rgba(15,23,42,.62)),
        radial-gradient(circle at center, rgba(245,158,11,.08), transparent 22rem);
}
.hand {
    min-height: 214px;
    background: rgba(2,6,23,.28);
}
.empty-zone {
    min-width: 180px;
    min-height: 96px;
    display: grid;
    place-items: center;
    color: rgba(203,213,225,.65);
    border: 1px dashed rgba(148,163,184,.22);
    border-radius: 14px;
    font-weight: 700;
}
.game-board .game-card.duel-card {
    width: 148px;
    min-width: 148px;
    height: 220px;
    min-height: 220px;
    padding: 8px;
    gap: 5px;
    border-radius: 14px;
    scroll-snap-align: start;
}
.game-board .hand .game-card.duel-card {
    width: 132px;
    min-width: 132px;
    height: 196px;
    min-height: 196px;
    opacity: .96;
}
.game-board .game-card.duel-card:hover {
    transform: translateY(-2px);
    border-color: rgba(245,158,11,.62);
}
.game-board .game-card.selected {
    outline: 2px solid var(--accent);
    box-shadow: 0 0 0 4px rgba(245,158,11,.15);
}
.game-board .card-image {
    height: 76px;
    border-radius: 10px;
}
.game-board .hand .card-image { height: 62px; }
.game-board .cost {
    min-width: 26px;
    height: 26px;
    font-size: .86rem;
}
.game-board .faction,
.game-board .card-type,
.game-board .stats,
.game-board .don {
    font-size: .72rem;
}
.game-board .card-name {
    font-size: .82rem;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.game-board .card-type {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.game-board .stats {
    display: block;
    color: #fef3c7;
}
.game-board .ability {
    display: none;
}
.game-board .dons {
    margin-top: auto;
    gap: 4px;
    max-height: 42px;
    overflow: hidden;
}
.game-board .don {
    padding: 2px 5px;
}
.center-panel {
    position: sticky;
    top: 84px;
    z-index: 4;
    padding: 14px;
    border-radius: 18px;
    background: rgba(15,23,42,.96);
    backdrop-filter: blur(12px);
}
.phase-box {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148,163,184,.18);
}
.phase-box strong {
    font-size: 1.05rem;
}
.action-row {
    gap: 8px;
}
.action-row button {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: .86rem;
}
.duel-center-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, .8fr);
    gap: 12px;
    margin-top: 12px;
}
.selection-box,
.combat-summary,
.selected-card-detail {
    border: 1px solid rgba(148,163,184,.22);
    border-radius: 14px;
    background: rgba(2,6,23,.32);
}
.selection-box {
    margin-top: 0;
    color: #bfdbfe;
    font-weight: 700;
}
.combat-summary {
    margin-top: 10px;
    padding: 10px 12px;
    color: #cbd5e1;
}
.combat-summary strong,
.selected-card-detail > strong {
    display: block;
    color: #fef3c7;
    margin-bottom: 6px;
}
.combat-summary span,
.selected-card-detail > span {
    color: var(--muted);
}
.combat-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-top: 1px solid rgba(148,163,184,.14);
}
.combat-line span { color: #e0f2fe; }
.combat-line em {
    color: #fde68a;
    font-style: normal;
    text-align: right;
}
.selected-card-detail {
    padding: 10px;
    min-height: 118px;
}
.detail-head {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 10px;
    align-items: center;
}
.detail-head img,
.detail-placeholder {
    width: 84px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(30,41,59,.7);
}
.detail-placeholder {
    display: grid;
    place-items: center;
    color: rgba(255,255,255,.5);
    font-size: .76rem;
}
.detail-head strong {
    display: block;
    color: #fff;
    line-height: 1.15;
}
.detail-head small,
.detail-head b {
    display: block;
    margin-top: 3px;
}
.detail-head small { color: var(--muted); }
.detail-head b { color: #fef3c7; font-size: .86rem; }
.selected-card-detail p {
    margin: 8px 0;
    color: #dbeafe;
    font-size: .86rem;
    line-height: 1.35;
    max-height: 76px;
    overflow: auto;
}
.detail-dons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.detail-dons span {
    border: 1px solid rgba(245,158,11,.35);
    color: #fde68a;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: .72rem;
    background: rgba(245,158,11,.08);
}
.log {
    max-height: 112px;
    font-size: .82rem;
}
details summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(59,130,246,.12);
}
@media (max-width: 1100px) {
    .duel-center-grid { grid-template-columns: 1fr; }
    .center-panel { position: static; }
    .toolbar-actions select { min-width: 100%; }
}
@media (max-width: 700px) {
    main { padding: 0 12px 24px; }
    .game-board .game-card.duel-card { width: 126px; min-width:126px; }
    .game-board .hand .game-card.duel-card { width: 118px; min-width:118px; }
    .topbar, .tabs { padding-left: 14px; padding-right:14px; }
}


.inline-link {
    border: none;
    background: transparent;
    color: #93c5fd;
    cursor: pointer;
    font-weight: 800;
    padding: 2px 0;
    text-decoration: underline;
}
.inline-link:hover {
    color: #ffffff;
}
.combat-line .inline-link {
    justify-self: end;
    white-space: nowrap;
}

/* =====================
   v6.2 - Bloqueo por doble click
   ===================== */
.game-board .game-card.blocker-candidate {
    border-color: rgba(56,189,248,.78);
    box-shadow: 0 0 0 2px rgba(56,189,248,.16), 0 10px 28px rgba(14,165,233,.08);
}
.game-board .game-card.blocker-candidate::after {
    content: "Doble click para bloquear";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    text-align: center;
    border-radius: 999px;
    padding: 4px 6px;
    background: rgba(14,165,233,.92);
    color: #eff6ff;
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .01em;
    pointer-events: none;
}
.game-board .game-card.blocker-candidate .dons {
    padding-bottom: 22px;
}
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(2,6,23,.78);
    backdrop-filter: blur(8px);
}
.choice-modal {
    width: min(980px, 96vw);
    max-height: 88vh;
    overflow: auto;
    border: 1px solid rgba(148,163,184,.32);
    border-radius: 22px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(30,41,59,.98));
    box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.choice-modal-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(148,163,184,.22);
}
.choice-modal-head strong {
    display: block;
    color: #fef3c7;
    font-size: 1.18rem;
    margin-bottom: 4px;
}
.choice-modal-head span {
    color: #cbd5e1;
    line-height: 1.4;
}
.attacker-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}
.attacker-choice {
    text-align: left;
    border: 1px solid rgba(148,163,184,.25);
    border-radius: 18px;
    padding: 10px;
    background: rgba(15,23,42,.78);
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.attacker-choice:hover {
    border-color: rgba(245,158,11,.72);
    transform: translateY(-2px);
}
.attacker-choice .game-card {
    width: 100%;
    min-width: 0;
    height: 228px;
    min-height: 228px;
    pointer-events: none;
}
.attacker-choice-info {
    display: grid;
    gap: 3px;
}
.attacker-choice-info strong {
    color: #fff;
    line-height: 1.15;
}
.attacker-choice-info span {
    color: #fef3c7;
    font-weight: 800;
}
.attacker-choice-info small {
    color: #bfdbfe;
}
.combat-line small {
    color: #93c5fd;
    font-weight: 800;
    text-align: right;
}
@media (max-width: 680px) {
    .choice-modal-head { flex-direction: column; }
    .attacker-choice-grid { grid-template-columns: 1fr; }
}

/* =====================
   v7 - Distribución tipo mesa según bosquejo del usuario
   ===================== */
#duel.view.active main,
#duel.view.active {
    max-width: 100%;
}
.duel-toolbar {
    position: static;
    margin-bottom: 12px;
}
#gameBoard.game-board {
    display: block;
    gap: 0;
}
.board-layout {
    display: grid;
    grid-template-columns: minmax(860px, 1fr) 320px;
    gap: 16px;
    align-items: stretch;
    width: 100%;
}
.board-main {
    min-height: 720px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,.035);
    border: 3px solid rgba(226,232,240,.28);
    box-shadow: none;
    display: grid;
    grid-template-rows: clamp(148px, 18vh, 196px) minmax(154px, .72fr) minmax(248px, 1.55fr) minmax(154px, .72fr);
    gap: 8px;
}
.board-status-row {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(56px, auto) minmax(80px, 1fr);
    gap: 8px;
    min-height: 0;
}
.match-data {
    border: 3px solid rgba(226,232,240,.75);
    background: rgba(2,6,23,.25);
    border-radius: 4px;
    padding: 10px 14px;
    overflow: hidden;
    display: grid;
    align-content: start;
    gap: 4px;
}
.match-data > strong {
    color: #f8fafc;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: .82rem;
}
.match-data > span {
    color: #bfdbfe;
    font-weight: 800;
    font-size: .9rem;
}
.match-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}
.compact-info {
    padding: 4px 6px !important;
    border-radius: 8px !important;
    font-size: .74rem;
    min-height: auto;
}
.compact-info span:nth-child(2) {
    color: #cbd5e1;
}
.jungle-area {
    display: grid;
    grid-template-columns: minmax(126px, 1.35fr) repeat(3, minmax(86px, 1fr)) minmax(126px, 1.25fr);
    gap: 8px;
    min-height: 0;
}
.jungle-card {
    border: 3px solid rgba(196,181,253,.85);
    background: rgba(237,233,254,.12);
    color: #ede9fe;
    border-radius: 4px;
    padding: 5px 3px;
    font-size: .78rem;
    line-height: 1.12;
    display: grid;
    place-items: center;
}
.jungle-card.small-zone {
    font-size: .72rem;
}
.table-row {
    min-width: 0;
}
.opponent-hand-row,
.player-hand-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 196px;
    gap: 12px;
}
.field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
}
.field-column {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    min-height: 0;
}
.zone-box {
    border-radius: 6px;
    background: rgba(15,23,42,.50);
    min-width: 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
}
.zone-box > header {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px;
    color: #f8fafc;
    font-size: .86rem;
    font-weight: 900;
    background: rgba(2,6,23,.22);
    border-bottom: 1px solid rgba(148,163,184,.18);
}
.hand-zone {
    border: 4px solid rgba(239,68,68,.92);
}
.field-zone {
    border: 4px solid rgba(34,197,94,.88);
}
.opponent-field-zone {
    background: linear-gradient(180deg, rgba(15,23,42,.56), rgba(30,41,59,.34));
}
.player-field-zone {
    background: linear-gradient(180deg, rgba(21,83,45,.22), rgba(15,23,42,.50));
}
.side-stacks {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
}
.stack-zone {
    border: 4px solid rgba(239,68,68,.94);
    background: rgba(2,6,23,.25);
    color: #f8fafc;
    border-radius: 4px;
    font-weight: 800;
    padding: 5px;
}
.stack-zone.muted-zone {
    color: #cbd5e1;
}
.climate-zone {
    border: 4px solid rgba(226,232,240,.82);
    background: rgba(2,6,23,.18);
    border-radius: 4px;
    min-height: 0;
    display: grid;
    place-items: center;
}
.climate-zone > button {
    border: 4px solid rgba(125,211,252,.85);
    width: 88px;
    height: 124px;
    display: grid;
    place-items: center;
    text-align: center;
    color: #e0f2fe;
    background: rgba(14,165,233,.10);
    font-weight: 900;
    border-radius: 2px;
}
.mini-pillars {
    margin: 0;
    display: flex;
    align-items: center;
    gap: clamp(5px, .5vw, 8px);
    flex-wrap: nowrap;
    overflow: visible;
}
.mini-pillars .pilar {
    position: relative;
    min-width: clamp(112px, 7.4vw, 138px);
    min-height: clamp(58px, 4.2vw, 72px);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(244,199,106,.54);
    background:
        radial-gradient(circle at 18% 18%, rgba(125,211,252,.20), transparent 30%),
        linear-gradient(135deg, rgba(15,23,42,.94), rgba(8,18,38,.82));
    color: #f8fafc;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 9px;
    row-gap: 3px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.10),
        inset 0 0 16px rgba(45,112,255,.10),
        0 8px 18px rgba(0,0,0,.22);
    overflow: hidden;
}
.mini-pillars .pilar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(244,199,106,.16), transparent 42%, rgba(125,211,252,.10));
    opacity: .72;
}
.mini-pillars .pillar-icon {
    grid-row: 1 / span 2;
    width: clamp(34px, 2.4vw, 42px);
    height: clamp(34px, 2.4vw, 42px);
    border-radius: 5px;
    display: grid;
    place-items: center;
    color: #fde68a;
    font-size: clamp(1.28rem, 1.55vw, 1.72rem);
    line-height: 1;
    background: rgba(244,199,106,.13);
    border: 1px solid rgba(244,199,106,.28);
    box-shadow: 0 0 12px rgba(244,199,106,.16);
}
.mini-pillars .pillar-label {
    min-width: 0;
    color: #c7d2fe;
    font-size: clamp(.68rem, .62vw, .82rem);
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mini-pillars .pillar-value {
    position: relative;
    z-index: 1;
    color: #fef3c7;
    font-size: clamp(1.65rem, 1.65vw, 2.08rem);
    line-height: 1;
    font-weight: 950;
    text-shadow: 0 0 14px rgba(244,199,106,.42);
}
.mini-pillars .pilar.damaged {
    border-color: rgba(251,191,36,.70);
    box-shadow: inset 0 0 18px rgba(251,191,36,.12), 0 8px 20px rgba(0,0,0,.24);
}
.mini-pillars .pilar.critical,
.mini-pillars .pilar.danger {
    border-color: rgba(248,113,113,.82);
    background:
        radial-gradient(circle at 18% 18%, rgba(248,113,113,.26), transparent 32%),
        linear-gradient(135deg, rgba(69,10,10,.92), rgba(15,23,42,.86));
    box-shadow:
        inset 0 0 18px rgba(248,113,113,.22),
        0 0 18px rgba(248,113,113,.20),
        0 8px 20px rgba(0,0,0,.28);
    animation: pillarCriticalPulse 1.9s ease-in-out infinite;
}
.mini-pillars .pilar.critical .pillar-value,
.mini-pillars .pilar.danger .pillar-value {
    color: #fecaca;
    text-shadow: 0 0 16px rgba(248,113,113,.58);
}
.mini-pillars .pilar.destroyed {
    border-color: rgba(100,116,139,.72);
    background: linear-gradient(135deg, rgba(15,23,42,.88), rgba(30,41,59,.66));
    color: #94a3b8;
    filter: grayscale(.55);
    opacity: .18;
    transform: scale(.62);
    min-width: 0;
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-width: 0;
    animation: none;
    pointer-events: none;
}
.mini-pillars .pilar.destroyed .pillar-value {
    color: #cbd5e1;
    text-shadow: none;
}
.mini-pillars .pilar.destroyed .pillar-icon,
.mini-pillars .pilar.destroyed .pillar-label,
.mini-pillars .pilar.destroyed .pillar-value {
    opacity: 0;
}
.mini-pillars .pilar.pillar-destroyed-burst {
    width: auto;
    min-width: clamp(112px, 7.4vw, 138px);
    padding: 8px 10px;
    border-width: 1px;
    opacity: 1;
    transform: none;
    animation: pillarDestroyBurst .74s cubic-bezier(.18, .8, .24, 1) both;
}
.mini-pillars .pilar.pillar-destroyed-burst::after {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: 14px;
    border: 2px solid rgba(248, 113, 113, .72);
    box-shadow: 0 0 32px rgba(248, 113, 113, .5);
    pointer-events: none;
    animation: pillarDestroyRing .74s ease-out both;
}
.mini-pillars .pilar.pillar-destroyed-burst .pillar-icon,
.mini-pillars .pilar.pillar-destroyed-burst .pillar-label,
.mini-pillars .pilar.pillar-destroyed-burst .pillar-value {
    opacity: 1;
}
@keyframes pillarCriticalPulse {
    0%, 100% { box-shadow: inset 0 0 18px rgba(248,113,113,.20), 0 0 14px rgba(248,113,113,.16), 0 8px 20px rgba(0,0,0,.28); }
    50% { box-shadow: inset 0 0 24px rgba(248,113,113,.34), 0 0 24px rgba(248,113,113,.32), 0 8px 22px rgba(0,0,0,.30); }
}
@keyframes pillarDestroyBurst {
    0% { opacity: 1; transform: scale(1); filter: brightness(1); }
    22% { opacity: 1; transform: scale(1.08) rotate(-1deg); filter: brightness(1.45) saturate(1.25); }
    54% { opacity: .9; transform: scale(.94) rotate(1deg); filter: brightness(.9) grayscale(.2); }
    100% { opacity: .18; transform: scale(.62); filter: grayscale(.55); }
}
@keyframes pillarDestroyRing {
    0% { opacity: 0; transform: scale(.7); }
    24% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.35); }
}
.board-main .hand,
.board-main .battlefield {
    min-height: 0;
    height: calc(100% - 28px);
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.board-main .battlefield {
    background: rgba(15,23,42,.14);
}
.board-main .hand {
    background: rgba(2,6,23,.10);
}
.board-main .empty-zone {
    min-height: 70px;
    min-width: 140px;
    font-size: .82rem;
    align-self: center;
}
.board-main .game-card.duel-card {
    width: 104px;
    min-width: 104px;
    height: 112px;
    min-height: 112px;
    padding: 5px;
    border-radius: 10px;
    gap: 3px;
}
.board-main .hand .game-card.duel-card {
    width: 96px;
    min-width: 96px;
    height: 106px;
    min-height: 106px;
}
.board-main .card-image {
    height: 44px;
    border-radius: 7px;
}
.board-main .hand .card-image {
    height: 42px;
}
.board-main .cost {
    min-width: 20px;
    height: 20px;
    font-size: .68rem;
}
.board-main .faction,
.board-main .card-type,
.board-main .stats,
.board-main .don {
    font-size: .55rem;
}
.board-main .card-name {
    font-size: .62rem;
    line-height: 1.08;
    -webkit-line-clamp: 2;
}
.board-main .stats {
    display: none;
}
.board-main .card-type {
    display: none;
}
.board-main .dons {
    max-height: 18px;
    gap: 2px;
}
.board-main .don {
    padding: 1px 4px;
}
.board-main .game-card.blocker-candidate::after {
    left: 4px;
    right: 4px;
    bottom: 4px;
    padding: 2px 4px;
    font-size: .48rem;
}
.board-main .game-card.blocker-candidate .dons {
    display: none;
}
.right-dock {
    display: grid;
    grid-template-rows: 250px minmax(0, 1fr);
    gap: 14px;
    min-height: 720px;
}
.action-dock,
.detail-dock {
    border-radius: 8px;
    border: 3px solid rgba(226,232,240,.38);
    background: rgba(15,23,42,.90);
    box-shadow: none;
    overflow: hidden;
}
.action-dock h3,
.detail-dock h3 {
    margin: 0 0 10px;
    text-align: center;
    color: #f8fafc;
}
.action-dock {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.action-dock .action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}
.action-dock .action-row button {
    padding: 7px 6px;
    font-size: .72rem;
    border-radius: 8px;
}
.action-dock .selection-box {
    margin: 0;
    padding: 8px;
    font-size: .78rem;
    min-height: 38px;
}
.action-dock .combat-summary {
    margin: 0;
    padding: 8px;
    font-size: .76rem;
    max-height: 76px;
    overflow: auto;
}
.action-dock .combat-line {
    display: block;
    padding: 4px 0;
}
.action-dock .combat-line em,
.action-dock .combat-line small {
    display: block;
    text-align: left;
    margin-top: 2px;
}
.action-dock .log {
    margin: 0;
    max-height: 70px;
    min-height: 50px;
    font-size: .68rem;
    padding: 7px;
}
.detail-dock {
    padding: 14px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.detail-dock .selected-card-detail {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 12px;
    border: 0;
    background: rgba(2,6,23,.22);
}
.detail-dock .detail-head {
    grid-template-columns: 1fr;
}
.detail-dock .detail-head img,
.detail-dock .detail-placeholder {
    width: 100%;
    height: 190px;
}
.detail-dock .selected-card-detail p {
    max-height: none;
    font-size: .88rem;
}
.stack-zone::after,
.jungle-card::after,
.climate-zone button::after {
    content: attr(data-count);
    display: block;
    margin-top: 2px;
    color: #fde68a;
    font-size: .75rem;
    line-height: 1.1;
}
.stack-zone[data-count="0 carta(s)"],
.jungle-card[data-count="0 carta(s)"],
.climate-zone button[data-count="0 carta(s)"] {
    opacity: .72;
}
.zone-viewer-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
    max-height: 66vh;
    overflow: auto;
    padding-right: 4px;
}
.zone-viewer-list .game-card {
    min-height: 210px;
}
.zone-viewer-list .card-image {
    height: 82px;
}
.zone-empty-message {
    color: var(--muted);
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    text-align: center;
}
.zone-extra-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-top: 4px;
    color: #cbd5e1;
    font-size: .68rem;
}
.zone-extra-counts span {
    white-space: nowrap;
}
@media (max-width: 1280px) {
    .board-layout {
        grid-template-columns: 1fr;
    }
    .right-dock {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        min-height: 0;
    }
    .detail-dock .detail-head img,
    .detail-dock .detail-placeholder {
        height: 120px;
    }
}
@media (max-width: 860px) {
    main { padding-left: 10px; padding-right: 10px; }
    .board-main {
        min-width: 780px;
    }
    .board-layout {
        overflow-x: auto;
    }
    .right-dock {
        min-width: 780px;
        grid-template-columns: 1fr;
    }
}
.board-main .player-zone {
    padding: 0;
    background: rgba(15,23,42,.50);
    border-radius: 6px;
}
.board-main .player-zone.active-player,
.board-main .player-zone.defender-player {
    box-shadow: inset 0 0 0 2px rgba(245,158,11,.22);
}
.board-main .player-zone.defender-player {
    box-shadow: inset 0 0 0 2px rgba(56,189,248,.28);
}

/* =====================
   v9 - Control visual de fases y acciones
   ===================== */
.action-row button.action-disabled,
.action-row button:disabled {
    opacity: .42;
    filter: grayscale(.35);
}
.selection-box strong {
    display: block;
    color: #fef3c7;
    margin-bottom: 4px;
}
.selection-box small {
    color: #bfdbfe;
    line-height: 1.35;
}
.game-card.action-candidate {
    outline: 2px solid rgba(34, 197, 94, .75);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12), 0 12px 28px rgba(0,0,0,.24);
}
.game-card.action-blocked {
    opacity: .78;
}
.card-action-badge.candidate {
    border-color: rgba(34,197,94,.65);
    color: #bbf7d0;
    background: rgba(34,197,94,.13);
}
.card-action-badge.blocked {
    border-color: rgba(148,163,184,.32);
    color: #cbd5e1;
    background: rgba(148,163,184,.08);
}
.phase-locked-note {
    color: #fde68a;
}

/* v10 - decisión de Táctico */
.tactico-pending-card {
    outline: 3px solid #38bdf8;
    box-shadow: 0 0 0 6px rgba(56, 189, 248, .18), 0 18px 42px rgba(0,0,0,.34);
}
.has-pending-tactico .action-row button:not(:disabled) {
    opacity: .55;
}


/* =====================
   v10.4 - Pantalla dedicada para duelo
   ===================== */
body.duel-playing .topbar,
body.duel-playing .tabs {
    display: none;
}

body.duel-playing main {
    padding: 10px;
}

body.duel-playing #duel.view.active {
    display: block;
}

body.duel-playing .duel-toolbar {
    display: none;
}

body.duel-playing .game-board {
    min-height: calc(100vh - 20px);
}

body.duel-playing .board-layout {
    margin-top: 0;
}

.danger-button {
    background: rgba(127, 29, 29, .92);
    color: #fee2e2;
    border: 1px solid rgba(248, 113, 113, .55);
}

.danger-button:hover {
    background: rgba(185, 28, 28, .96);
}

.danger-button.surrender-button {
    background: linear-gradient(180deg, #7f1d1d, #450a0a);
    border-color: rgba(248, 113, 113, .72);
}

.danger-button.surrender-button:hover:not(:disabled) {
    background: linear-gradient(180deg, #991b1b, #5f1111);
}

.online-spectator-banner {
    margin: 0 0 10px;
    border: 1px solid rgba(125, 211, 252, .38);
    border-radius: 10px;
    padding: 9px 12px;
    background: rgba(8, 47, 73, .72);
    color: #e0f2fe;
    font-weight: 900;
    text-align: center;
}

body.online-spectator-mode .action-dock .action-row button:not(#btnExitDuel) {
    display: none;
}

/* =====================
   Layout exclusivo del modo espectador online.
   El banner ocupa una fila propia dentro de #gameBoard y el tablero queda en
   minmax(0, 1fr) con min-width/min-height 0 para no desbordar ni montar cartas.
   No afecta al duelo local ni al jugador online (sin la clase online-spectator-mode
   el banner no existe y estas reglas no aplican).
   ===================== */
body.online-spectator-mode.duel-playing #gameBoard.game-board {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: clamp(6px, .6vw, 10px);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

body.online-spectator-mode.duel-playing #gameBoard .online-spectator-banner {
    margin: 0;
    min-width: 0;
}

body.online-spectator-mode.duel-playing #gameBoard .board-layout {
    height: 100%;
    min-height: 0;
    min-width: 0;
}

body.online-spectator-mode.duel-playing #gameBoard .board-main,
body.online-spectator-mode.duel-playing #gameBoard .right-dock {
    min-height: 0;
    min-width: 0;
}

/* =====================
   Dorso genérico para cartas ocultas (hidden-mano / hidden-mazo).
   Sin arte, estadísticas, dones, habilidad, preview ni selección.
   ===================== */
.game-card.card-hidden {
    cursor: default;
    background:
        radial-gradient(circle at 50% 32%, rgba(56, 89, 138, .5), transparent 62%),
        linear-gradient(160deg, #16233c 0%, #0b1426 55%, #060b16 100%);
    border-color: rgba(94, 128, 176, .5);
    color: #93a8c8;
}

.game-card.card-hidden .card-back-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    text-align: center;
    pointer-events: none;
    overflow: hidden;
}

.game-card.card-hidden .card-back-frame {
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(125, 160, 210, .35);
    border-radius: 8px;
    background:
        repeating-linear-gradient(45deg, rgba(94, 128, 176, .08) 0 8px, transparent 8px 16px);
}

.game-card.card-hidden .card-back-emblem {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(30px, 3vw, 44px);
    height: clamp(30px, 3vw, 44px);
    border-radius: 999px;
    border: 2px solid rgba(148, 184, 231, .55);
    background: rgba(15, 30, 55, .85);
    color: #c4d7f2;
    font-weight: 950;
    font-size: clamp(.72rem, .8vw, .95rem);
    letter-spacing: .04em;
}

.game-card.card-hidden .card-back-title {
    position: relative;
    font-size: clamp(.5rem, .55vw, .68rem);
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(163, 190, 226, .8);
}

body.duel-playing #btnExitDuel {
    width: 100%;
    margin-top: 8px;
}

body.duel-setup #duel .duel-toolbar {
    border-color: rgba(56,189,248,.42);
}


/* =====================
   v10.5 - Ajuste visual responsivo del tablero
   ===================== */
body.duel-playing {
    min-height: 100vh;
    overflow: hidden;
}

body.duel-playing main {
    height: 100vh;
    padding: clamp(4px, .55vw, 10px);
    overflow: hidden;
}

body.duel-playing #duel.view.active,
body.duel-playing #gameBoard.game-board {
    height: 100%;
    min-height: 0;
}

body.duel-playing .board-layout {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(285px, 18vw, 365px);
    gap: clamp(8px, .85vw, 14px);
    align-items: stretch;
    width: 100%;
}

body.duel-playing .board-main {
    height: 100%;
    min-height: 0;
    padding: clamp(6px, .65vw, 10px);
    display: grid;
    grid-template-rows:
        clamp(70px, 9vh, 100px)
        minmax(122px, .78fr)
        minmax(255px, 1.95fr)
        minmax(122px, .78fr);
    gap: clamp(6px, .65vw, 10px);
    overflow: hidden;
}

body.duel-playing .right-dock {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(235px, 34%) minmax(0, 1fr);
    gap: clamp(8px, .8vw, 14px);
}

body.duel-playing .action-dock,
body.duel-playing .detail-dock {
    min-height: 0;
}

body.duel-playing .action-dock {
    padding: clamp(10px, .8vw, 14px);
}

body.duel-playing .detail-dock {
    padding: clamp(10px, .8vw, 14px);
}

body.duel-playing .board-status-row {
    grid-template-columns: minmax(0, 1fr) clamp(208px, 14vw, 270px);
    gap: clamp(6px, .65vw, 10px);
}

body.duel-playing .match-data {
    padding: clamp(8px, .75vw, 12px);
    overflow: hidden;
}

body.duel-playing .match-players {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.match-resource-line {
    color: #fde68a !important;
    font-weight: 900;
}

body.duel-playing .jungle-area {
    grid-template-columns: minmax(70px, 1.25fr) repeat(3, minmax(42px, .72fr));
    gap: 5px;
}

body.duel-playing .jungle-card {
    min-width: 0;
    overflow: hidden;
}

body.duel-playing .opponent-hand-row,
body.duel-playing .player-hand-row {
    grid-template-columns: minmax(0, 1fr) clamp(156px, 10vw, 210px);
    gap: clamp(7px, .7vw, 11px);
    min-height: 0;
}

body.duel-playing .field-row {
    grid-template-columns: minmax(0, 1fr) clamp(156px, 10vw, 210px);
    gap: clamp(7px, .7vw, 11px);
    min-height: 0;
}

body.duel-playing .side-stacks {
    gap: clamp(6px, .6vw, 9px);
}

body.duel-playing .stack-zone,
body.duel-playing .climate-zone,
body.duel-playing .zone-box,
body.duel-playing .jungle-card,
body.duel-playing .match-data,
body.duel-playing .action-dock,
body.duel-playing .detail-dock {
    border-width: 2px;
}

body.duel-playing .climate-zone > button {
    width: min(92px, 65%);
    height: min(136px, 54%);
    min-height: 104px;
}

body.duel-playing .zone-box > header {
    min-height: 36px;
    height: auto;
    padding: 5px 8px;
}

.zone-header-stack {
    align-items: stretch !important;
    flex-direction: column;
    justify-content: center !important;
    gap: 7px;
    height: auto !important;
    min-height: clamp(104px, 7.5vw, 122px);
    padding-block: 8px !important;
}

.zone-title-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.resource-strip {
    display: flex;
    gap: clamp(4px, .42vw, 7px);
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
}

.resource-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,.32);
    background:
        linear-gradient(180deg, rgba(30,41,59,.74), rgba(15,23,42,.74));
    color: #dbeafe;
    font-size: clamp(.6rem, .58vw, .76rem);
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.resource-chip strong {
    color: #fde68a;
    font-size: 1.12em;
    font-weight: 950;
}

.resource-chip.resource-main {
    border-color: rgba(244,199,106,.52);
    background:
        linear-gradient(180deg, rgba(120,53,15,.34), rgba(15,23,42,.78));
    color: #fff7ed;
}

.resource-chip.resource-demon {
    flex: 0 0 auto;
    border-color: rgba(248, 113, 113, .82);
    background:
        radial-gradient(circle at 18% 0%, rgba(239, 68, 68, .32), transparent 38%),
        linear-gradient(180deg, rgba(127, 29, 29, .72), rgba(30, 8, 18, .88));
    color: #fee2e2;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .10),
        0 0 16px rgba(239, 68, 68, .22);
}

.resource-chip.resource-demon strong {
    color: #fecaca;
}

.resource-chip.active {
    border-color: rgba(245,158,11,.86);
    background:
        radial-gradient(circle at 18% 0%, rgba(245,158,11,.30), transparent 34%),
        linear-gradient(180deg, rgba(120,53,15,.48), rgba(15,23,42,.78));
    color: #fff7ed;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.10),
        0 0 18px rgba(245,158,11,.16);
}

.resource-chip.resource-jungle-block {
    border-color: rgba(248,113,113,.9);
    background: linear-gradient(180deg, rgba(127,29,29,.72), rgba(69,10,10,.82));
    color: #fee2e2;
    box-shadow: 0 0 14px rgba(239,68,68,.24);
}

body.duel-playing .mini-pillars {
    justify-content: flex-end;
}

body.duel-playing .mini-pillars .pilar {
    min-width: clamp(112px, 7.4vw, 138px);
    min-height: clamp(58px, 4.2vw, 72px);
    padding: 8px 10px;
}

@media (max-width: 1200px) {
    body.duel-playing .mini-pillars {
        gap: 5px;
    }

    body.duel-playing .mini-pillars .pilar {
        min-width: clamp(96px, 9.6vw, 116px);
        min-height: 52px;
        padding: 7px 8px;
        column-gap: 7px;
    }

    body.duel-playing .mini-pillars .pillar-icon {
        width: 31px;
        height: 31px;
        font-size: 1.18rem;
    }

    body.duel-playing .mini-pillars .pillar-label {
        font-size: .64rem;
    }

    body.duel-playing .mini-pillars .pillar-value {
        font-size: clamp(1.42rem, 2.1vw, 1.76rem);
    }
}

@media (max-width: 760px) {
    body.duel-playing .resource-strip {
        justify-content: flex-start;
    }

    body.duel-playing .mini-pillars {
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    body.duel-playing .mini-pillars .pilar {
        min-width: 92px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mini-pillars .pilar.critical,
    .mini-pillars .pilar.danger {
        animation: none;
    }
}

body.duel-playing .board-main .hand,
body.duel-playing .board-main .battlefield {
    height: calc(100% - 36px);
    padding: clamp(7px, .65vw, 10px);
    gap: clamp(7px, .65vw, 10px);
    align-items: center;
}

body.duel-playing .hand-zone .hand {
    height: calc(100% - clamp(104px, 7.5vw, 122px));
}

body.duel-playing .board-main .game-card.duel-card,
body.duel-playing .board-main .hand .game-card.duel-card {
    width: clamp(118px, 6.35vw, 148px);
    min-width: clamp(118px, 6.35vw, 148px);
    height: clamp(132px, 15.2vh, 174px);
    min-height: clamp(132px, 15.2vh, 174px);
    padding: clamp(6px, .48vw, 8px);
    border-radius: 12px;
    gap: 4px;
}

body.duel-playing .board-main .card-image,
body.duel-playing .board-main .hand .card-image {
    height: clamp(52px, 6.6vh, 76px);
    border-radius: 8px;
}

body.duel-playing .board-main .cost {
    min-width: clamp(22px, 1.35vw, 28px);
    height: clamp(22px, 1.35vw, 28px);
    font-size: clamp(.7rem, .65vw, .88rem);
}

body.duel-playing .board-main .faction {
    font-size: clamp(.58rem, .58vw, .76rem);
}

body.duel-playing .board-main .card-name {
    font-size: clamp(.68rem, .67vw, .84rem);
    line-height: 1.08;
}

body.duel-playing .board-main .dons {
    max-height: 24px;
}

body.duel-playing .board-main .don {
    font-size: clamp(.52rem, .52vw, .65rem);
    padding: 2px 5px;
}

body.duel-playing .board-main .empty-zone {
    min-width: clamp(140px, 10vw, 190px);
}

body.duel-playing .detail-dock .detail-head img,
body.duel-playing .detail-dock .detail-placeholder {
    height: clamp(150px, 24vh, 260px);
}

body.duel-playing .detail-dock .selected-card-detail p {
    font-size: clamp(.82rem, .78vw, .96rem);
}

body.duel-playing .action-dock h3,
body.duel-playing .detail-dock h3 {
    font-size: clamp(1rem, 1vw, 1.22rem);
}

body.duel-playing .action-dock .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

body.duel-playing .action-dock .action-row button {
    min-height: 32px;
    font-size: clamp(.68rem, .62vw, .78rem);
}

body.duel-playing .action-dock .selection-box,
body.duel-playing .action-dock .combat-summary {
    font-size: clamp(.7rem, .65vw, .8rem);
}

body.duel-playing .action-dock .log {
    flex: 1;
    min-height: 42px;
    max-height: none;
}

@media (min-width: 1700px) {
    body.duel-playing .board-layout {
        grid-template-columns: minmax(0, 1fr) 360px;
    }
    body.duel-playing .board-main .game-card.duel-card,
    body.duel-playing .board-main .hand .game-card.duel-card {
        width: 145px;
        min-width: 145px;
    }
}

@media (max-width: 1200px) {
    body.duel-playing {
        overflow: auto;
    }
    body.duel-playing main {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    body.duel-playing .board-layout {
        height: auto;
        grid-template-columns: 1fr;
    }
    body.duel-playing .right-dock {
        height: auto;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
    body.duel-playing .board-main {
        min-height: 780px;
    }
}


/* =====================
   v10.6 - Ajuste fino de tablero, cartas, jungla y panel de combate
   ===================== */
body.duel-playing .board-layout {
    grid-template-columns: minmax(0, 1fr) clamp(315px, 19.5vw, 390px);
    gap: clamp(8px, .7vw, 12px);
}

body.duel-playing .board-main {
    grid-template-rows:
        clamp(78px, 8.5vh, 100px)
        minmax(145px, .92fr)
        minmax(280px, 1.65fr)
        minmax(145px, .92fr);
    gap: clamp(6px, .55vw, 9px);
}

body.duel-playing .board-status-row {
    grid-template-columns: minmax(0, 1fr) clamp(250px, 15vw, 310px);
}

body.duel-playing .jungle-area {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 6px;
}

body.duel-playing .jungle-card,
body.duel-playing .jungle-card.small-zone {
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 0;
    padding: 5px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 3px;
    font-size: clamp(.68rem, .64vw, .84rem);
    line-height: 1.05;
    overflow: hidden;
    word-break: keep-all;
}

body.duel-playing .opponent-hand-row,
body.duel-playing .player-hand-row,
body.duel-playing .field-row {
    grid-template-columns: minmax(0, 1fr) clamp(158px, 9.2vw, 196px);
}

body.duel-playing .zone-box {
    display: flex;
    flex-direction: column;
}

body.duel-playing .board-main .hand,
body.duel-playing .board-main .battlefield {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    align-items: stretch;
    padding: clamp(7px, .58vw, 10px);
    gap: clamp(8px, .62vw, 11px);
}

body.duel-playing .board-main .game-card.duel-card,
body.duel-playing .board-main .hand .game-card.duel-card {
    width: clamp(132px, 7.1vw, 164px);
    min-width: clamp(132px, 7.1vw, 164px);
    height: auto;
    min-height: 0;
    max-height: 100%;
    padding: clamp(6px, .42vw, 8px);
    border-radius: 12px;
    gap: 4px;
}

body.duel-playing .board-main .field-zone .game-card.duel-card {
    width: clamp(138px, 7.35vw, 172px);
    min-width: clamp(138px, 7.35vw, 172px);
}

body.duel-playing .board-main .game-card.duel-card .ability,
body.duel-playing .board-main .game-card.duel-card .stats,
body.duel-playing .board-main .game-card.duel-card .card-type {
    display: none;
}

body.duel-playing .board-main .card-image,
body.duel-playing .board-main .hand .card-image {
    height: clamp(54px, 6.3vh, 78px);
    min-height: clamp(54px, 6.3vh, 78px);
    flex: 0 0 auto;
}

body.duel-playing .board-main .card-top {
    flex: 0 0 auto;
}

body.duel-playing .board-main .card-name {
    font-size: clamp(.72rem, .68vw, .88rem);
    line-height: 1.08;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(2.16em);
}

body.duel-playing .board-main .dons {
    margin-top: auto;
    max-height: 28px;
    overflow: hidden;
}

body.duel-playing .board-main .don {
    font-size: clamp(.54rem, .52vw, .68rem);
    padding: 2px 5px;
}

body.duel-playing .side-stacks {
    grid-template-rows: repeat(4, minmax(0, 1fr));
}

body.duel-playing .stack-zone {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.1;
}

body.duel-playing .climate-zone > button {
    width: min(112px, 74%);
    height: min(156px, 60%);
    min-height: 112px;
}

body.duel-playing .right-dock {
    grid-template-rows: minmax(355px, 45%) minmax(0, 1fr);
    gap: clamp(8px, .7vw, 12px);
}

body.duel-playing .action-dock {
    display: grid;
    grid-template-rows: auto auto auto minmax(86px, 1fr) minmax(78px, .8fr);
    gap: 8px;
    overflow: hidden;
}

body.duel-playing .action-dock .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body.duel-playing .action-dock .action-row button {
    min-height: 34px;
    padding: 7px 6px;
}

body.duel-playing .action-dock .selection-box {
    min-height: 54px;
    max-height: 82px;
    overflow: auto;
}

body.duel-playing .action-dock .combat-summary {
    max-height: none;
    min-height: 86px;
    overflow: auto;
}

body.duel-playing .action-dock .log {
    min-height: 78px;
    max-height: none;
    overflow: auto;
}

body.duel-playing .detail-dock {
    min-height: 0;
}

body.duel-playing .detail-dock .selected-card-detail {
    overflow: auto;
}

body.duel-playing .detail-dock .detail-head img,
body.duel-playing .detail-dock .detail-placeholder {
    height: clamp(140px, 22vh, 235px);
}

@media (min-width: 1700px) {
    body.duel-playing .board-layout {
        grid-template-columns: minmax(0, 1fr) 390px;
    }
    body.duel-playing .board-main .game-card.duel-card,
    body.duel-playing .board-main .hand .game-card.duel-card {
        width: 160px;
        min-width: 160px;
    }
    body.duel-playing .board-main .field-zone .game-card.duel-card {
        width: 168px;
        min-width: 168px;
    }
}

@media (max-width: 1450px) {
    body.duel-playing .board-layout {
        grid-template-columns: minmax(0, 1fr) clamp(300px, 22vw, 350px);
    }
    body.duel-playing .board-main .game-card.duel-card,
    body.duel-playing .board-main .hand .game-card.duel-card {
        width: clamp(122px, 8.2vw, 148px);
        min-width: clamp(122px, 8.2vw, 148px);
    }
}

@media (max-width: 1200px) {
    body.duel-playing .right-dock {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
    body.duel-playing .action-dock {
        min-height: 355px;
    }
}


/* =====================
   v10.7 - Mano agrupada y arrastrar carta al campo
   ===================== */
body.duel-playing .board-main .hand {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(108px, 6.1vw, 140px), 1fr));
    grid-auto-rows: clamp(112px, 13vh, 150px);
    align-content: start;
    align-items: stretch;
    justify-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

body.duel-playing .board-main .hand .game-card.duel-card {
    width: 100%;
    min-width: 0;
    height: 100%;
    max-height: none;
}

body.duel-playing .board-main .hand .card-image {
    height: clamp(46px, 5.4vh, 68px);
    min-height: clamp(46px, 5.4vh, 68px);
}

body.duel-playing .board-main .hand .card-name {
    font-size: clamp(.66rem, .62vw, .8rem);
}

body.duel-playing .game-card.draggable-card {
    cursor: grab;
}

body.duel-playing .game-card.draggable-card:active {
    cursor: grabbing;
}

body.duel-playing .game-card.dragging {
    opacity: .55;
    transform: scale(.97);
}

body.duel-playing .battlefield.play-drop-target {
    border-color: rgba(56, 189, 248, .48);
}

body.duel-playing.dragging-card .battlefield.play-drop-target {
    outline: 2px dashed rgba(56, 189, 248, .72);
    outline-offset: -6px;
    background:
        linear-gradient(90deg, rgba(14, 165, 233, .13), rgba(15, 23, 42, .62)),
        radial-gradient(circle at center, rgba(56, 189, 248, .13), transparent 20rem);
}

body.duel-playing .battlefield.play-drop-active {
    outline: 3px solid rgba(34, 197, 94, .9) !important;
    outline-offset: -7px;
    box-shadow: inset 0 0 0 999px rgba(34, 197, 94, .08);
}

@media (min-width: 1700px) {
    body.duel-playing .board-main .hand {
        grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
        grid-auto-rows: clamp(120px, 13vh, 154px);
    }
}

@media (max-width: 1450px) {
    body.duel-playing .board-main .hand {
        grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
        grid-auto-rows: clamp(106px, 13vh, 140px);
    }
}


/* =====================
   v10.8 - Arrastrar carta desde mano al campo
   ===================== */
.game-card.draggable-card {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.game-card.draggable-card:active {
    cursor: grabbing;
}

.game-card.dragging {
    opacity: .55;
    transform: scale(.98);
}

.drag-ghost {
    position: fixed;
    z-index: 9999;
    width: 170px !important;
    min-width: 170px !important;
    height: 238px !important;
    min-height: 238px !important;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-2deg) scale(1.03);
    opacity: .94;
    box-shadow: 0 22px 52px rgba(0,0,0,.55), 0 0 0 3px rgba(245,158,11,.45);
}

.play-drop-target {
    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

.dragging-card .play-drop-target,
.play-drop-target.play-drop-hover,
.play-drop-target.play-drop-active {
    border-color: rgba(34,197,94,.95) !important;
    box-shadow: inset 0 0 0 2px rgba(34,197,94,.55), 0 0 28px rgba(34,197,94,.22);
    background: linear-gradient(90deg, rgba(22,101,52,.32), rgba(15,23,42,.72)) !important;
}

.dragging-card .play-drop-target::after {
    content: "Suelta aquí para jugar la carta";
    position: absolute;
    inset: auto 18px 14px auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(22,101,52,.96);
    color: #dcfce7;
    font-weight: 900;
    font-size: .82rem;
    border: 1px solid rgba(187,247,208,.45);
    pointer-events: none;
}

.battlefield.play-drop-target {
    position: relative;
}

/* =====================
   v10.9 - Drop más amplio sobre zona de campo
   ===================== */
.field-zone.play-drop-target-zone {
    position: relative;
    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

body.duel-playing.dragging-card .field-zone.play-drop-target-zone,
.field-zone.play-drop-active-zone {
    border-color: rgba(34,197,94,.95) !important;
    box-shadow: inset 0 0 0 2px rgba(34,197,94,.42), 0 0 24px rgba(34,197,94,.20);
    background: linear-gradient(180deg, rgba(22,101,52,.18), rgba(15,23,42,.72)) !important;
}

body.duel-playing.dragging-card .field-zone.play-drop-target-zone::after,
.field-zone.play-drop-active-zone::after {
    content: "Suelta aquí para jugar la carta";
    position: absolute;
    right: 14px;
    top: 12px;
    z-index: 3;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(22,101,52,.96);
    color: #dcfce7;
    font-weight: 900;
    font-size: .74rem;
    border: 1px solid rgba(187,247,208,.45);
    pointer-events: none;
}

.drag-ghost {
    pointer-events: none !important;
}

/* =====================
   v10.10 - Drag robusto sin arrastre nativo del navegador
   ===================== */
.game-card.draggable-card,
.game-card.draggable-card * {
    -webkit-user-drag: none;
    user-drag: none;
}

.game-card.draggable-card img {
    pointer-events: none;
}

body.duel-playing.dragging-card {
    cursor: grabbing;
}

body.duel-playing.dragging-card .battlefield,
body.duel-playing.dragging-card .field-zone {
    touch-action: none;
}

/* =====================
   v10.11 - Mano solapada en una sola fila
   ===================== */
body.duel-playing .board-main .hand {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    align-items: stretch !important;
    align-content: stretch !important;
    justify-content: flex-start !important;
    grid-template-columns: none !important;
    grid-auto-rows: unset !important;
    gap: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: clamp(7px, .58vw, 10px) clamp(74px, 5vw, 110px) clamp(7px, .58vw, 10px) clamp(7px, .58vw, 10px) !important;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

body.duel-playing .board-main .hand .game-card.duel-card {
    flex: 0 0 clamp(130px, 7vw, 164px) !important;
    width: clamp(130px, 7vw, 164px) !important;
    min-width: clamp(130px, 7vw, 164px) !important;
    height: 100% !important;
    max-height: none !important;
    margin-left: clamp(-84px, -4.3vw, -54px);
    position: relative;
    transition: transform .12s ease, margin .12s ease, box-shadow .12s ease, z-index .12s ease;
    scroll-snap-align: start;
}

body.duel-playing .board-main .hand .game-card.duel-card:first-child {
    margin-left: 0;
}

body.duel-playing .board-main .hand .game-card.duel-card:hover,
body.duel-playing .board-main .hand .game-card.duel-card.selected,
body.duel-playing .board-main .hand .game-card.duel-card.dragging {
    z-index: 50 !important;
    transform: translateY(-6px) scale(1.04);
}

body.duel-playing .board-main .hand .game-card.duel-card:hover + .game-card.duel-card,
body.duel-playing .board-main .hand .game-card.duel-card.selected + .game-card.duel-card {
    margin-left: clamp(-62px, -3vw, -38px);
}

body.duel-playing .board-main .hand .card-image {
    height: clamp(50px, 5.9vh, 72px) !important;
    min-height: clamp(50px, 5.9vh, 72px) !important;
}

body.duel-playing .board-main .hand .empty-zone {
    min-width: clamp(160px, 12vw, 220px);
    margin-left: 0;
}

@media (min-width: 1700px) {
    body.duel-playing .board-main .hand .game-card.duel-card {
        flex-basis: 162px !important;
        width: 162px !important;
        min-width: 162px !important;
        margin-left: -74px;
    }
    body.duel-playing .board-main .hand .game-card.duel-card:first-child {
        margin-left: 0;
    }
}

@media (max-width: 1450px) {
    body.duel-playing .board-main .hand .game-card.duel-card {
        flex-basis: clamp(120px, 8vw, 146px) !important;
        width: clamp(120px, 8vw, 146px) !important;
        min-width: clamp(120px, 8vw, 146px) !important;
        margin-left: clamp(-82px, -5vw, -52px);
    }
    body.duel-playing .board-main .hand .game-card.duel-card:first-child {
        margin-left: 0;
    }
}

@media (max-width: 1100px) {
    body.duel-playing .board-main .hand .game-card.duel-card {
        margin-left: -72px;
    }
    body.duel-playing .board-main .hand .game-card.duel-card:first-child {
        margin-left: 0;
    }
}


/* =====================
   v10.12 - Solapado condicional de mano
   ===================== */
body.duel-playing .board-main .hand {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    align-items: stretch !important;
    align-content: stretch !important;
    justify-content: flex-start !important;
    grid-template-columns: none !important;
    grid-auto-rows: unset !important;
    gap: clamp(8px, .55vw, 12px) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

body.duel-playing .board-main .hand .game-card.duel-card {
    flex: 0 0 clamp(130px, 7vw, 164px) !important;
    width: clamp(130px, 7vw, 164px) !important;
    min-width: clamp(130px, 7vw, 164px) !important;
    margin-left: 0 !important;
    position: relative;
    transition: transform .12s ease, margin .12s ease, box-shadow .12s ease, z-index .12s ease;
    scroll-snap-align: start;
}

body.duel-playing .board-main .hand.hand-overlap {
    gap: 0 !important;
    padding-right: clamp(76px, 5vw, 116px) !important;
}

body.duel-playing .board-main .hand.hand-overlap .game-card.duel-card:not(:first-child) {
    margin-left: var(--hand-overlap, -64px) !important;
}

body.duel-playing .board-main .hand.hand-fit .game-card.duel-card {
    margin-left: 0 !important;
}

body.duel-playing .board-main .hand.hand-overlap .game-card.duel-card:hover,
body.duel-playing .board-main .hand.hand-overlap .game-card.duel-card.selected,
body.duel-playing .board-main .hand.hand-overlap .game-card.duel-card.dragging {
    z-index: 60 !important;
    transform: translateY(-7px) scale(1.045);
}

body.duel-playing .board-main .hand.hand-overlap .game-card.duel-card:hover + .game-card.duel-card,
body.duel-playing .board-main .hand.hand-overlap .game-card.duel-card.selected + .game-card.duel-card {
    margin-left: calc(var(--hand-overlap, -64px) * .70) !important;
}

body.duel-playing .board-main .hand .empty-zone {
    margin-left: 0 !important;
}

/* =====================

/* v14.11 - Identidad online con avatar y avisos visuales de turno/habilidad */
.match-player-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.match-player-avatar,
.online-notice-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(251,191,36,.55);
    background: rgba(15,23,42,.72);
    box-shadow: 0 0 18px rgba(251,191,36,.16);
}

.match-player-avatar img,
.match-player-avatar .avatar-placeholder,
.online-notice-avatar img,
.online-notice-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.match-player-text {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.match-player-text strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fef3c7;
}

.player-role-tag {
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(56,189,248,.38);
    background: rgba(56,189,248,.12);
    color: #bae6fd;
    font-size: .66rem;
    font-style: normal;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.online-notice-overlay {
    z-index: 140;
}

.online-notice-modal {
    width: min(520px, 94vw);
    border-color: rgba(251,191,36,.42);
    box-shadow: 0 30px 90px rgba(0,0,0,.62), 0 0 45px rgba(251,191,36,.10);
}

.online-notice-overlay.turn-started .online-notice-modal {
    border-color: rgba(34,197,94,.48);
    box-shadow: 0 30px 90px rgba(0,0,0,.62), 0 0 55px rgba(34,197,94,.14);
}

.online-notice-head {
    align-items: center;
    justify-content: flex-start;
}

.online-notice-head h3 {
    margin: 0 0 4px;
    color: #fef3c7;
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
}

.online-notice-head p {
    margin: 0;
    color: #e2e8f0;
    font-weight: 800;
    line-height: 1.45;
}

.online-notice-detail {
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid rgba(148,163,184,.22);
    border-radius: 14px;
    color: #cbd5e1;
    background: rgba(15,23,42,.52);
    font-weight: 700;
}

@media (max-width: 760px) {
    .match-players {
        grid-template-columns: 1fr;
    }

    .match-player-avatar {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }
}

/* Mejora visual de avisos: habilidades enemigas, Feroz y Chiara */
.online-notice-modal.with-card-detail,
.feroz-priority-modal.with-card-detail,
.chiara-support-blocked-modal.with-card-detail {
    max-width: min(900px, calc(100vw - 28px));
}

.online-notice-modal.with-card-detail .game-dialog-card-list,
.feroz-priority-modal.with-card-detail .game-dialog-card-list,
.chiara-support-blocked-modal.with-card-detail .game-dialog-card-list {
    margin-top: 12px;
}

.online-notice-modal.with-card-detail .online-notice-detail {
    margin-top: 12px;
}

/* Temporizadores de turno / defensa
   v14.11.1 - HUD flotante para que no quede recortado por el panel compacto */
.game-timer-hud {
    --timer-hud-y: 0px;
    position: fixed;
    top: clamp(68px, 7.5vh, 92px);
    left: 50%;
    transform: translate(-50%, var(--timer-hud-y));
    z-index: 135;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    width: max-content;
    max-width: min(560px, calc(100vw - 24px));
    margin: 0;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(5, 10, 18, 0.95), rgba(20, 31, 48, 0.92));
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.38), inset 0 0 18px rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    pointer-events: none;
}
.game-timer-hud.hidden { display: none !important; }
.game-timer-hud .timer-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(245, 235, 210, 0.82);
    white-space: nowrap;
}
.game-timer-hud .timer-value {
    min-width: 74px;
    text-align: center;
    font-size: 1.42rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: #ffe6a3;
    text-shadow: 0 0 14px rgba(255, 195, 84, 0.44);
}
.game-timer-hud small {
    max-width: 250px;
    color: rgba(245, 235, 210, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.game-timer-hud.timer-block {
    border-color: rgba(124, 202, 255, 0.46);
    background: linear-gradient(135deg, rgba(10, 30, 45, 0.96), rgba(7, 47, 75, 0.92));
}
.game-timer-hud.timer-paused {
    border-style: dashed;
    opacity: 0.96;
}
.game-timer-hud.timer-urgent:not(.timer-paused) {
    border-color: rgba(255, 95, 88, 0.88);
    box-shadow: 0 0 0 1px rgba(255, 95, 88, 0.24), 0 0 28px rgba(255, 68, 68, 0.32), 0 14px 42px rgba(0, 0, 0, 0.42);
    animation: timerUrgentPulse 1s ease-in-out infinite;
}
.game-timer-hud.timer-disconnect {
    border-color: rgba(255, 185, 90, 0.58);
    background: linear-gradient(135deg, rgba(48, 31, 8, 0.96), rgba(82, 47, 12, 0.92));
}
@keyframes timerUrgentPulse {
    0%, 100% { transform: translate(-50%, calc(var(--timer-hud-y) + 0px)); }
    50% { transform: translate(-50%, calc(var(--timer-hud-y) - 1px)); }
}
@media (max-width: 760px) {
    .game-timer-hud {
        top: 58px;
        padding: 8px 10px;
        gap: 7px;
        max-width: calc(100vw - 16px);
    }
    .game-timer-hud .timer-label { font-size: 0.68rem; }
    .game-timer-hud .timer-value { min-width: 62px; font-size: 1.2rem; }
    .game-timer-hud small { display: none; }
}
.online-disconnect-modal {
    max-width: 460px;
    text-align: center;
}
.disconnect-countdown-box {
    display: grid;
    gap: 6px;
    margin: 16px auto;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 199, 99, 0.35);
    background: rgba(255, 180, 70, 0.08);
}
.disconnect-countdown-box span {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 239, 205, 0.75);
}
.disconnect-countdown-box strong {
    font-size: 2.1rem;
    font-variant-numeric: tabular-nums;
    color: #ffe6a3;
    text-shadow: 0 0 18px rgba(255, 195, 84, 0.45);
}

/* Panel corto de feedback de habilidades */
.ability-feedback-panel {
    border: 1px solid rgba(245, 158, 11, .28);
    border-radius: 16px;
    padding: 10px;
    background: linear-gradient(180deg, rgba(120, 53, 15, .30), rgba(15, 23, 42, .70));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.ability-feedback-panel > strong {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: #fed7aa;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.ability-feedback-panel > strong::before {
    content: "✦";
    color: #fbbf24;
}

.ability-feedback-list {
    display: grid;
    gap: 7px;
}

.ability-feedback-empty {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.3;
}

.ability-feedback-item {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 12px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, .64);
    color: var(--text);
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.ability-feedback-item:hover {
    transform: translateY(-1px);
    border-color: rgba(245, 158, 11, .45);
    background: rgba(30, 41, 59, .72);
}

.ability-feedback-item b {
    display: block;
    color: #fde68a;
    font-size: .78rem;
    margin-bottom: 2px;
}

.ability-feedback-item span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #cbd5e1;
    font-size: .78rem;
    line-height: 1.28;
}

/* v14.13 - Rediseño visual del layout del tablero de duelo */
body.duel-playing .board-main {
    grid-template-rows:
        clamp(170px, 19vh, 215px)
        minmax(150px, .75fr)
        minmax(260px, 1.55fr)
        minmax(150px, .75fr) !important;
    gap: clamp(8px, .72vw, 12px);
    overflow: visible;
}

body.duel-playing .duel-top-shell {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: clamp(8px, .75vw, 12px);
    min-height: clamp(170px, 19vh, 215px);
    overflow: hidden;
}

body.duel-playing .duel-status-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
    align-items: center;
    gap: clamp(10px, 1vw, 16px);
    min-height: 74px;
    overflow: visible;
}

body.duel-playing .match-data {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(8px, .8vw, 14px);
    padding: clamp(8px, .72vw, 12px) clamp(10px, 1vw, 16px);
    overflow: visible;
}

body.duel-playing .match-data > strong {
    min-width: max-content;
    font-size: clamp(.72rem, .64vw, .86rem);
}

body.duel-playing .match-data > span {
    min-width: 0;
    white-space: normal;
    line-height: 1.15;
}

body.duel-playing .match-data #phaseText {
    color: #fde68a;
    font-size: clamp(.92rem, .9vw, 1.15rem);
    font-weight: 950;
}

body.duel-playing .match-data #turnText {
    color: #dbeafe;
    font-size: clamp(.76rem, .72vw, .92rem);
}

body.duel-playing .game-timer-hud {
    position: fixed;
    --timer-hud-y: -50%;
    top: 50%;
    left: 50%;
    z-index: 135;
}

body.duel-playing .game-timer-hud.timer-decision {
    --timer-hud-y: 0px;
    top: clamp(16px, 3.5vh, 34px);
    z-index: 145;
}

body.duel-playing .match-players {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(6px, .6vw, 10px);
    margin-top: 0;
}

body.duel-playing .compact-info {
    min-height: 0;
    overflow: hidden;
}

body.duel-playing .compact-info .match-resource-line,
body.duel-playing .compact-info .zone-extra-counts {
    display: none;
}

body.duel-playing .global-domain-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
    grid-template-rows: auto minmax(78px, 1fr);
    grid-template-areas:
        "title title"
        "jungle climate";
    gap: clamp(8px, .75vw, 12px);
    align-items: stretch;
    min-height: 96px;
    padding: 6px 12px 8px;
    border: 1px solid rgba(244, 199, 106, .24);
    border-radius: 18px;
    background:
        linear-gradient(90deg, rgba(88, 28, 135, .18), rgba(8, 47, 73, .18), rgba(22, 101, 52, .16)),
        rgba(3, 8, 20, .38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 34px rgba(0, 0, 0, .26);
    overflow: visible;
}

body.duel-playing .global-domain-title {
    grid-area: title;
    justify-self: center;
    padding: 0 8px;
    color: #fde68a;
    font-size: clamp(.72rem, .66vw, .9rem);
    font-weight: 950;
    letter-spacing: .12em;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 0 16px rgba(244, 199, 106, .30);
}

body.duel-playing .jungle-area {
    grid-area: jungle;
    display: grid;
    grid-template-columns: minmax(130px, 1.35fr) repeat(3, minmax(105px, 1fr)) !important;
    gap: clamp(8px, .8vw, 12px) !important;
    min-height: 78px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

body.duel-playing .global-climate-slot {
    grid-area: climate;
    min-width: 0;
    min-height: 78px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

body.duel-playing .jungle-card,
body.duel-playing .jungle-card.small-zone,
body.duel-playing .climate-zone > button {
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
    min-height: 0 !important;
    padding: clamp(6px, .58vw, 9px) !important;
    border-radius: 14px;
    display: grid !important;
    align-items: stretch;
    justify-items: stretch;
    text-align: center;
    overflow: hidden;
}

body.duel-playing #globalClimateZone {
    min-height: 78px !important;
}

body.duel-playing #jungleBossZone {
    border-color: rgba(251, 191, 36, .52);
    background:
        radial-gradient(circle at 50% 0%, rgba(251, 191, 36, .20), transparent 62%),
        linear-gradient(180deg, rgba(54, 34, 9, .76), rgba(8, 16, 34, .82));
}

body.duel-playing #globalClimateZone {
    border-color: rgba(125, 211, 252, .48);
    background:
        radial-gradient(circle at 50% 0%, rgba(125, 211, 252, .22), transparent 62%),
        linear-gradient(180deg, rgba(8, 47, 73, .62), rgba(8, 16, 34, .82));
}

body.duel-playing .global-card-mini,
body.duel-playing .global-card-placeholder {
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    border-radius: 10px;
}

body.duel-playing .global-card-mini-art {
    min-height: 0;
}

body.duel-playing .global-card-mini-art img {
    min-height: 0;
}

body.duel-playing .global-card-mini-body {
    padding: 3px 4px;
}

body.duel-playing .global-card-duration-counter {
    top: 4px;
    right: 4px;
    padding: 3px 5px;
    font-size: clamp(.5rem, .58vw, .66rem);
}

body.duel-playing .global-card-mini-body strong,
body.duel-playing .global-card-placeholder strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: clamp(.72rem, .70vw, .92rem);
    line-height: 1.08;
}

body.duel-playing .global-card-mini-body small,
body.duel-playing .global-card-placeholder small {
    font-size: clamp(.62rem, .60vw, .76rem);
}

body.duel-playing .field-row {
    grid-template-columns: minmax(0, 1fr) !important;
}

body.duel-playing .field-column {
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

body.duel-playing .opponent-hand-row,
body.duel-playing .player-hand-row {
    grid-template-columns: minmax(0, 1fr) clamp(126px, 8.2vw, 168px) !important;
}

body.duel-playing .side-stacks {
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: clamp(5px, .5vw, 8px);
}

body.duel-playing .stack-zone {
    position: relative;
    min-height: 0;
    padding: 8px 8px 8px 34px;
    justify-content: flex-start;
    text-align: left;
    font-size: clamp(.66rem, .62vw, .82rem);
    line-height: 1.1;
}

body.duel-playing .stack-zone::before {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #fde68a;
    font-size: 1rem;
    text-shadow: 0 0 12px rgba(244, 199, 106, .25);
}

body.duel-playing .stack-zone[id$="CemeteryZone"]::before {
    content: "\2726";
}

body.duel-playing .stack-zone[id$="DeckZone"]::before {
    content: "\25A4";
}

body.duel-playing .stack-zone[id$="LimboZone"]::before {
    content: "\25CC";
}

body.duel-playing .stack-zone[id$="AbismoZone"]::before {
    content: "\25C6";
}

body.duel-playing .side-stacks .stack-zone.zone-action-available {
    border-color: rgba(248, 113, 113, .98) !important;
    background:
        radial-gradient(circle at 50% 50%, rgba(239, 68, 68, .24), transparent 72%),
        linear-gradient(135deg, rgba(127, 29, 29, .36), rgba(30, 41, 59, .78)) !important;
    box-shadow:
        0 0 0 2px rgba(127, 29, 29, .46),
        0 0 18px rgba(248, 113, 113, .72),
        0 0 38px rgba(220, 38, 38, .34),
        inset 0 0 18px rgba(239, 68, 68, .18) !important;
    color: #fff1f2 !important;
    animation: zone-action-available-pulse 1.55s ease-in-out infinite;
}

body.duel-playing .side-stacks .stack-zone.zone-action-available::before {
    color: #fecaca;
    text-shadow:
        0 0 8px rgba(254, 202, 202, .92),
        0 0 18px rgba(248, 113, 113, .9);
}

@keyframes zone-action-available-pulse {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.18) saturate(1.18);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.duel-playing .side-stacks .stack-zone.zone-action-available {
        animation: none;
    }
}

body.duel-playing .stack-zone::after {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 28px;
    margin: 0;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .70);
    color: #fef3c7;
    text-align: center;
    font-size: .68rem;
}

body.duel-playing .zone-header-stack {
    min-height: clamp(72px, 5.4vw, 88px);
    gap: 4px;
    padding-block: 7px !important;
}

body.duel-playing .mini-pillars .pilar {
    min-width: clamp(96px, 6.5vw, 124px);
    min-height: clamp(40px, 2.8vw, 52px);
    padding: 7px 9px;
}

body.duel-playing .mini-pillars .pillar-icon {
    width: clamp(26px, 1.75vw, 32px);
    height: clamp(26px, 1.75vw, 32px);
    font-size: clamp(1rem, 1.1vw, 1.32rem);
}

body.duel-playing .mini-pillars .pillar-value {
    font-size: clamp(1.24rem, 1.18vw, 1.58rem);
}

body.duel-playing .hand-zone .hand {
    height: auto !important;
    min-height: 0;
}

@media (max-width: 1450px) {
    body.duel-playing .board-main {
        grid-template-rows:
            clamp(170px, 19vh, 215px)
            minmax(140px, .68fr)
            minmax(230px, 1.48fr)
            minmax(140px, .68fr) !important;
    }

    body.duel-playing .duel-status-bar {
        grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
        gap: 10px;
    }

    body.duel-playing .global-domain-row {
        grid-template-columns: minmax(560px, 1fr) minmax(150px, 200px);
        grid-template-areas:
            "title title"
            "jungle climate";
    }

    body.duel-playing .jungle-area {
        grid-template-columns: minmax(120px, 1.35fr) repeat(3, minmax(90px, 1fr)) !important;
    }

    body.duel-playing .global-climate-slot {
        width: auto;
        justify-self: stretch;
    }

    body.duel-playing .opponent-hand-row,
    body.duel-playing .player-hand-row {
        grid-template-columns: minmax(0, 1fr) clamp(112px, 8vw, 148px) !important;
    }
}

@media (max-width: 1100px) {
    body.duel-playing .duel-status-bar {
        grid-template-columns: 1fr 1fr;
    }

    body.duel-playing .match-data,
    body.duel-playing .game-timer-hud {
        justify-self: start;
    }

    body.duel-playing .match-players {
        grid-column: 1 / -1;
    }

    body.duel-playing .jungle-area {
        grid-template-columns: minmax(130px, 1.35fr) repeat(3, minmax(95px, 1fr)) !important;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    body.duel-playing .global-domain-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "jungle"
            "climate";
    }

    body.duel-playing .global-climate-slot {
        width: min(260px, 100%);
        justify-self: center;
    }
}

/* =====================
   Ajuste visual seguro Tablero 2.0
   A: separación rival/jugador, B: brillos de zona,
   C: headers con personalidad, D: Jefe vs Jungla, F: paneles derecha
   ===================== */

/* A — Separación visual campo rival vs campo jugador */
#duel .opponent-field-zone {
    border-top: 2px solid rgba(56, 189, 248, .40);
}
#duel .player-field-zone {
    border-bottom: 2px solid rgba(245, 158, 11, .40);
}


/* B — Brillos de zonas sin cambiar dimensiones */
#duel .hand-zone {
    box-shadow: inset 0 0 24px rgba(239, 68, 68, .06);
}
#duel .field-zone {
    box-shadow: inset 0 0 24px rgba(34, 197, 94, .06);
}

/* C — Headers de zona con más personalidad */
#duel .zone-box > header {
    letter-spacing: .04em;
    text-transform: uppercase;
}
#duel .hand-zone > header {
    border-bottom-color: rgba(239, 68, 68, .22);
    color: #fecaca;
    background: linear-gradient(90deg, rgba(127, 29, 29, .22), rgba(15, 23, 42, .38));
}
#duel .field-zone > header {
    border-bottom-color: rgba(34, 197, 94, .22);
    color: #bbf7d0;
    background: linear-gradient(90deg, rgba(20, 83, 45, .22), rgba(15, 23, 42, .38));
}

/* D — Jerarquía visual Jefe de Jungla vs slots normales */
#duel #jungleBossZone {
    border-width: 2px;
    border-color: rgba(251, 191, 36, .72);
    font-weight: 900;
    letter-spacing: .02em;
}

/* Cartas jugadas con la misma plantilla visual que las cartas completas. */
body.duel-playing .board-main .field-zone .game-card.duel-card.has-field-template-card {
    width: clamp(158px, 9.2vw, 218px);
    min-width: clamp(158px, 9.2vw, 218px);
    height: auto;
    min-height: 0;
    max-height: none;
    align-self: flex-start;
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

body.duel-playing .board-main .field-zone .game-card.duel-card.has-field-template-card:hover {
    transform: translateY(-2px);
}

body.duel-playing .board-main .field-zone .game-card.duel-card.has-field-template-card.selected {
    outline: 2px solid rgba(245, 158, 11, .95);
    outline-offset: 3px;
    border-radius: 18px;
}

body.duel-playing .board-main .field-zone .game-card.duel-card.has-field-template-card .cg-template-runtime {
    width: 100%;
    max-width: none;
    margin: 0;
}

body.duel-playing .board-main .field-zone .game-card.duel-card.has-field-template-card.ability-doubleclick-candidate .cg-template-stage,
body.duel-playing .board-main .field-zone .game-card.duel-card.has-field-template-card.attack-candidate .cg-template-stage,
body.duel-playing .board-main .field-zone .game-card.duel-card.has-field-template-card.blocker-candidate .cg-template-stage,
body.duel-playing .board-main .field-zone .game-card.duel-card.has-field-template-card.supporter-candidate .cg-template-stage {
    outline: 2px solid rgba(250, 204, 21, .86);
    outline-offset: -3px;
}

body.duel-playing .board-main .field-zone .game-card.duel-card.attack-candidate {
    animation: attackCandidateHop 1.45s ease-in-out infinite;
}

body.duel-playing .board-main .field-zone .game-card.duel-card.has-field-template-card.attack-candidate .cg-template-stage {
    animation: attackCandidateTemplateGlow 1.45s ease-in-out infinite;
}

body.duel-playing .board-main .field-zone .game-card.duel-card.attack-candidate:hover,
body.duel-playing .board-main .field-zone .game-card.duel-card.attack-candidate.selected,
body.duel-playing .board-main .field-zone .game-card.duel-card.attack-candidate.dragging {
    animation-play-state: paused;
}

body.duel-playing .board-main .field-zone .game-card.duel-card.has-field-template-card .captured-card-stack,
body.duel-playing .board-main .field-zone .game-card.duel-card.has-field-template-card .support-card-stack {
    z-index: 12;
}

@media (max-width: 760px) {
    body.duel-playing .board-main .field-zone .game-card.duel-card.has-field-template-card {
        width: clamp(132px, 38vw, 172px);
        min-width: clamp(132px, 38vw, 172px);
    }
}

@keyframes attackCandidateHop {
    0%, 100% { transform: translateY(0); }
    42% { transform: translateY(-5px); }
    58% { transform: translateY(-3px); }
}

@keyframes attackCandidateTemplateGlow {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0)); }
    50% { filter: drop-shadow(0 0 10px rgba(250, 204, 21, .5)); }
}
