.duel-button {
  font: 600 14px/1.2 'Barlow', system-ui, sans-serif;
  color: #211605; background: linear-gradient(#ffe993,#ffd052);
  border: 1px solid #ffe992; border-radius: 12px;
  min-height: 42px; padding: 10px 14px; cursor: pointer;
  pointer-events: auto; touch-action: manipulation;
}
.duel-button:disabled { opacity: .48; cursor: default; }
.duel-button:focus-visible { outline: 2px solid white; outline-offset: 3px; }
.duel-secondary { color: #e0e8f2; background: #ffffff10; border-color: #ffffff30; }
/* El ancho del lobby no sirve para comparar tres poderes. Solo esta vista
   se amplía; cabecera y regreso quedan fuera del área desplazable. */
.lobby-card:has(.duel-shop.is-visible) {
  width: 860px; max-width: calc(100% - 28px); max-height: calc(100% - 24px);
  padding: 0; overflow: hidden; border-radius: 22px;
  background: linear-gradient(145deg, #171e30, #090e19 70%);
  border: 1px solid #52617b; box-shadow: 0 24px 80px #0009, inset 0 1px #ffffff12;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.lobby-card:has(.duel-shop.is-visible) > .lobby-msg:empty { display: none; }
.duel-shop { min-height: 0; gap: 0; }
.duel-shop-header { display: flex; align-items: center; flex-shrink: 0; gap: 18px; padding: 20px 22px; border-bottom: 1px solid #ffffff14; }
.duel-shop-heading { flex: 1; min-width: 0; }
.duel-eyebrow { display: block; font: 600 11px/1.3 var(--body); letter-spacing: .12em; color: #abb9cc; }
.duel-shop-heading h2 { margin: 4px 0 0; font: 600 28px/1.12 var(--display); color: #f5f7fc; }
.duel-budget { display: flex; align-items: center; gap: 10px; padding: 8px 13px; border: 1px solid #ffd95a38; border-radius: 12px; background: #ffd95a0a; }
.duel-credits { color: #ffe287; font: 600 32px/1 var(--display); font-variant-numeric: tabular-nums; min-width: 22px; text-align: center; }
.duel-budget span { display: block; font: 600 13px/1.3 var(--body); color: #ffe8a3; }
.duel-budget small { display: block; font: 400 11px/1.4 var(--body); color: #bdc7d8; }
.duel-shop-close { flex: 0 0 42px; width: 42px; padding: 0; color: #d6dfed; background: #ffffff09; border-color: #ffffff20; font: 400 27px/1 var(--body); }
.duel-shop-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 16px 22px 12px; scrollbar-width: thin; scrollbar-color: #627089 #101624; }
.duel-shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.duel-shop-item { display: flex; flex-direction: column; min-width: 0; padding: 16px; border: 1px solid #ffffff24; border-radius: 16px; background: linear-gradient(160deg, #25304780, #101725); }
.duel-item-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.duel-item-icon { display: flex; width: 42px; height: 42px; color: var(--duel-accent); }
.duel-item-icon svg { width: 100%; height: 100%; }
.duel-item-badge { color: #a9b7cc; font: 600 10px/1.2 var(--body); letter-spacing: .08em; text-align: right; }
.duel-shop-item h3 { margin: 12px 0 7px; font: 600 23px/1.1 var(--display); color: var(--duel-accent); }
.duel-item-description { flex: 1; margin: 0 0 16px; font: 400 15px/1.4 var(--body); color: #d6dfec; }
.duel-shop-item .duel-button { width: 100%; min-height: 44px; font-size: 14px; }
.duel-shop-item.is-chosen { border-color: #7ce0a8; background: linear-gradient(160deg, #163a32, #101d24); }
.duel-shop-item.is-chosen .duel-item-badge { color: #94efbb; }
.duel-shop-item.is-chosen .duel-button { opacity: 1; color: #a9f3c8; border-color: #66b48b66; background: #7de3a414; }
.duel-shop-rules { margin-top: 12px; color: #b7c5d9; font: 400 13px/1.45 var(--body); }
.duel-shop-rules summary { width: fit-content; cursor: pointer; padding: 5px 0; color: #dce5f2; }
.duel-shop-rules summary:focus-visible { outline: 2px solid #ffdf85; outline-offset: 3px; border-radius: 3px; }
.duel-shop-rules p { margin: 8px 0; }
.duel-shop-feedback { margin: 0 0 12px; padding: 10px; border: 1px solid #ffd95a44; border-radius: 10px; color: #ffe6a0; background: #ffd95a09; font: 400 14px/1.35 var(--body); }
.duel-shop-feedback[hidden] { display: none; }
.duel-shop-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-shrink: 0; padding: 14px 22px; border-top: 1px solid #ffffff1a; background: #0c121f; }
.duel-loadout { min-width: 0; }
.duel-equipment { margin: 4px 0 0; font: 600 15px/1.25 var(--body); color: #f0f4fa; overflow-wrap: anywhere; }
.duel-shop-return { flex-shrink: 0; min-height: 44px; padding-inline: 24px; }
@media (hover: hover) {
  .duel-shop .duel-button:not(:disabled):hover { filter: brightness(1.1); }
}
.duel-hud { position: absolute; bottom: 16px; right: 20px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; max-width: 44%; pointer-events: none; }
.duel-hud[hidden], .duel-selector[hidden], .duel-button[hidden] { display: none; }
/* El duelo ocupa el rincón de récords personales; no superponer ambos paneles. */
.screen-hud:has(.duel-hud:not([hidden])) .hud-bottomright .stats { visibility: hidden; }
.duel-hud-label { color: #ffdf85; background: #080d19de; border-radius: 8px; padding: 4px 9px; font: 600 13px 'Barlow', sans-serif; }
.duel-hud-buttons, .duel-targets { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.duel-selector { border: 1px solid #ffde72; background: #101727f5; padding: 10px; border-radius: 14px; }
.duel-target-label { color: #fff0b5; margin: 0 0 8px; font: 600 14px 'Barlow', sans-serif; }
.duel-targets .duel-button { max-width: 220px; overflow-wrap: anywhere; }
/* Durante la carrera estos botones se tocan con un dedo mientras el otro
   sostiene el joystick. `manipulation` deja vivo el doble-tap-zoom, y con dos
   dedos apoyados el navegador puede empezar a evaluar un gesto y cancelar el
   toque del canvas. Acá no hay nada que desplazar ni ampliar: sin gestos. */
.duel-hud .duel-button { touch-action: none; }
@media (pointer: coarse) {
  .duel-hud { right: 10px; bottom: 8px; max-width: 43%; }
  .duel-button { font-size: 13px; padding: 8px 10px; }
  /* Los de la carrera se tocan con el otro dedo ocupado en el joystick, así
     que van al mínimo táctil real. Están en px de MAQUETA y #ui se escala por
     --ui-scale (alto del canvas / 370): en la pantalla más chica que se
     soporta, 320px de alto => escala 0,865, los 42px de .duel-button quedaban
     en 36px reales. 50 da 43,3 ahí y 50+ en un celular normal. La tienda no
     entra acá: se usa con el juego quieto y con las dos manos libres. */
  .duel-hud .duel-button { min-height: 50px; padding: 10px 12px; }
  .duel-shop-header { padding: 8px 16px; gap: 12px; }
  .duel-shop-heading .duel-eyebrow { display: none; }
  .duel-shop-heading h2 { font-size: 24px; }
  .duel-shop-close { font-size: 27px; padding: 0; }
  .duel-budget { padding: 6px 10px; }
  .duel-credits { font-size: 28px; }
  .duel-shop-body { padding: 12px 16px 6px; }
  .duel-shop-item { padding: 11px; }
  .duel-item-icon { width: 30px; height: 30px; }
  .duel-shop-item h3 { margin: 7px 0 5px; font-size: 21px; }
  .duel-item-description { font-size: 14px; line-height: 1.3; margin-bottom: 10px; }
  .duel-shop-footer { padding: 8px 16px; }
  .duel-shop-rules { margin-top: 6px; }
}
/* Fallback para ventanas angostas; la orientación del juego no se modifica. */
@media (max-aspect-ratio: 1/1) {
  .duel-shop-grid { grid-template-columns: 1fr; }
  .duel-budget small, .duel-shop-heading .duel-eyebrow { display: none; }
  .duel-shop-header { gap: 8px; padding: 12px; flex-wrap: wrap; }
  .duel-shop-heading h2 { font-size: 22px; }
  .duel-shop-footer { padding: 12px; flex-wrap: wrap; }
}
