/* El duelo del cofre espacial: la oferta de rivales, la pelea a pantalla completa (lienzo 16:9), los controles táctiles y el resultado. Las tarjetas reutilizan .shop-card de online.css. */
#duel { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(6,4,22,.86); padding: 12px; overflow-y: auto; font-family: var(--font-body); }
#duel[hidden], #duel-offer[hidden], #duel-fight[hidden], #duel-pad[hidden], #duel-confirm[hidden], #duel-result[hidden], #duel-esc[hidden] { display: none; }
#duel.fighting { background: #05030f; padding: 0; overflow: hidden; }
.duel-card { width: min(720px, 100%); border-color: #9d8cff; background: linear-gradient(180deg, #1f1650, #0e0a26); color: #e8e0ff; }
.duel-card h3 { color: #c9bcff; }
.duel-card .shop-pts b { color: #ffd166; }
#duel-sub { margin: 0 0 10px; font-size: .85rem; line-height: 1.35; color: #bdb4ee; }
#duel-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dcard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; background: rgba(255,255,255,.06); border: 2px solid rgba(157,140,255,.45); text-align: center; }
.dcard canvas { width: 100%; max-width: 120px; height: 120px; object-fit: contain; image-rendering: auto; }
.dcard b { font-size: .95rem; color: #fff; }
.dcard .tier { font-size: .85rem; letter-spacing: .1em; color: #ffd166; }
.dcard .tier i { font-style: normal; opacity: .25; } .dcard .tier i.on { opacity: 1; }
.dcard .prize { font-size: .8rem; color: #8dffb0; } .dcard .entry { font-size: .78rem; color: #d9cba2; }
.dcard button, #duel-close, #duel-rok, #duel-cyes, #duel-cno { cursor: pointer; background: #9d8cff; color: #120a30; border: 2px solid #000; box-shadow: 2px 2px 0 #000; padding: 6px 10px; font: 700 .78rem var(--font-pixel); text-transform: uppercase; }
.dcard button:hover:not(:disabled), #duel-close:hover, #duel-rok:hover, #duel-cyes:hover, #duel-cno:hover { background: #bfb3ff; }
.dcard button:disabled { background: #4a4468; color: #a39bc9; cursor: not-allowed; box-shadow: none; }
.dcard .why { font-size: .72rem; color: #ffb3a8; min-height: 1em; }
#duel-msg { min-height: 1.2em; margin: 10px 0 8px; font-size: .85rem; } #duel-msg.bad { color: #ffb3a8; }
#duel-close { margin-top: 2px; }
#duel-fight { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
#duel-cv { width: min(100%, calc(100vh * 16 / 9)); max-height: 100%; aspect-ratio: 16 / 9; background: #000; touch-action: none; }
#duel-mute, #duel-esc { position: absolute; top: 8px; z-index: 3; cursor: pointer; background: rgba(20,10,50,.7); color: #fff; border: 2px solid rgba(157,140,255,.7); border-radius: 8px; padding: 4px 9px; font-size: 1rem; }
#duel-mute { right: 8px; } #duel-esc { left: 8px; font: 700 .75rem var(--font-pixel); text-transform: uppercase; }
#duel-confirm, #duel-result { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; background: rgba(5,3,15,.7); padding: 12px; }
#duel-confirm .shop-card, #duel-result .shop-card { width: min(380px, 100%); border-color: #9d8cff; background: linear-gradient(180deg, #1f1650, #0e0a26); color: #e8e0ff; text-align: center; }
#duel-confirm .shop-card h3, #duel-result .shop-card h3 { color: #ffd166; }
#duel-result.win .shop-card h3 { color: #8dffb0; } #duel-result.lose .shop-card h3 { color: #ffb3a8; }
#duel-confirm p, #duel-result p { margin: 6px 0 12px; line-height: 1.4; white-space: pre-line; }
#duel-cyes, #duel-cno { margin: 0 4px; }
#duel-pad { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 14px 14px; pointer-events: none; touch-action: none; }
.dp { display: grid; gap: 8px; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.dp-left { grid-template-columns: repeat(3, 64px); grid-template-areas: ". up ." "left down right"; }
.dp-left button[data-b="1"] { grid-area: left; } .dp-left button[data-b="2"] { grid-area: right; } .dp-left button[data-b="8"] { grid-area: down; } .dp-left .dp-up { grid-area: up; }
.dp-right { grid-template-columns: repeat(2, 72px); }
.dp button { height: 64px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); background: rgba(40,30,110,.55); color: #fff; font: 700 .72rem var(--font-pixel); text-transform: uppercase; touch-action: none; }
.dp button.on { background: rgba(157,140,255,.85); color: #120a30; }
.dp-right button { height: 72px; font-size: .52rem; letter-spacing: 0; padding: 0; }
@media (pointer: coarse) { #duel-pad { display: flex; } #duel-mute { top: 4px; } }
@media (max-width: 560px) { #duel-cards { grid-template-columns: 1fr; } .dcard { flex-direction: row; flex-wrap: wrap; justify-content: center; } .dcard canvas { max-width: 70px; height: 70px; } }
