/* TDL — juegos en mobile (duelo, coinflip, maquinitas). Solo celulares. */
@media (max-width: 767px) {

  /* ===== Comunes ===== */
  html body:is(.page-dino_duelo,.page-coinflip,.page-maquinitas):not(#x):not(#y):not(#z) :is(.duel-recent-card,.cf-card) .truncate {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    line-height: 1.2 !important;
  }

  /* ===== DUELO ===== */
  /* Barra de vida: los dos jugadores arriba en una fila, "Preparados" centrado encima */
  html body.page-dino_duelo:not(#x):not(#y):not(#z) .duel-hud {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
    row-gap: 8px !important;
    column-gap: 14px !important;
  }
  html body.page-dino_duelo:not(#x):not(#y):not(#z) .duel-hud .duel-round-badge {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    justify-self: center !important;
    width: auto !important;
    max-width: max-content !important;
    min-width: 0 !important;
    padding: 5px 16px !important;
    font-size: 10px !important;
  }
  html body.page-dino_duelo:not(#x):not(#y):not(#z) .duel-hud .duel-health { grid-row: 2 !important; min-width: 0 !important; }
  html body.page-dino_duelo:not(#x):not(#y):not(#z) .duel-health-meta {
    font-size: 11px !important;
    gap: 6px !important;
  }
  html body.page-dino_duelo:not(#x):not(#y):not(#z) .duel-health-meta > span:first-child {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  html body.page-dino_duelo:not(#x):not(#y):not(#z) .duel-health-meta > span:last-child { flex: 0 0 auto !important; color: #f5c451 !important; }
  html body.page-dino_duelo:not(#x):not(#y):not(#z) .duel-fighter p {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
  }

  /* Selector de dinos: 2 columnas, nombres enteros */
  html body.page-dino_duelo:not(#x):not(#y):not(#z) .tdl-create-wide #dino-picker {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 10px !important;
  }
  html body.page-dino_duelo:not(#x):not(#y):not(#z) #dino-picker .duel-dino-option {
    padding: 12px 10px !important;
    text-align: center !important;
  }
  html body.page-dino_duelo:not(#x):not(#y):not(#z) #dino-picker .duel-dino-option img { height: 72px !important; }
  html body.page-dino_duelo:not(#x):not(#y):not(#z) #dino-picker .duel-dino-option p {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }
  html body.page-dino_duelo:not(#x):not(#y):not(#z) #dino-picker .duel-dino-option p:first-of-type {
    font-size: 15px !important;
    letter-spacing: 0 !important;
    line-height: 1.15 !important;
    margin-top: 6px !important;
  }
  html body.page-dino_duelo:not(#x):not(#y):not(#z) #dino-picker .duel-dino-option p + p {
    white-space: normal !important;
    overflow: visible !important;
    line-height: 1.3 !important;
    font-size: 10px !important;
    letter-spacing: .08em !important;
    margin-top: 2px !important;
  }

  /* Historial: textos completos */
  html body.page-dino_duelo:not(#x):not(#y):not(#z) .duel-recent-card .font-oswald { font-size: 16px !important; }
  html body.page-dino_duelo:not(#x):not(#y):not(#z) .duel-recent-card p[class*="text-[9px]"] { font-size: 10px !important; }

  /* ===== COINFLIP ===== */
  html body.page-coinflip:not(#x):not(#y):not(#z) .cf-card .font-oswald { font-size: 16px !important; }
  html body.page-coinflip:not(#x):not(#y):not(#z) .cf-card p[class*="text-[9px]"] { font-size: 10px !important; }
  html body.page-coinflip:not(#x):not(#y):not(#z) .cf-topline p[class*="text-[8px]"] { font-size: 10px !important; letter-spacing: .18em !important; }
  html body.page-coinflip:not(#x):not(#y):not(#z) .cf-pot p[class*="text-[8px]"] { font-size: 10px !important; letter-spacing: .12em !important; }

  /* ===== MAQUINITAS ===== */
  /* Datos del encabezado: todos del mismo ancho */
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-hero-meta {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-hero-meta .slot-meta-pill {
    width: 100% !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    font-size: 13px !important;
    padding: 10px 14px !important;
    box-sizing: border-box !important;
  }
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-hero-meta .slot-hero-price {
    justify-content: center !important;
    font-size: 15px !important;
  }
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-hero-meta .slot-hero-price strong {
    width: auto !important;
    white-space: nowrap !important;
  }

  /* Saldo / giros restantes parejos */
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-status-bar { align-items: stretch !important; }
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-status-bar .slot-status-light { align-self: center !important; }
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-counter small {
    font-size: 11px !important;
    letter-spacing: .1em !important;
    white-space: nowrap !important;
  }

  /* Rodillos: que el nombre del premio entre entero */
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-symbol {
    grid-template-rows: 1fr auto !important;
    padding: 6px 4px !important;
    gap: 4px !important;
  }
  /* El script de la máquina fija el tamaño en línea (16px), así que se achica con zoom */
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-symbol b {
    zoom: .68;
    max-width: 100% !important;
    line-height: 1.1 !important;
    letter-spacing: .02em !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-align: center !important;
  }
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-symbol img {
    max-height: 48px !important;
    object-fit: contain !important;
    justify-self: center !important;
    align-self: center !important;
  }

  /* Historial: título arriba, contador abajo */
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-history-head {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-history-head h2 { white-space: nowrap !important; }
  html body.page-maquinitas:not(#x):not(#y):not(#z) .slot-history-head > :last-child { align-self: flex-start !important; }
}
